net/rds: Set fr_state only to FRMR_IS_FREE if IB_WR_LOCAL_INV had been successful
authorGerd Rausch <gerd.rausch@oracle.com>
Tue, 16 Jul 2019 22:29:12 +0000 (15:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Jul 2019 19:06:52 +0000 (12:06 -0700)
Fix a bug where fr_state first goes to FRMR_IS_STALE, because of a failure
of operation IB_WR_LOCAL_INV, but then gets set back to "FRMR_IS_FREE"
uncoditionally, even though the operation failed.

Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/ib_frmr.c

index 708c553c3da54c8a383ff605b378f926a892c0fd..adaa8e99e5a90e7c2808479bce459ff6f322512f 100644 (file)
@@ -309,7 +309,8 @@ void rds_ib_mr_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc)
        }
 
        if (frmr->fr_inv) {
-               frmr->fr_state = FRMR_IS_FREE;
+               if (frmr->fr_state == FRMR_IS_INUSE)
+                       frmr->fr_state = FRMR_IS_FREE;
                frmr->fr_inv = false;
                wake_up(&frmr->fr_inv_done);
        }