[Devel] Re: [PATCH 1/3] Checkpoint/restart epoll sets
Serge E. Hallyn
serue at us.ibm.com
Thu Oct 22 07:02:29 PDT 2009
Quoting Matt Helsley (matthltc at us.ibm.com):
> On Tue, Oct 20, 2009 at 07:31:28PM -0500, Serge E. Hallyn wrote:
> > Quoting Matt Helsley (matthltc at us.ibm.com):
>
> <snip>
>
> > > +struct file* ep_file_restore(struct ckpt_ctx *ctx,
> > > + struct ckpt_hdr_file *h)
> > > +{
> > > + struct file *epfile;
> > > + int epfd, ret;
> > > +
> > > + if (h->h.type != CKPT_HDR_FILE ||
> > > + h->h.len != sizeof(*h) ||
> > > + h->f_type != CKPT_FILE_EPOLL)
> > > + return ERR_PTR(-EINVAL);
> > > +
> > > + epfd = sys_epoll_create1(h->f_flags & EPOLL_CLOEXEC);
> > > + if (epfd < 0)
> > > + return ERR_PTR(epfd);
> > > + epfile = fget(epfd);
> > > + sys_close(epfd); /* harmless even if an error occured */
> > > + BUG_ON(!epfile);
> >
> > Would perhaps return ERR_PTR(-ENOENT) be nicer? (And maybe safer - I'm
> > not quite clear on under which arches BUG_ON does nothing).
>
> OK, good idea. Mind if I post it as a separate patch to be merged with
> this series?
Haha, yeah, pls don't repost the whole patch with a two-line change :)
-serge
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list