aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs2acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs2acl.c')
-rw-r--r--fs/nfsd/nfs2acl.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 9170861c804a..95d76dc6c5da 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -45,6 +45,10 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp,
45 RETURN_STATUS(nfserr_inval); 45 RETURN_STATUS(nfserr_inval);
46 resp->mask = argp->mask; 46 resp->mask = argp->mask;
47 47
48 nfserr = fh_getattr(fh, &resp->stat);
49 if (nfserr)
50 goto fail;
51
48 if (resp->mask & (NFS_ACL|NFS_ACLCNT)) { 52 if (resp->mask & (NFS_ACL|NFS_ACLCNT)) {
49 acl = nfsd_get_posix_acl(fh, ACL_TYPE_ACCESS); 53 acl = nfsd_get_posix_acl(fh, ACL_TYPE_ACCESS);
50 if (IS_ERR(acl)) { 54 if (IS_ERR(acl)) {
@@ -115,6 +119,9 @@ static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp,
115 nfserr = nfserrno( nfsd_set_posix_acl( 119 nfserr = nfserrno( nfsd_set_posix_acl(
116 fh, ACL_TYPE_DEFAULT, argp->acl_default) ); 120 fh, ACL_TYPE_DEFAULT, argp->acl_default) );
117 } 121 }
122 if (!nfserr) {
123 nfserr = fh_getattr(fh, &resp->stat);
124 }
118 125
119 /* argp->acl_{access,default} may have been allocated in 126 /* argp->acl_{access,default} may have been allocated in
120 nfssvc_decode_setaclargs. */ 127 nfssvc_decode_setaclargs. */
@@ -129,10 +136,15 @@ static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp,
129static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp, 136static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp,
130 struct nfsd_fhandle *argp, struct nfsd_attrstat *resp) 137 struct nfsd_fhandle *argp, struct nfsd_attrstat *resp)
131{ 138{
139 __be32 nfserr;
132 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh)); 140 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
133 141
134 fh_copy(&resp->fh, &argp->fh); 142 fh_copy(&resp->fh, &argp->fh);
135 return fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP); 143 nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP);
144 if (nfserr)
145 return nfserr;
146 nfserr = fh_getattr(&resp->fh, &resp->stat);
147 return nfserr;
136} 148}
137 149
138/* 150/*
@@ -150,6 +162,9 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessarg
150 fh_copy(&resp->fh, &argp->fh); 162 fh_copy(&resp->fh, &argp->fh);
151 resp->access = argp->access; 163 resp->access = argp->access;
152 nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL); 164 nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
165 if (nfserr)
166 return nfserr;
167 nfserr = fh_getattr(&resp->fh, &resp->stat);
153 return nfserr; 168 return nfserr;
154} 169}
155 170
@@ -243,7 +258,7 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
243 return 0; 258 return 0;
244 inode = dentry->d_inode; 259 inode = dentry->d_inode;
245 260
246 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh); 261 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
247 *p++ = htonl(resp->mask); 262 *p++ = htonl(resp->mask);
248 if (!xdr_ressize_check(rqstp, p)) 263 if (!xdr_ressize_check(rqstp, p))
249 return 0; 264 return 0;
@@ -274,7 +289,7 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
274static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p, 289static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p,
275 struct nfsd_attrstat *resp) 290 struct nfsd_attrstat *resp)
276{ 291{
277 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh); 292 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
278 return xdr_ressize_check(rqstp, p); 293 return xdr_ressize_check(rqstp, p);
279} 294}
280 295
@@ -282,7 +297,7 @@ static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p,
282static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, 297static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
283 struct nfsd3_accessres *resp) 298 struct nfsd3_accessres *resp)
284{ 299{
285 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh); 300 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
286 *p++ = htonl(resp->access); 301 *p++ = htonl(resp->access);
287 return xdr_ressize_check(rqstp, p); 302 return xdr_ressize_check(rqstp, p);
288} 303}