]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix dentry aliasing issues in open_by_handle
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Jan 2009 01:02:57 +0000 (02:02 +0100)
committerLachlan McIlroy <lachlan@sgi.com>
Mon, 19 Jan 2009 03:43:18 +0000 (14:43 +1100)
commit685ef7913d527a8b0cd721208cf936d495faa152
tree40c35f802be9307a4739ff3b22260d3a0788c2f0
parent2e1dc5264622ab3af52fd4a25c9eacf812e23eb4
xfs: fix dentry aliasing issues in open_by_handle

Open by handle just grabs an inode by handle and then creates itself
a dentry for it.  While this works for regular files it is horribly
broken for directories, where the VFS locking relies on the fact that
there is only just one single dentry for a given inode, and that
these are always connected to the root of the filesystem so that
it's locking algorithms work (see Documentations/filesystems/Locking)

Remove all the existing open by handle code and replace it with a small
wrapper around the exportfs code which deals with all these issues.
At the same time we also make the checks for a valid handle strict
enough to reject all not perfectly well formed handles - given that
we never hand out others that's okay and simplifies the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
fs/xfs/Kconfig
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_ioctl.h
fs/xfs/linux-2.6/xfs_ioctl32.c