• Chuck Lever's avatar
    xprtrdma: Fix Read chunk padding · ec3bc2c5
    Chuck Lever authored
    commit 24abdf1b upstream.
    
    When pad optimization is disabled, rpcrdma_convert_iovs still
    does not add explicit XDR round-up padding to a Read chunk.
    
    Commit 677eb17e ("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: 677eb17e ("xprtrdma: Fix XDR tail buffer marshalling")
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ec3bc2c5
rpc_rdma.c 34.2 KB