Commit 839f573c authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

fix NFS4 handling of mountpoint stat

commit 462d6057 upstream.

RFC says we need to follow the chain of mounts if there's more
than one stacked on that point.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e422a4a5
......@@ -2129,9 +2129,15 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
* 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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment