Patch "SUNRPC: Fix xdr_encode_bool()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    SUNRPC: Fix xdr_encode_bool()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sunrpc-fix-xdr_encode_bool.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3cae461a445d2bdd4955b1431b6f4191bdab77b6
Author: Chuck Lever <chuck.lever@xxxxxxxxxx>
Date:   Tue Jul 19 09:18:35 2022 -0400

    SUNRPC: Fix xdr_encode_bool()
    
    [ Upstream commit c770f31d8f580ed4b965c64f924ec1cc50e41734 ]
    
    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: ded04a587f6c ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream")
    Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index b8fb866e1fd32..59d99ff31c1a9 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -418,8 +418,8 @@ static inline int xdr_stream_encode_item_absent(struct xdr_stream *xdr)
  */
 static inline __be32 *xdr_encode_bool(__be32 *p, u32 n)
 {
-	*p = n ? xdr_one : xdr_zero;
-	return p++;
+	*p++ = n ? xdr_one : xdr_zero;
+	return p;
 }
 
 /**




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux