]> Gentwo Git Trees - linux/.git/commit
NFSD: Rework encoding and decoding of nfsd4_deviceid
authorSergey Bashirov <sergeybashirov@gmail.com>
Mon, 21 Jul 2025 14:48:55 +0000 (17:48 +0300)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 21 Sep 2025 23:24:50 +0000 (19:24 -0400)
commit832738e4b325b742940761e10487403f9aad13e8
tree9a518b50759a4abbc794bb3c6169373bd5716002
parentc97b737ef8f10f28424822c139e3b22b9e9bcc2b
NFSD: Rework encoding and decoding of nfsd4_deviceid

Compilers may optimize the layout of C structures, so we should not rely
on sizeof struct and memcpy to encode and decode XDR structures. The byte
order of the fields should also be taken into account.

This patch adds the correct functions to handle the deviceid4 structure
and removes the pad field, which is currently not used by NFSD, from the
runtime state. The server's byte order is preserved because the deviceid4
blob on the wire is only used as a cookie by the client.

Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/blocklayoutxdr.c
fs/nfsd/flexfilelayoutxdr.c
fs/nfsd/nfs4layouts.c
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h