Skip to content

Commit 643f5cf

Browse files
Alexander Aringteigland
authored andcommitted
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 <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent c84c473 commit 643f5cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/dlm/midcomms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,12 +1489,12 @@ int dlm_midcomms_close(int nodeid)
14891489

14901490
synchronize_srcu(&nodes_srcu);
14911491

1492-
idx = srcu_read_lock(&nodes_srcu);
14931492
mutex_lock(&close_lock);
1493+
idx = srcu_read_lock(&nodes_srcu);
14941494
node = nodeid2node(nodeid, 0);
14951495
if (!node) {
1496-
mutex_unlock(&close_lock);
14971496
srcu_read_unlock(&nodes_srcu, idx);
1497+
mutex_unlock(&close_lock);
14981498
return dlm_lowcomms_close(nodeid);
14991499
}
15001500

0 commit comments

Comments
 (0)