Commit 05027eaf authored by Chuck Lever's avatar Chuck Lever

NFSD: Update the NFSv3 GETACL argument decoder to use struct xdr_stream

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent baadce65
...@@ -124,19 +124,20 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp) ...@@ -124,19 +124,20 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp)
/* /*
* XDR decode functions * XDR decode functions
*/ */
static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p) static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
{ {
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
struct nfsd3_getaclargs *args = rqstp->rq_argp; struct nfsd3_getaclargs *args = rqstp->rq_argp;
p = nfs3svc_decode_fh(p, &args->fh); if (!svcxdr_decode_nfs_fh3(xdr, &args->fh))
if (!p) return 0;
if (xdr_stream_decode_u32(xdr, &args->mask) < 0)
return 0; return 0;
args->mask = ntohl(*p); p++;
return xdr_argsize_check(rqstp, p); return 1;
} }
static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p) static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nfsd3_setaclargs *args = rqstp->rq_argp; struct nfsd3_setaclargs *args = rqstp->rq_argp;
......
...@@ -53,7 +53,16 @@ svcxdr_decode_nfstime3(struct xdr_stream *xdr, struct timespec64 *timep) ...@@ -53,7 +53,16 @@ svcxdr_decode_nfstime3(struct xdr_stream *xdr, struct timespec64 *timep)
return true; return true;
} }
static bool /**
* svcxdr_decode_nfs_fh3 - Decode an NFSv3 file handle
* @xdr: XDR stream positioned at an undecoded NFSv3 FH
* @fhp: OUT: filled-in server file handle
*
* Return values:
* %false: The encoded file handle was not valid
* %true: @fhp has been initialized
*/
bool
svcxdr_decode_nfs_fh3(struct xdr_stream *xdr, struct svc_fh *fhp) svcxdr_decode_nfs_fh3(struct xdr_stream *xdr, struct svc_fh *fhp)
{ {
__be32 *p; __be32 *p;
......
...@@ -308,6 +308,7 @@ int nfs3svc_encode_entry_plus(void *, const char *name, ...@@ -308,6 +308,7 @@ int nfs3svc_encode_entry_plus(void *, const char *name,
__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, __be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p,
struct svc_fh *fhp); struct svc_fh *fhp);
__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp); __be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp);
bool svcxdr_decode_nfs_fh3(struct xdr_stream *xdr, struct svc_fh *fhp);
#endif /* _LINUX_NFSD_XDR3_H */ #endif /* _LINUX_NFSD_XDR3_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment