]> asedeno.scripts.mit.edu Git - linux.git/commit
NFS: Account for XDR pad of buf->pages
authorChuck Lever <chuck.lever@oracle.com>
Mon, 11 Feb 2019 16:25:25 +0000 (11:25 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 14 Feb 2019 15:13:49 +0000 (10:13 -0500)
commit02ef04e432babf8fc703104212314e54112ecd2d
tree4386362756ae73c0fbe207be07fe5bda86037295
parentcf500bac8fd48b57f38ece890235923d4ed5ee91
NFS: Account for XDR pad of buf->pages

Certain NFS results (eg. READLINK) might expect a data payload that
is not an exact multiple of 4 bytes. In this case, XDR encoding
is required to pad that payload so its length on the wire is a
multiple of 4 bytes. The constants that define the maximum size of
each NFS result do not appear to account for this extra word.

In each case where the data payload is to be received into pages:

- 1 word is added to the size of the receive buffer allocated by
  call_allocate

- rpc_inline_rcv_pages subtracts 1 word from @hdrsize so that the
  extra buffer space falls into the rcv_buf's tail iovec

- If buf->pagelen is word-aligned, an XDR pad is not needed and
  is thus removed from the tail

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs2xdr.c
fs/nfs/nfs3xdr.c
fs/nfs/nfs4xdr.c
net/sunrpc/clnt.c
net/sunrpc/xdr.c