Whamcloud - gitweb
LU-9549 lnet: prevent assert on ln_state 62/27262/2
authorAmir Shehata <amir.shehata@intel.com>
Wed, 24 May 2017 00:15:49 +0000 (17:15 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Jun 2017 03:56:49 +0000 (03:56 +0000)
commit43f0058037a376c0d5a4f0b88ac4b095dee84e19
tree6d1f489152a0848aa3d6db028668b3856f5e84c0
parent01d7ddd0edc1517b05136cb36314d7a39dbfeff3
LU-9549 lnet: prevent assert on ln_state

lnet_peer_primary_nid() is called from lnet_parse. It checks
ln_state outside the net lock, causing a race condition
during shutdown where the code expects the state to be
running, but it's stopping or shutdown.

Fixed the issue by renaming lnet_peer_primary_nid() to
lnet_peer_primary_nid_locked(). This function is now called
when lnet_net_lock is held in lnet_parse().

In lnet_create_reply_msg() we already have access to the
msg_txpeer, so we lookup the primary_nid directly

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: I0518cdbec95b38bd8690517320b601676ae259f0
Reviewed-on: https://review.whamcloud.com/27262
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Sonia Sharma <sonia.sharma@intel.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/include/lnet/lib-lnet.h
lnet/lnet/lib-move.c
lnet/lnet/peer.c