]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Clean up the handling of page padding in rpc_prepare_reply_pages()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 22 Nov 2020 01:46:18 +0000 (20:46 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:53 +0000 (14:05 -0500)
commit89a4fba7ff58bdce953632b682242135e73cabf5
treef5b157f23446a5bfe5ef99f92a5085ba40d28e9d
parent8515cdae9193029236b78232f4d5f521990e18a8
SUNRPC: Clean up the handling of page padding in rpc_prepare_reply_pages()

rpc_prepare_reply_pages() currently expects the 'hdrsize' argument to
contain the length of the data that we expect to want placed in the head
kvec plus a count of 1 word of padding that is placed after the page data.
This is very confusing when trying to read the code, and sometimes leads
to callers adding an arbitrary value of '1' just in order to satisfy the
requirement (whether or not the page data actually needs such padding).

This patch aims to clarify the code by changing the 'hdrsize' argument
to remove that 1 word of padding. This means we need to subtract the
padding from all the existing callers.

Fixes: 886dabc61be1 ("NFS: Account for XDR pad of buf->pages")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs2xdr.c
fs/nfs/nfs3xdr.c
fs/nfs/nfs4xdr.c
net/sunrpc/clnt.c
net/sunrpc/xdr.c