Skip to contentSkip to conversation

cluster/group/gfs_controld lock_dlm.h plock.c ...

Cluster-devel [email protected] 1 participant 1 message Aug 7, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-08-07 16:57:50

Modified files:
group/gfs_controld: lock_dlm.h plock.c recover.c

Log message:
free all plock state for an fs when it's unmounted

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/plock.c.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&r1=1.8&r2=1.9

group/gfs_controld/lock_dlm.h +1 -1
@@ -263,6 +263,6 @@
 void retrieve_plocks(struct mountgroup *mg);
 int dump_plocks(char *name, int fd);
 void process_saved_plocks(struct mountgroup *mg);
-void purge_plocks(struct mountgroup *mg, int nodeid);
+void purge_plocks(struct mountgroup *mg, int nodeid, int unmount);
 
 #endif
group/gfs_controld/plock.c +3 -3
@@ -942,7 +942,7 @@
 	}
 }
 
-void purge_plocks(struct mountgroup *mg, int nodeid)
+void purge_plocks(struct mountgroup *mg, int nodeid, int unmount)
 {
 	struct posix_lock *po, *po2;
 	struct lock_waiter *w, *w2;
@@ -951,7 +951,7 @@
 
 	list_for_each_entry_safe(r, r2, &mg->resources, list) {
 		list_for_each_entry_safe(po, po2, &r->locks, list) {
-			if (po->nodeid == nodeid) {
+			if (po->nodeid == nodeid || unmount) {
 				list_del(&po->list);
 				free(po);
 				purged++;
@@ -959,7 +959,7 @@
 		}
 
 		list_for_each_entry_safe(w, w2, &r->waiters, list) {
-			if (w->info.nodeid == nodeid) {
+			if (w->info.nodeid == nodeid || unmount) {
 				list_del(&w->list);
 				free(w);
 				purged++;
group/gfs_controld/recover.c +2 -4
@@ -966,7 +966,7 @@
 				  memb->spectator,
 				  memb->wait_gfs_recover_done);
 
-			purge_plocks(mg, memb->nodeid);
+			purge_plocks(mg, memb->nodeid, 0);
 		}
 	}	
 
@@ -2011,9 +2011,7 @@
 
 int do_terminate(struct mountgroup *mg)
 {
-	/* FIXME: all group members aren't guaranteed to be stopped for
-	   our leave yet when we get terminate.  We need that guarantee
-	   before we tell a withdrawing gfs to drop locks. */
+	purge_plocks(mg, 0, 1);
 
 	if (mg->withdraw) {
 		log_group(mg, "termination of our withdraw leave");