Commit 68d615f4 authored by Sergey Bashirov's avatar Sergey Bashirov Committed by Greg Kroah-Hartman
Browse files

NFSD: Rework encoding and decoding of nfsd4_deviceid



[ Upstream commit 832738e4 ]

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: default avatarSergey Bashirov <sergeybashirov@gmail.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Stable-dep-of: d68886ba ("NFSD: Fix last write offset handling in layoutcommit")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2dc2bc27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment