Skip to content

Commit c5809eb

Browse files
committed
NFSD: Finish converting the NFSv3 GETACL result encoder
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-284.30.1.el9_2 commit-author Chuck Lever <chuck.lever@oracle.com> commit 841fd0a For some reason, the NFSv2 GETACL result encoder was fully converted to use the new nfs_stream_encode_acl(), but the NFSv3 equivalent was not similarly converted. Fixes: 20798df ("NFSD: Update the NFSv3 GETACL result encoder to use struct xdr_stream") Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> (cherry picked from commit 841fd0a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 4ab4e1b commit c5809eb

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

fs/nfsd/nfs3acl.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
171171
{
172172
struct nfsd3_getaclres *resp = rqstp->rq_resp;
173173
struct dentry *dentry = resp->fh.fh_dentry;
174-
struct kvec *head = rqstp->rq_res.head;
175174
struct inode *inode;
176-
unsigned int base;
177-
int n;
178-
int w;
179175

180176
if (!svcxdr_encode_nfsstat3(xdr, resp->status))
181177
return false;
@@ -187,26 +183,12 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
187183
if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
188184
return false;
189185

190-
base = (char *)xdr->p - (char *)head->iov_base;
191-
192-
rqstp->rq_res.page_len = w = nfsacl_size(
193-
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
194-
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
195-
while (w > 0) {
196-
if (!*(rqstp->rq_next_page++))
197-
return false;
198-
w -= PAGE_SIZE;
199-
}
200-
201-
n = nfsacl_encode(&rqstp->rq_res, base, inode,
202-
resp->acl_access,
203-
resp->mask & NFS_ACL, 0);
204-
if (n > 0)
205-
n = nfsacl_encode(&rqstp->rq_res, base + n, inode,
206-
resp->acl_default,
207-
resp->mask & NFS_DFACL,
208-
NFS_ACL_DEFAULT);
209-
if (n <= 0)
186+
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
187+
resp->mask & NFS_ACL, 0))
188+
return false;
189+
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default,
190+
resp->mask & NFS_DFACL,
191+
NFS_ACL_DEFAULT))
210192
return false;
211193
break;
212194
default:

0 commit comments

Comments
 (0)