summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-30 16:11:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-26 07:41:29 -0700
commit839f573c0438d44d1df1df96963150668d5846c9 (patch)
tree4af0e55da004b83efbe8a1f70458a04c98628aaa /fs
parente422a4a5d60c8dbef19df3ea16aaf7556cd26223 (diff)
downloadlinux-stable-839f573c0438d44d1df1df96963150668d5846c9.tar.gz
linux-stable-839f573c0438d44d1df1df96963150668d5846c9.tar.bz2
linux-stable-839f573c0438d44d1df1df96963150668d5846c9.zip
fix NFS4 handling of mountpoint stat
commit 462d60577a997aa87c935ae4521bd303733a9f2b upstream. RFC says we need to follow the chain of mounts if there's more than one stacked on that point. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4xdr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 0fbd50cee1f6..c598ab948211 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2129,9 +2129,15 @@ out_acl:
* and this is the root of a cross-mounted filesystem.
*/
if (ignore_crossmnt == 0 &&
- exp->ex_path.mnt->mnt_root->d_inode == dentry->d_inode) {
- err = vfs_getattr(exp->ex_path.mnt->mnt_parent,
- exp->ex_path.mnt->mnt_mountpoint, &stat);
+ dentry == exp->ex_path.mnt->mnt_root) {
+ struct path path = exp->ex_path;
+ path_get(&path);
+ while (follow_up(&path)) {
+ if (path.dentry != path.mnt->mnt_root)
+ break;
+ }
+ err = vfs_getattr(path.mnt, path.dentry, &stat);
+ path_put(&path);
if (err)
goto out_nfserr;
}