linux_old1/fs/dlm
David Teigland 36b71a8bfb dlm: fix deadlock between dlm_send and dlm_controld
A deadlock sometimes occurs between dlm_controld closing
a lowcomms connection through configfs and dlm_send looking
up the address for a new connection in configfs.

dlm_controld does a configfs rmdir which calls
dlm_lowcomms_close which waits for dlm_send to
cancel work on the workqueues.

The dlm_send workqueue thread has called
tcp_connect_to_sock which calls dlm_nodeid_to_addr
which does a configfs lookup and blocks on a lock
held by dlm_controld in the rmdir path.

The solution here is to save the node addresses within
the lowcomms code so that the lowcomms workqueue does
not need to step through configfs to get a node address.

dlm_controld:
wait_for_completion+0x1d/0x20
__cancel_work_timer+0x1b3/0x1e0
cancel_work_sync+0x10/0x20
dlm_lowcomms_close+0x4c/0xb0 [dlm]
drop_comm+0x22/0x60 [dlm]
client_drop_item+0x26/0x50 [configfs]
configfs_rmdir+0x180/0x230 [configfs]
vfs_rmdir+0xbd/0xf0
do_rmdir+0x103/0x120
sys_rmdir+0x16/0x20

dlm_send:
mutex_lock+0x2b/0x50
get_comm+0x34/0x140 [dlm]
dlm_nodeid_to_addr+0x18/0xd0 [dlm]
tcp_connect_to_sock+0xf4/0x2d0 [dlm]
process_send_sockets+0x1d2/0x260 [dlm]
worker_thread+0x170/0x2a0

Signed-off-by: David Teigland <teigland@redhat.com>
2012-08-08 11:33:35 -05:00
..
Kconfig dlm: Make DLM depend on CONFIGFS_FS 2011-01-16 21:22:37 +00:00
Makefile dlm: move plock code from gfs2 2008-04-21 11:22:28 -05:00
ast.c dlm: fixes for nodir mode 2012-05-02 14:15:27 -05:00
ast.h dlm: use workqueue for callbacks 2011-07-15 12:30:43 -05:00
config.c dlm: fix deadlock between dlm_send and dlm_controld 2012-08-08 11:33:35 -05:00
config.h dlm: fix deadlock between dlm_send and dlm_controld 2012-08-08 11:33:35 -05:00
debug_fs.c dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
dir.c dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
dir.h dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
dlm_internal.h dlm: fix race between remove and lookup 2012-07-16 14:18:01 -05:00
lock.c dlm: fix missing dir remove 2012-07-16 14:24:43 -05:00
lock.h dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
lockspace.c dlm: fix race between remove and lookup 2012-07-16 14:18:01 -05:00
lockspace.h dlm: detect available userspace daemon 2008-08-28 11:49:43 -05:00
lowcomms.c dlm: fix deadlock between dlm_send and dlm_controld 2012-08-08 11:33:35 -05:00
lowcomms.h dlm: fix deadlock between dlm_send and dlm_controld 2012-08-08 11:33:35 -05:00
lvb_table.h [DLM] The core of the DLM for GFS2/CLVM 2006-01-18 09:30:29 +00:00
main.c dlm: fix deadlock between dlm_send and dlm_controld 2012-08-08 11:33:35 -05:00
member.c dlm: add recovery callbacks 2012-01-04 08:56:31 -06:00
member.h dlm: add recovery callbacks 2012-01-04 08:56:31 -06:00
memory.c dlm: NULL dereference on failure in kmem_cache_create() 2012-05-15 10:39:28 -05:00
memory.h dlm: improve rsb searches 2011-07-12 16:02:09 -05:00
midcomms.c dlm: fix up memory allocation flags 2008-12-23 10:15:40 -06:00
midcomms.h [DLM] The core of the DLM for GFS2/CLVM 2006-01-18 09:30:29 +00:00
netlink.c dlm: use genl_register_family_with_ops() 2010-08-05 14:22:01 -05:00
plock.c locks: rename lock-manager ops 2011-07-20 20:23:19 -04:00
rcom.c dlm: use idr instead of list for recovered rsbs 2012-07-16 14:17:52 -05:00
rcom.h dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
recover.c dlm: fix conversion deadlock from recovery 2012-07-16 14:18:22 -05:00
recover.h dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
recoverd.c dlm: use rsbtbl as resource directory 2012-07-16 14:16:19 -05:00
recoverd.h [DLM] The core of the DLM for GFS2/CLVM 2006-01-18 09:30:29 +00:00
requestqueue.c dlm: fixes for nodir mode 2012-05-02 14:15:27 -05:00
requestqueue.h dlm: use proper C for dlm/requestqueue stuff (and fix alignment bug) 2008-02-04 01:21:32 -06:00
user.c dlm: add recovery callbacks 2012-01-04 08:56:31 -06:00
user.h dlm: record full callback state 2011-03-10 10:40:00 -06:00
util.c dlm: do not byteswap rcom_config 2008-02-04 01:23:43 -06:00
util.h [DLM] The core of the DLM for GFS2/CLVM 2006-01-18 09:30:29 +00:00