net/smc: use rcu_barrier() on module unload
authorUrsula Braun <ubraun@linux.ibm.com>
Sat, 16 Nov 2019 16:47:31 +0000 (17:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Nov 2019 20:26:49 +0000 (12:26 -0800)
Add rcu_barrier() to make sure no RCU readers or callbacks are
pending when the module is unloaded.

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>
net/smc/af_smc.c

index 42b7fb8ab22bee0139ce25b6edf51c29f746e210..cde4dc0ed17341f6397c386c49ca061ab7e9f468 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/in.h>
 #include <linux/sched/signal.h>
 #include <linux/if_vlan.h>
+#include <linux/rcupdate_wait.h>
 
 #include <net/sock.h>
 #include <net/tcp.h>
@@ -2111,6 +2112,7 @@ static void __exit smc_exit(void)
        proto_unregister(&smc_proto);
        smc_pnet_exit();
        unregister_pernet_subsys(&smc_net_ops);
+       rcu_barrier();
 }
 
 module_init(smc_init);