]> git.baikalelectronics.ru Git - kernel.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)
commit242d7211f85de63d0de9e851dcfec366a8c25437
treef608fee0fff90ac8bd8a63f0cb8d53782d4cf0b5
parent8e3739d82372079fe67ed5a01f1adc345e76906b
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 374d08395f9c ("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: 374d08395f9c ("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