[Cluster-devel] cluster/gfs2/mount mount.gfs2.c umount.gfs2.c ...

teigland at sourceware.org teigland at sourceware.org
Thu Jul 20 20:19:05 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-07-20 20:19:04

Modified files:
	gfs2/mount     : mount.gfs2.c umount.gfs2.c util.c util.h 

Log message:
	when a kernel mount fails and we leave the mountgroup, we need to
	pass an error value with the unmount/leave so gfs_controld will know
	to not wait for the kernel mount to complete before doing the leave

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/umount.gfs2.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/util.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/util.h.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- cluster/gfs2/mount/mount.gfs2.c	2006/04/13 19:00:35	1.13
+++ cluster/gfs2/mount/mount.gfs2.c	2006/07/20 20:19:04	1.14
@@ -123,10 +123,10 @@
 }
 
 static void umount_lockproto(char *proto, struct mount_options *mo,
-			     struct gen_sb *sb)
+			     struct gen_sb *sb, int mnterr)
 {
 	if (!strcmp(proto, "lock_dlm"))
-		lock_dlm_leave(mo, sb);
+		lock_dlm_leave(mo, sb, mnterr);
 }
 
 int main(int argc, char **argv)
@@ -167,7 +167,7 @@
 	rv = mount(mo.dev, mo.dir, fsname, mo.flags, mo.extra_plus);
 	if (rv) {
 		if (!(mo.flags & MS_REMOUNT))
-			umount_lockproto(proto, &mo, &sb);
+			umount_lockproto(proto, &mo, &sb, errno);
 
 		block_signals(SIG_UNBLOCK);
 
--- cluster/gfs2/mount/umount.gfs2.c	2006/06/22 20:58:28	1.9
+++ cluster/gfs2/mount/umount.gfs2.c	2006/07/20 20:19:04	1.10
@@ -83,7 +83,7 @@
 	int rv = 0;
 
 	if (!strcmp(proto, "lock_dlm"))
-		rv = lock_dlm_leave(mo, sb);
+		rv = lock_dlm_leave(mo, sb, 0);
 	return rv;
 }
 
--- cluster/gfs2/mount/util.c	2006/06/30 15:11:39	1.11
+++ cluster/gfs2/mount/util.c	2006/07/20 20:19:04	1.12
@@ -441,7 +441,7 @@
 	return rv;
 }
 
-int lock_dlm_leave(struct mount_options *mo, struct gen_sb *sb)
+int lock_dlm_leave(struct mount_options *mo, struct gen_sb *sb, int mnterr)
 {
 	int i, fd, rv;
 	char buf[MAXLINE];
@@ -462,11 +462,16 @@
 
 	/*
 	 * send request to gfs_controld for it to leave mountgroup:
-	 * "leave <mountpoint> gfs2"
+	 * "leave <mountpoint> <fstype> <mnterr>"
+	 *
+	 * mnterr is 0 if this leave is associated with an unmount.
+	 * mnterr is !0 if this leave is due to a failed kernel mount
+	 * in which case gfs_controld shouldn't wait for the kernel mount
+	 * to complete before doing the leave.
 	 */
 
 	memset(buf, 0, sizeof(buf));
-	rv = snprintf(buf, MAXLINE, "leave %s %s", mo->dir, fsname);
+	rv = snprintf(buf, MAXLINE, "leave %s %s %d", mo->dir, fsname, mnterr);
 	if (rv >= MAXLINE) {
 		warn("lock_dlm_leave: message too long: %d \"%s\"\n", rv, buf);
 		rv = -1;
--- cluster/gfs2/mount/util.h	2006/06/09 15:23:38	1.8
+++ cluster/gfs2/mount/util.h	2006/07/20 20:19:04	1.9
@@ -87,7 +87,7 @@
 void read_proc_mounts(struct mount_options *mo);
 int get_sb(char *device, struct gen_sb *sb_out);
 int lock_dlm_join(struct mount_options *mo, struct gen_sb *sb);
-int lock_dlm_leave(struct mount_options *mo, struct gen_sb *sb);
+int lock_dlm_leave(struct mount_options *mo, struct gen_sb *sb, int mnterr);
 int lock_dlm_remount(struct mount_options *mo, struct gen_sb *sb);
 
 /* mtab.c */




More information about the Cluster-devel mailing list