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>
This commit is contained in:
Al Viro 2010-01-30 16:11:21 -05:00
parent 3088dd7080
commit 462d60577a

View File

@ -2121,9 +2121,15 @@ out_acl:
* and this is the root of a cross-mounted filesystem. * and this is the root of a cross-mounted filesystem.
*/ */
if (ignore_crossmnt == 0 && if (ignore_crossmnt == 0 &&
exp->ex_path.mnt->mnt_root->d_inode == dentry->d_inode) { dentry == exp->ex_path.mnt->mnt_root) {
err = vfs_getattr(exp->ex_path.mnt->mnt_parent, struct path path = exp->ex_path;
exp->ex_path.mnt->mnt_mountpoint, &stat); 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) if (err)
goto out_nfserr; goto out_nfserr;
} }