Re: How to handle non-local renames?

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

 



> > 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

Right, if the move would create a loop, it obviously can't be done,
but that could be checked (if the locking could be done).

The problem is that what NFS does is not enough for FUSE, since in the
FUSE case the "server" cannot be trusted to not allow loops.  So even
case 1 becomes much more difficult.  That is why I'm searching for an
alternative.

Thanks,
Miklos
-
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