]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xprtrdma: Fix Read chunk padding
authorChuck Lever <chuck.lever@oracle.com>
Wed, 8 Feb 2017 21:59:46 +0000 (16:59 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 10 Feb 2017 19:02:36 +0000 (14:02 -0500)
commit24abdf1be15c478e2821d6fc903a4a4440beff02
treef608fee0fff90ac8bd8a63f0cb8d53782d4cf0b5
parent26ae102f2cfd0215daa57dc790aa3bfe534403a9
xprtrdma: Fix Read chunk padding

When pad optimization is disabled, rpcrdma_convert_iovs still
does not add explicit XDR round-up padding to a Read chunk.

Commit 677eb17e94ed ("xprtrdma: Fix XDR tail buffer marshalling")
incorrectly short-circuited the test for whether round-up padding
is needed that appears later in rpcrdma_convert_iovs.

However, if this is indeed a regular Read chunk (and not a
Position-Zero Read chunk), the tail iovec _always_ contains the
chunk's padding, and never anything else.

So, it's easy to just skip the tail when padding optimization is
enabled, and add the tail in a subsequent Read chunk segment, if
disabled.

Fixes: 677eb17e94ed ("xprtrdma: Fix XDR tail buffer marshalling")
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/rpc_rdma.c