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

fs: dlm: revert check required context while close

This patch reverts commit 2c3fa6ae4d52 ("dlm: check required context
while close"). The function dlm_midcomms_close(), which will call later
dlm_lowcomms_close(), is called when the cluster manager tells the node
got fenced which means on midcomms/lowcomms layer to disconnect the node
from the cluster communication. The node can rejoin the cluster later.
This patch was ensuring no new message were able to be triggered when we
are in the close() function context. This was done by checking if the
lockspace has been stopped. However there is a missing check that we
only need to check specific lockspaces where the fenced node is member
of. This is currently complicated because there is no way to easily
check if a node is part of a specific lockspace without stopping the
recovery. For now we just revert this commit as it is just a check to
finding possible leaks of stopping lockspaces before close() is called.

Cc: stable@vger.kernel.org
Fixes: 2c3fa6ae4d52 ("dlm: check required context while close")
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
c6b6d6dc 57e2c2f2

-16
-12
fs/dlm/lockspace.c
··· 935 935 log_print("dlm user daemon left %d lockspaces", count); 936 936 } 937 937 938 - void dlm_stop_lockspaces_check(void) 939 - { 940 - struct dlm_ls *ls; 941 - 942 - spin_lock(&lslist_lock); 943 - list_for_each_entry(ls, &lslist, ls_list) { 944 - if (WARN_ON(!rwsem_is_locked(&ls->ls_in_recovery) || 945 - !dlm_locking_stopped(ls))) 946 - break; 947 - } 948 - spin_unlock(&lslist_lock); 949 - }
-1
fs/dlm/lockspace.h
··· 27 27 struct dlm_ls *dlm_find_lockspace_device(int minor); 28 28 void dlm_put_lockspace(struct dlm_ls *ls); 29 29 void dlm_stop_lockspaces(void); 30 - void dlm_stop_lockspaces_check(void); 31 30 int dlm_new_user_lockspace(const char *name, const char *cluster, 32 31 uint32_t flags, int lvblen, 33 32 const struct dlm_lockspace_ops *ops,
-3
fs/dlm/midcomms.c
··· 136 136 #include <net/tcp.h> 137 137 138 138 #include "dlm_internal.h" 139 - #include "lockspace.h" 140 139 #include "lowcomms.h" 141 140 #include "config.h" 142 141 #include "memory.h" ··· 1489 1490 1490 1491 if (nodeid == dlm_our_nodeid()) 1491 1492 return 0; 1492 - 1493 - dlm_stop_lockspaces_check(); 1494 1493 1495 1494 idx = srcu_read_lock(&nodes_srcu); 1496 1495 /* Abort pending close/remove operation */