[Devel] Re: [PATCH] checkpoint/restart: refuse checkpoint on detached file

Dave Hansen dave at linux.vnet.ibm.com
Fri Dec 5 14:53:39 PST 2008


On Fri, 2008-12-05 at 16:46 -0600, Serge E. Hallyn wrote:
> Quoting Dave Hansen (dave at linux.vnet.ibm.com):
> > On Thu, 2008-12-04 at 22:41 -0600, Serge E. Hallyn wrote:
> > > 
> > > @@ -158,6 +173,12 @@ cr_write_fd_ent(struct cr_ctx *ctx, struct
> > > files_struct *files, int fd)
> > >                 goto out;
> > >         }
> > > 
> > > +       /* Make sure this isn't under some detached tree */
> > > +       if (file_in_detached_tree(file)) {
> > > +               ret = -EBADF;
> > > +               goto out;
> > > +       }
> > 
> > Looks fine to me.  This is racy, though.  Right?
> > 
> > There's no locking to keep the thing mounted for the duration of the
> > checkpoint.
> 
> Oh, hahah, yeah.  We have the file pinned so we're not going to
> lose any vfsmnt/dentries, but you're right, someone else could
> come along and umount -l in the middle.
> 
> I suppose we could hold the namespace sem but it doesn't seem worth
> it and could deadlock.
> 
> Patch withdrawn for now  :)

Well, it is better than nothing.  We don't have to worry about people
messing with it if we have complete control over the entire
mnt_namespace.  

-- Dave

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list