aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4xdr.c6
-rw-r--r--fs/nfsd/vfs.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index f8931acb05f3..1a468bbd330f 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1756,6 +1756,10 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1756 struct nfs4_acl *acl = NULL; 1756 struct nfs4_acl *acl = NULL;
1757 struct nfsd4_compoundres *resp = rqstp->rq_resp; 1757 struct nfsd4_compoundres *resp = rqstp->rq_resp;
1758 u32 minorversion = resp->cstate.minorversion; 1758 u32 minorversion = resp->cstate.minorversion;
1759 struct path path = {
1760 .mnt = exp->ex_path.mnt,
1761 .dentry = dentry,
1762 };
1759 1763
1760 BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1); 1764 BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
1761 BUG_ON(bmval0 & ~nfsd_suppattrs0(minorversion)); 1765 BUG_ON(bmval0 & ~nfsd_suppattrs0(minorversion));
@@ -1776,7 +1780,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1776 FATTR4_WORD0_MAXNAME)) || 1780 FATTR4_WORD0_MAXNAME)) ||
1777 (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | 1781 (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE |
1778 FATTR4_WORD1_SPACE_TOTAL))) { 1782 FATTR4_WORD1_SPACE_TOTAL))) {
1779 err = vfs_statfs(dentry, &statfs); 1783 err = vfs_statfs(&path, &statfs);
1780 if (err) 1784 if (err)
1781 goto out_nfserr; 1785 goto out_nfserr;
1782 } 1786 }
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 9df85a13af28..96360a83cb91 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -934,7 +934,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
934 nfsdstats.io_read += host_err; 934 nfsdstats.io_read += host_err;
935 *count = host_err; 935 *count = host_err;
936 err = 0; 936 err = 0;
937 fsnotify_access(file->f_path.dentry); 937 fsnotify_access(file);
938 } else 938 } else
939 err = nfserrno(host_err); 939 err = nfserrno(host_err);
940out: 940out:
@@ -1045,7 +1045,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1045 goto out_nfserr; 1045 goto out_nfserr;
1046 *cnt = host_err; 1046 *cnt = host_err;
1047 nfsdstats.io_write += host_err; 1047 nfsdstats.io_write += host_err;
1048 fsnotify_modify(file->f_path.dentry); 1048 fsnotify_modify(file);
1049 1049
1050 /* clear setuid/setgid flag after write */ 1050 /* clear setuid/setgid flag after write */
1051 if (inode->i_mode & (S_ISUID | S_ISGID)) 1051 if (inode->i_mode & (S_ISUID | S_ISGID))
@@ -2033,8 +2033,14 @@ out:
2033__be32 2033__be32
2034nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access) 2034nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access)
2035{ 2035{
2036 __be32 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access); 2036 struct path path = {
2037 if (!err && vfs_statfs(fhp->fh_dentry,stat)) 2037 .mnt = fhp->fh_export->ex_path.mnt,
2038 .dentry = fhp->fh_dentry,
2039 };
2040 __be32 err;
2041
2042 err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
2043 if (!err && vfs_statfs(&path, stat))
2038 err = nfserr_io; 2044 err = nfserr_io;
2039 return err; 2045 return err;
2040} 2046}