• Chuck Lever's avatar
    svcrdma: Don't overrun the SGE array in svc_rdma_send_ctxt · 25fd86ec
    Chuck Lever authored
    Receive buffers are always the same size, but each Send WR has a
    variable number of SGEs, based on the contents of the xdr_buf being
    sent.
    
    While assembling a Send WR, keep track of the number of SGEs so that
    we don't exceed the device's maximum, or walk off the end of the
    Send SGE array.
    
    For now the Send path just fails if it exceeds the maximum.
    
    The current logic in svc_rdma_accept bases the maximum number of
    Send SGEs on the largest NFS request that can be sent or received.
    In the transport layer, the limit is actually based on the
    capabilities of the underlying device, not on properties of the
    Upper Layer Protocol.
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    25fd86ec
svc_rdma_transport.c 22.3 KB