Re: How to handle non-local renames?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2006-09-17 at 22:43 +0200, Miklos Szeredi wrote:
> 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.

2 also suffers from the problem of loops. How do you fix it to deal with
the case of

A: cd /mnt/a/b
B: mv /mnt/a/b /mnt
B: mv /mnt/a /mnt/b
A: cd a

Cheers,
  Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux