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, 29 Feb 2012 22:59:27 +0000 (17:59 -0500)
commitcc875104bb81313415167425ce21c562ddf540c9
tree870f43450c91160cfb9c6cf57782eb0a9647624a
parent039c582adfb8fbb537f1b3dcacd518a6681b0cef
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