Skip to contentSkip to conversation

cluster/group/gfs_controld lock_dlm.h recover.c

Cluster-devel [email protected] 1 participant 1 message Sep 4, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2007-09-04 19:27:34

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

Log message:
Reject mount attempts on an fs that's still in the process of unmounting. This regressed 8 months ago due to the bz 218560 changes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.7&r2=1.21.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/recover.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.23.2.9&r2=1.23.2.10

group/gfs_controld/lock_dlm.h +1 -0
@@ -164,6 +164,7 @@
 	int			low_nodeid;
 	int			master_nodeid;
 	int			save_plocks;
+	int			reject_mounts;
 
 	uint64_t		cp_handle;
 	time_t			last_checkpoint_time;
group/gfs_controld/recover.c +8 -1
@@ -1617,7 +1617,13 @@
 
 	mg = find_mg(name);
 	if (mg) {
-		rv = add_another_mountpoint(mg, dir, dev, ci);
+		if (mg->reject_mounts) {
+			/* fs is being unmounted */
+			rv = -ESTALE;
+			log_error("mount: reject mount due to unmount");
+		} else {
+			rv = add_another_mountpoint(mg, dir, dev, ci);
+		}
 		goto out;
 	}
 
@@ -2030,6 +2036,7 @@
 	}
 
  out:
+	mg->reject_mounts = 1;
 	group_leave(gh, mg->name);
 	return 0;
 }