fix NFS4 handling of mountpoint stat

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 4, 2010 - 10:01 am

Gitweb:     http://git.kernel.org/linus/462d60577a997aa87c935ae4521bd303733a9f2b
Commit:     462d60577a997aa87c935ae4521bd303733a9f2b
Parent:     3088dd7080d1ecc6d18c27ef9e617cbbd2a2e51e
Author:     Al Viro <viro@zeniv.linux.org.uk>
AuthorDate: Sat Jan 30 16:11:21 2010 -0500
Committer:  Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Wed Mar 3 14:07:57 2010 -0500

    fix NFS4 handling of mountpoint stat
    
    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>
---
 fs/nfsd/nfs4xdr.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index a8587e9..bbf72d8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2121,9 +2121,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;
 		}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fix NFS4 handling of mountpoint stat, Linux Kernel Mailing ..., (Thu Mar 4, 10:01 am)