[Devel] Re: [C/R v20][PATCH 38/96] c/r: dump open file descriptors

Jamie Lokier jamie at shareable.org
Sun Mar 21 19:20:03 PDT 2010


Matt Helsley wrote:
> On Sun, Mar 21, 2010 at 05:27:03PM +0000, Jamie Lokier wrote:
> > Matt Helsley wrote:
> > > > That said, if the intent is to allow the restore to be done on
> > > > another node with a "similar" filesystem (e.g. created by rsync/node
> > > > image), instead of having a coherent distributed filesystem on all
> > > > of the nodes then the filename makes sense.
> > > 
> > > Yes, this is the intent.
> > 
> > I would worry about programs which are using files which have been
> > deleted, renamed, or (very common) renamed-over by another process
> > after being opened, as there's a good chance they will successfully
> > open the wrong file after c/r, and corrupt state from then on.
> 
> The code in the patches does check for unlinked files and refuses
> to checkpoint if an unlinked file is open. Yes, this limits the usefulness
> of the code somewhat but it's a problem we can solve and c/r is still quite
> useful without the solution.
> 
> We've done our best to try and reach that ideal. You're welcome to have a
> look at the code to see if you can find any ways in which we haven't.
> Here's the code that refuses to checkpoint unsupported files. I think
> it's pretty easy to read:

>From a very quick read, 

>         if (d_unlinked(file->f_dentry)) {
>                 ckpt_err(ctx, -EBADF, "%(T)%(P)Unlinked files unsupported\n",
>                          file);

Hmm.

I wonder if d_unlinked() is always true for a file which is opened,
unlinked or renamed over, but has a hard link to it from elsewhere so
the on-disk file hasn't gone away.

I guess it probably is.  That's kinda neat!  I'd hoped there would be a
good reason for f_dentry eventually ;-)

What about files opened through /proc/self/fd/N before or after the
original file was unlinked/renamed-over.  Where does the dentry point?

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




More information about the Devel mailing list