• Tom Tucker's avatar
    RPCRDMA: Fix to XDR page base interpretation in marshalling logic. · bd7ea31b
    Tom Tucker authored
    The RPCRDMA marshalling logic assumed that xdr->page_base was an
    offset into the first page of xdr->page_list. It is in fact an
    offset into the xdr->page_list itself, that is, it selects the
    first page in the page_list and the offset into that page.
    
    The symptom depended in part on the rpc_memreg_strategy, if it was
    FRMR, or some other one-shot mapping mode, the connection would get
    torn down on a base and bounds error. When the badly marshalled RPC
    was retransmitted it would reconnect, get the error, and tear down the
    connection again in a loop forever. This resulted in a hung-mount. For
    the other modes, it would result in silent data corruption. This bug is
    most easily reproduced by writing more data than the filesystem
    has space for.
    
    This fix corrects the page_base assumption and otherwise simplifies
    the iov mapping logic.
    Signed-off-by: default avatarTom Tucker <tom@ogc.us>
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    bd7ea31b
rpc_rdma.c 27.6 KB