]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/smc: set link inactive before calling smc_lgr_free()
authorKarsten Graul <kgraul@linux.ibm.com>
Tue, 15 May 2018 15:05:01 +0000 (17:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 15:49:20 +0000 (11:49 -0400)
Before smc_lgr_free() is called the link must be set inactive by calling
smc_llc_link_inactive().

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c
net/smc/smc_core.c

index ecf9ba68501b8e680c9723b289365aae4f37568d..d15762b057c0d8d4167feca9a4c41f0408604c37 100644 (file)
@@ -1644,6 +1644,7 @@ static void __exit smc_exit(void)
        spin_unlock_bh(&smc_lgr_list.lock);
        list_for_each_entry_safe(lgr, lg, &lgr_freeing_list, list) {
                list_del_init(&lgr->list);
+               smc_llc_link_inactive(&lgr->lnk[SMC_SINGLE_LINK]);
                cancel_delayed_work_sync(&lgr->free_work);
                smc_lgr_free(lgr); /* free link group */
        }
index 4523bbad8a1531b02c1262a065d656d68f1d0ea3..a48ee00b65ff7d3e81df6f74ea2c1387a06c0bfb 100644 (file)
@@ -148,8 +148,11 @@ static void smc_lgr_free_work(struct work_struct *work)
        list_del_init(&lgr->list); /* remove from smc_lgr_list */
 free:
        spin_unlock_bh(&smc_lgr_list.lock);
-       if (!delayed_work_pending(&lgr->free_work))
+       if (!delayed_work_pending(&lgr->free_work)) {
+               if (lgr->lnk[SMC_SINGLE_LINK].state != SMC_LNK_INACTIVE)
+                       smc_llc_link_inactive(&lgr->lnk[SMC_SINGLE_LINK]);
                smc_lgr_free(lgr);
+       }
 }
 
 /* create a new SMC link group */