Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / vfs.c
index 9df85a13af28b03fadc9fa47ae61aeffb4dc911c..8812f6b9396955c67c9767b0d96fe43daf1f6911 100644 (file)
@@ -2033,8 +2033,14 @@ out:
 __be32
 nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access)
 {
-       __be32 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
-       if (!err && vfs_statfs(fhp->fh_dentry,stat))
+       struct path path = {
+               .mnt    = fhp->fh_export->ex_path.mnt,
+               .dentry = fhp->fh_dentry,
+       };
+       __be32 err;
+
+       err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
+       if (!err && vfs_statfs(&path, stat))
                err = nfserr_io;
        return err;
 }