Skip to content

Commit 97cdbc4

Browse files
Karsten Grauldavem330
authored andcommitted
net/smc: schedule free_work when link group is terminated
The free_work worker must be scheduled when the link group is abnormally terminated. Signed-off-by: Karsten Graul <kgraul@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 268ffcc commit 97cdbc4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

net/smc/smc_core.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232

3333
static u32 smc_lgr_num; /* unique link group number */
3434

35+
static void smc_lgr_schedule_free_work(struct smc_link_group *lgr)
36+
{
37+
/* client link group creation always follows the server link group
38+
* creation. For client use a somewhat higher removal delay time,
39+
* otherwise there is a risk of out-of-sync link groups.
40+
*/
41+
mod_delayed_work(system_wq, &lgr->free_work,
42+
lgr->role == SMC_CLNT ? SMC_LGR_FREE_DELAY_CLNT :
43+
SMC_LGR_FREE_DELAY_SERV);
44+
}
45+
3546
/* Register connection's alert token in our lookup structure.
3647
* To use rbtrees we have to implement our own insert core.
3748
* Requires @conns_lock
@@ -111,13 +122,7 @@ static void smc_lgr_unregister_conn(struct smc_connection *conn)
111122
write_unlock_bh(&lgr->conns_lock);
112123
if (!reduced || lgr->conns_num)
113124
return;
114-
/* client link group creation always follows the server link group
115-
* creation. For client use a somewhat higher removal delay time,
116-
* otherwise there is a risk of out-of-sync link groups.
117-
*/
118-
mod_delayed_work(system_wq, &lgr->free_work,
119-
lgr->role == SMC_CLNT ? SMC_LGR_FREE_DELAY_CLNT :
120-
SMC_LGR_FREE_DELAY_SERV);
125+
smc_lgr_schedule_free_work(lgr);
121126
}
122127

123128
static void smc_lgr_free_work(struct work_struct *work)
@@ -344,6 +349,7 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
344349
}
345350
write_unlock_bh(&lgr->conns_lock);
346351
wake_up(&lgr->lnk[SMC_SINGLE_LINK].wr_reg_wait);
352+
smc_lgr_schedule_free_work(lgr);
347353
}
348354

349355
/* Determine vlan of internal TCP socket.

0 commit comments

Comments
 (0)