Skip to content

Commit c770f31

Browse files
committed
SUNRPC: Fix xdr_encode_bool()
I discovered that xdr_encode_bool() was returning the same address that was passed in the @p parameter. The documenting comment states that the intent is to return the address of the next buffer location, just like the other "xdr_encode_*" helpers. The result was the encoded results of NFSv3 PATHCONF operations were not formed correctly. Fixes: ded04a5 ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
1 parent 23ba98d commit c770f31

File tree

1 file changed

+2
-2
lines changed
  • include/linux/sunrpc

1 file changed

+2
-2
lines changed

include/linux/sunrpc/xdr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ static inline int xdr_stream_encode_item_absent(struct xdr_stream *xdr)
419419
*/
420420
static inline __be32 *xdr_encode_bool(__be32 *p, u32 n)
421421
{
422-
*p = n ? xdr_one : xdr_zero;
423-
return p++;
422+
*p++ = n ? xdr_one : xdr_zero;
423+
return p;
424424
}
425425

426426
/**

0 commit comments

Comments
 (0)