Skip to content

Commit

Permalink
net/smc: delete rkey first before switching to unused
Browse files Browse the repository at this point in the history
Once RMBs are flagged as unused they are candidates for reuse.
Thus the LLC DELETE RKEY operaton should be made before flagging
the RMB as unused.

Fixes: c7674c0 ("net/smc: unregister rkeys of unused buffer")
Signed-off-by: Ursula Braun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Ursula Braun authored and davem330 committed Feb 4, 2019
1 parent b8649ef commit a5e0431
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ static void smc_buf_unuse(struct smc_connection *conn,
conn->sndbuf_desc->used = 0;
if (conn->rmb_desc) {
if (!conn->rmb_desc->regerr) {
conn->rmb_desc->used = 0;
if (!lgr->is_smcd) {
/* unregister rmb with peer */
smc_llc_do_delete_rkey(
&lgr->lnk[SMC_SINGLE_LINK],
conn->rmb_desc);
}
conn->rmb_desc->used = 0;
} else {
/* buf registration failed, reuse not possible */
write_lock_bh(&lgr->rmbs_lock);
Expand Down

0 comments on commit a5e0431

Please sign in to comment.