Skip to content

Commit 268ffcc

Browse files
Ursula Braundavem330
authored andcommitted
net/smc: free link group without pending free_work only
Make sure there is no pending or running free_work worker for the link group when freeing the link group. Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c9f4c6c commit 268ffcc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

net/smc/af_smc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,7 @@ static void __exit smc_exit(void)
14771477
spin_unlock_bh(&smc_lgr_list.lock);
14781478
list_for_each_entry_safe(lgr, lg, &lgr_freeing_list, list) {
14791479
list_del_init(&lgr->list);
1480+
cancel_delayed_work_sync(&lgr->free_work);
14801481
smc_lgr_free(lgr); /* free link group */
14811482
}
14821483
static_branch_disable(&tcp_have_smc);

net/smc/smc_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ static void smc_lgr_free_work(struct work_struct *work)
140140
list_del_init(&lgr->list); /* remove from smc_lgr_list */
141141
free:
142142
spin_unlock_bh(&smc_lgr_list.lock);
143-
smc_lgr_free(lgr);
143+
if (!delayed_work_pending(&lgr->free_work))
144+
smc_lgr_free(lgr);
144145
}
145146

146147
/* create a new SMC link group */

0 commit comments

Comments
 (0)