• Chuck Lever's avatar
    xprtrdma: Remove FMRs from the unmap list after unmapping · 38f1932e
    Chuck Lever authored
    ib_unmap_fmr() takes a list of FMRs to unmap. However, it does not
    remove the FMRs from this list as it processes them. Other
    ib_unmap_fmr() call sites are careful to remove FMRs from the list
    after ib_unmap_fmr() returns.
    
    Since commit 7c7a5390 ("xprtrdma: Add ro_unmap_sync method for FMR")
    fmr_op_unmap_sync passes more than one FMR to ib_unmap_fmr(), but
    it didn't bother to remove the FMRs from that list once the call was
    complete.
    
    I've noticed some instability that could be related to list
    tangling by the new fmr_op_unmap_sync() logic. In an abundance
    of caution, add some defensive logic to clean up properly after
    ib_unmap_fmr().
    
    Fixes: 7c7a5390 ("xprtrdma: Add ro_unmap_sync method for FMR")
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Tested-by: default avatarSteve Wise <swise@opengridcomputing.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    38f1932e
fmr_ops.c 8.58 KB