Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: guarantee removal of link groups in reboot

When rebooting it should be guaranteed all link groups are cleaned
up and freed.

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

authored by

Ursula Braun and committed by
David S. Miller
a33a803c 6dabd405

+15 -1
+15 -1
net/smc/smc_core.c
··· 14 14 #include <linux/random.h> 15 15 #include <linux/workqueue.h> 16 16 #include <linux/wait.h> 17 + #include <linux/reboot.h> 17 18 #include <net/tcp.h> 18 19 #include <net/sock.h> 19 20 #include <rdma/ib_verbs.h> ··· 1283 1282 spin_unlock(&smcd_dev_list.lock); 1284 1283 } 1285 1284 1285 + static int smc_core_reboot_event(struct notifier_block *this, 1286 + unsigned long event, void *ptr) 1287 + { 1288 + smc_lgrs_shutdown(); 1289 + 1290 + return 0; 1291 + } 1292 + 1293 + static struct notifier_block smc_reboot_notifier = { 1294 + .notifier_call = smc_core_reboot_event, 1295 + }; 1296 + 1286 1297 int __init smc_core_init(void) 1287 1298 { 1288 1299 atomic_set(&lgr_cnt, 0); 1289 - return 0; 1300 + return register_reboot_notifier(&smc_reboot_notifier); 1290 1301 } 1291 1302 1292 1303 /* Called (from smc_exit) when module is removed */ 1293 1304 void smc_core_exit(void) 1294 1305 { 1306 + unregister_reboot_notifier(&smc_reboot_notifier); 1295 1307 smc_lgrs_shutdown(); 1296 1308 }