Whamcloud - gitweb
LU-78 o2iblnd: kiblnd_check_conns can deadlock
authorLiang Zhen <liang@whamcloud.com>
Tue, 21 Feb 2012 04:40:25 +0000 (12:40 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 28 Mar 2012 03:56:18 +0000 (23:56 -0400)
commitdcf1b2e6e2f22935f823cb7610b33b8f9c3ef155
treef2e2fa116babc10ce9e368c16feedf50f88d7271
parent2ba2f5371ca95732ac44c521e7e699beaed645ac
LU-78 o2iblnd: kiblnd_check_conns can deadlock

kiblnd_check_conns() called kiblnd_check_sends() with hold of global
rwlock, it's wrong because kiblnd_check_sends() could do many things:
 - call lnet_finalize() which is not safe with hold of spinlock
 - call kiblnd_close_conn() which requires to write_lock the same
   global lock
 - kiblnd_check_sends() might need to allocate NOOP message

It can be fixed by moving call of kiblnd_check_sends out from spinlock
This patch is from the fix of Bug 20288, with some small changes.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Icc9fedc70ecb25b0c41ebaf6d80c971f8281c9c6
Reviewed-on: http://review.whamcloud.com/2166
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.h
lnet/klnds/o2iblnd/o2iblnd_cb.c