Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: dlm: cleanup lock order

This patch cleanups the lock order to hold at first the close_lock and
then held the nodes_srcu read lock. Probably it will never be a problem
as nodes_srcu is only a read lock preventing the node pointer getting
freed.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>

authored by

Alexander Aring and committed by
David Teigland
643f5cfa c84c4733

+2 -2
+2 -2
fs/dlm/midcomms.c
··· 1489 1489 1490 1490 synchronize_srcu(&nodes_srcu); 1491 1491 1492 - idx = srcu_read_lock(&nodes_srcu); 1493 1492 mutex_lock(&close_lock); 1493 + idx = srcu_read_lock(&nodes_srcu); 1494 1494 node = nodeid2node(nodeid, 0); 1495 1495 if (!node) { 1496 - mutex_unlock(&close_lock); 1497 1496 srcu_read_unlock(&nodes_srcu, idx); 1497 + mutex_unlock(&close_lock); 1498 1498 return dlm_lowcomms_close(nodeid); 1499 1499 } 1500 1500