All of lore.kernel.org
 help / color / mirror / Atom feed
* How to handle non-local renames?
@ 2006-09-17 20:43 Miklos Szeredi
  2006-09-18 16:38 ` Trond Myklebust
  0 siblings, 1 reply; 25+ messages in thread
From: Miklos Szeredi @ 2006-09-17 20:43 UTC (permalink / raw)
  To: linux-fsdevel

Consider the scenario where systems A and B share a filesystem mounted
on /mnt.

A: cd /mnt/a/b
B: mv /mnt/a/b /mnt/a/c/d
A: ls /mnt/a/c/d

So in third step the lookup returns a cached inode, to which a cached
dentry with positive refcount already refers.

I can basically think of two possibilities:

  1) instantiate new dentry 'd' with the inode
  2) move the old dentry 'b' to the new dentry 'd'

With 1, there's a problem of directory aliasing, which means the VFS
doesn't ensure any more that directory loops can't happen.  NFS looks
like it does this, and relies on the server to avoid loops.

2 suffers from locking problems, since lookup already holds a i_mutex
on /mnt/a/c so it can't acquire either the rename_mutex or i_mutex on
/mnt/a which would be needed to safely move the dentry.

Now if a new object is created at /mnt/a/b

B: touch /mnt/a/b
A: ls /mnt/a/b

In case of 1 the old dentry will have to be unhashed and replaced with
the new object.  This means that some things will no longer work for
processes using the old dentry as CWD.  In NFS we'd get a nice ESTALE
error.

Does somebody have any thoughts on this?  Could this be done in a
better way?

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2006-09-29 16:02 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-17 20:43 How to handle non-local renames? Miklos Szeredi
2006-09-18 16:38 ` Trond Myklebust
2006-09-18 18:00   ` Miklos Szeredi
2006-09-19  8:24   ` Miklos Szeredi
2006-09-22  0:00     ` Trond Myklebust
2006-09-22  6:22       ` Miklos Szeredi
2006-09-28 10:02         ` Al Viro
2006-09-28 10:03           ` Al Viro
2006-09-28 10:22             ` Miklos Szeredi
2006-09-28 10:16           ` Miklos Szeredi
2006-09-28 10:27             ` Al Viro
2006-09-28 10:53               ` Miklos Szeredi
2006-09-28 11:21                 ` Al Viro
2006-09-28 11:44                   ` Miklos Szeredi
2006-09-28 11:54                     ` Al Viro
2006-09-28 12:31           ` Trond Myklebust
2006-09-28 12:42             ` Al Viro
2006-09-28 12:57               ` Trond Myklebust
2006-09-28 13:15                 ` Al Viro
2006-09-28 13:31                   ` Trond Myklebust
2006-09-28 14:20                     ` Al Viro
2006-09-28 18:24                       ` Trond Myklebust
2006-09-28 20:50                         ` Randy Dunlap
2006-09-29 14:55                           ` Trond Myklebust
2006-09-29 16:03                             ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.