This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL4 - dlm-kernel: fix2 prevent dlm module unload followingemergency shutdown


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e253ffddacd851318cacf777a0d95bee757ebd1e
Commit:        e253ffddacd851318cacf777a0d95bee757ebd1e
Parent:        89a5f2ec8c20c252296e214cf60d32ad74e32a75
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Feb 4 15:06:34 2009 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Feb 4 15:06:34 2009 -0600

dlm-kernel: fix2 prevent dlm module unload following emergency shutdown

bz 467040

It seems that dlm_emergency_shutdown() is called even when shutdowns are
normal/clean, but doesn't do anything.  So, only do the __module_get()
if dlm_emergency_shutdown finds lockspaces to clear.  Include the number
of lockspace's cleared in the printk at the end.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 dlm-kernel/src/lockspace.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/dlm-kernel/src/lockspace.c b/dlm-kernel/src/lockspace.c
index a7f78ef..b36fd02 100644
--- a/dlm-kernel/src/lockspace.c
+++ b/dlm-kernel/src/lockspace.c
@@ -601,16 +601,10 @@ void dlm_emergency_shutdown()
 {
 	struct dlm_ls *ls;
 	struct dlm_ls *tmp;
+	int count = 0;
 
 	printk("WARNING: dlm_emergency_shutdown\n");
 
-	/* prevent unloading since we cannot guarantee that slab
-	 * caches are empty here. This prevents a warning when our
-	 * module_exit tries to destroy the slab caches and
-	 * possible oopsen if something accesses /proc/slabinfo
-	 */
-	__module_get(THIS_MODULE);
-
 	/* Shut lowcomms down to prevent any socket activity */
 	lowcomms_stop_accept();
 
@@ -621,15 +615,24 @@ void dlm_emergency_shutdown()
 	/* Now try to clean the lockspaces */
 	spin_lock(&lslist_lock);
 
+	/* prevent unloading since we cannot guarantee that slab
+	 * caches are empty here. This prevents a warning when our
+	 * module_exit tries to destroy the slab caches and
+	 * possible oopsen if something accesses /proc/slabinfo
+	 */
+	if (!list_empty(&lslist))
+		__module_get(THIS_MODULE);
+
 	list_for_each_entry_safe(ls, tmp, &lslist, ls_list) {
 		spin_unlock(&lslist_lock);
 		release_lockspace(ls, 3);
 		spin_lock(&lslist_lock);
+		count++;
 	}
 
 	spin_unlock(&lslist_lock);
 
-	printk("WARNING: dlm_emergency_shutdown\n");
+	printk("WARNING: dlm_emergency_shutdown finished %d\n", count);
 }
 
 struct dlm_recover *allocate_dlm_recover(void)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]