]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit4480879251fb89b1c5585112b1ccc8c3333b41af
treebe8d7fcea55952b91f5167600c103a421a8d6421
parent30d8177e8ac776d89d387fad547af6a0f599210e
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