]> www.infradead.org Git - users/hch/misc.git/commitdiff
NFSD: Minor cleanup in layoutcommit decoding
authorSergey Bashirov <sergeybashirov@gmail.com>
Tue, 15 Jul 2025 15:32:20 +0000 (18:32 +0300)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 21 Sep 2025 23:24:50 +0000 (19:24 -0400)
Use the appropriate xdr function to decode the lc_newoffset field,
which is a boolean value. See RFC 8881, section 18.42.1.

Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c

index 2acc9abee668f33d2a273f91c2998282eeda069c..cbbb61fcdd499d3f9cd72dabc7c51a08f3a75440 100644 (file)
@@ -1802,7 +1802,7 @@ nfsd4_decode_layoutcommit(struct nfsd4_compoundargs *argp,
        status = nfsd4_decode_stateid4(argp, &lcp->lc_sid);
        if (status)
                return status;
-       if (xdr_stream_decode_u32(argp->xdr, &lcp->lc_newoffset) < 0)
+       if (xdr_stream_decode_bool(argp->xdr, &lcp->lc_newoffset) < 0)
                return nfserr_bad_xdr;
        if (lcp->lc_newoffset) {
                if (xdr_stream_decode_u64(argp->xdr, &lcp->lc_last_wr) < 0)