]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: hold conns_lock before calling smc_lgr_register_conn()
authorHuaping Zhou <zhp@smail.nju.edu.cn>
Wed, 26 Jun 2019 15:47:49 +0000 (17:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Jun 2019 17:10:16 +0000 (10:10 -0700)
commit4b5da2863e7761cbeda778a230a2ee40d4f1b675
treebe8d7fcea55952b91f5167600c103a421a8d6421
parentf9c7694a0ca5a1c0e8a985c55f440c3f64f28ad9
net/smc: hold conns_lock before calling smc_lgr_register_conn()

After smc_lgr_create(), the newly created link group is added
to smc_lgr_list, thus is accessible from other context.
Although link group creation is serialized by
smc_create_lgr_pending, the new link group may still be accessed
concurrently. For example, if ib_device is no longer active,
smc_ib_port_event_work() will call smc_port_terminate(), which
in turn will call __smc_lgr_terminate() on every link group of
this device. So conns_lock is required here.

Signed-off-by: Huaping Zhou <zhp@smail.nju.edu.cn>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_core.c