cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2006-08-11 16:59 teigland
  0 siblings, 0 replies; 14+ messages in thread
From: teigland @ 2006-08-11 16:59 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-08-11 16:59:04

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	report mount failure debug message earlier

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.16&r2=1.17

--- cluster/gfs2/mount/mount.gfs2.c	2006/07/28 13:58:10	1.16
+++ cluster/gfs2/mount/mount.gfs2.c	2006/08/11 16:59:03	1.17
@@ -174,6 +174,7 @@
 
 	rv = mount(mo.dev, mo.dir, fsname, mo.flags, mo.extra_plus);
 	if (rv) {
+		log_debug("mount(2) failed error %d errno %d", rv, errno);
 		if (!(mo.flags & MS_REMOUNT))
 			umount_lockproto(proto, &mo, &sb, errno);
 
@@ -181,11 +182,10 @@
 
 		die("error %d mounting %s on %s\n", errno, mo.dev, mo.dir);
 	}
+	log_debug("mount(2) ok");
 
 	block_signals(SIG_UNBLOCK);
 
-	log_debug("mount syscall returned %d", rv);
-
 	if (!(mo.flags & MS_REMOUNT))
 		add_mtab_entry(&mo);
 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-04-23 19:18 teigland
  0 siblings, 0 replies; 14+ messages in thread
From: teigland @ 2007-04-23 19:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2007-04-23 20:18:09

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Use realpath(3) to canonicalize path names for device and mount point.
	bz 237544

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.20&r2=1.21

--- cluster/gfs2/mount/mount.gfs2.c	2006/10/25 06:24:43	1.20
+++ cluster/gfs2/mount/mount.gfs2.c	2007/04/23 19:18:09	1.21
@@ -38,7 +38,7 @@
 {
 	int cont = 1;
 	int optchar;
-	int l;
+	char *real;
 
 	/* FIXME: check for "quiet" option and don't print in that case */
 
@@ -77,18 +77,22 @@
 		}
 	}
 
-	if (optind < argc && argv[optind])
-		strncpy(mo->dev, argv[optind], PATH_MAX);
+	if (optind < argc && argv[optind]) {
+		real = realpath(argv[optind], NULL);
+		if (!real)
+			die("invalid device path \"%s\"\n", argv[optind]);
+		strncpy(mo->dev, real, PATH_MAX);
+		free(real);
+	}
 
 	++optind;
 
 	if (optind < argc && argv[optind]) {
-		strncpy(mo->dir, argv[optind], PATH_MAX);
-		l = strlen(mo->dir) - 1;
-		while (l > 0 && mo->dir[l] == '/') {
-			mo->dir[l] = '\0';
-			l--;
-		};
+		real = realpath(argv[optind], NULL);
+		if (!real)
+			die("invalid mount point path \"%s\"\n", argv[optind]);
+		strncpy(mo->dir, real, PATH_MAX);
+		free(real);
 	}
 
 	log_debug("mount %s %s", mo->dev, mo->dir);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-04-23 19:18 teigland
  0 siblings, 0 replies; 14+ messages in thread
From: teigland @ 2007-04-23 19:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	teigland at sourceware.org	2007-04-23 20:18:18

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Use realpath(3) to canonicalize path names for device and mount point.
	bz 237544

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20&r2=1.20.2.1

--- cluster/gfs2/mount/mount.gfs2.c	2006/10/25 06:24:43	1.20
+++ cluster/gfs2/mount/mount.gfs2.c	2007/04/23 19:18:17	1.20.2.1
@@ -38,7 +38,7 @@
 {
 	int cont = 1;
 	int optchar;
-	int l;
+	char *real;
 
 	/* FIXME: check for "quiet" option and don't print in that case */
 
@@ -77,18 +77,22 @@
 		}
 	}
 
-	if (optind < argc && argv[optind])
-		strncpy(mo->dev, argv[optind], PATH_MAX);
+	if (optind < argc && argv[optind]) {
+		real = realpath(argv[optind], NULL);
+		if (!real)
+			die("invalid device path \"%s\"\n", argv[optind]);
+		strncpy(mo->dev, real, PATH_MAX);
+		free(real);
+	}
 
 	++optind;
 
 	if (optind < argc && argv[optind]) {
-		strncpy(mo->dir, argv[optind], PATH_MAX);
-		l = strlen(mo->dir) - 1;
-		while (l > 0 && mo->dir[l] == '/') {
-			mo->dir[l] = '\0';
-			l--;
-		};
+		real = realpath(argv[optind], NULL);
+		if (!real)
+			die("invalid mount point path \"%s\"\n", argv[optind]);
+		strncpy(mo->dir, real, PATH_MAX);
+		free(real);
 	}
 
 	log_debug("mount %s %s", mo->dev, mo->dir);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-05-14 19:01 rpeterso
  0 siblings, 0 replies; 14+ messages in thread
From: rpeterso @ 2007-05-14 19:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso at sourceware.org	2007-05-14 19:01:02

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Close the /sys/fs directory after using it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.22&r2=1.23

--- cluster/gfs2/mount/mount.gfs2.c	2007/04/26 18:45:37	1.22
+++ cluster/gfs2/mount/mount.gfs2.c	2007/05/14 19:01:01	1.23
@@ -162,9 +162,12 @@
 	while ((de = readdir(d))) {
 		if (strnlen(fsname, 5) != strnlen(de->d_name, 5))
 			continue;
-		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5)))
+		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5))) {
+			closedir(d);
 			return;
+		}
 	}
+	closedir(d);
 	die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
 	    fsname);
 }



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-05-14 19:08 rpeterso
  0 siblings, 0 replies; 14+ messages in thread
From: rpeterso @ 2007-05-14 19:08 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rpeterso at sourceware.org	2007-05-14 19:08:43

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Close the /sys/fs directory after using it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.2&r2=1.20.2.3

--- cluster/gfs2/mount/mount.gfs2.c	2007/04/26 18:45:44	1.20.2.2
+++ cluster/gfs2/mount/mount.gfs2.c	2007/05/14 19:08:43	1.20.2.3
@@ -162,9 +162,12 @@
 	while ((de = readdir(d))) {
 		if (strnlen(fsname, 5) != strnlen(de->d_name, 5))
 			continue;
-		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5)))
+		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5))) {
+			closedir(d);
 			return;
+		}
 	}
+	closedir(d);
 	die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
 	    fsname);
 }



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-07-19 22:20 adas
  0 siblings, 0 replies; 14+ messages in thread
From: adas @ 2007-07-19 22:20 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2007-07-19 22:20:50

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Fix for bz248177: We delete the old /etc/mtab entry and add a new one during remount. Any changes made to the mount options using remount are reflected in /etc/mtab now.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.24&r2=1.25

--- cluster/gfs2/mount/mount.gfs2.c	2007/06/13 18:12:36	1.24
+++ cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:20:50	1.25
@@ -232,7 +232,10 @@
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);
 
-	if (!(mo.flags & MS_REMOUNT))
+	if (mo.flags & MS_REMOUNT) {
+                del_mtab_entry(&mo);
+                add_mtab_entry(&mo);
+        } else
 		add_mtab_entry(&mo);
 
 	unblock_sigint();



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-07-19 22:21 adas
  0 siblings, 0 replies; 14+ messages in thread
From: adas @ 2007-07-19 22:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL51
Changes by:	adas at sourceware.org	2007-07-19 22:21:20

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Fix for bz248177: We delete the old /etc/mtab entry and add a new one during remount. Any changes made to the mount options using remount are reflected in /etc/mtab now.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL51&r1=1.20.2.4&r2=1.20.2.4.2.1

--- cluster/gfs2/mount/mount.gfs2.c	2007/06/13 18:13:33	1.20.2.4
+++ cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:21:20	1.20.2.4.2.1
@@ -232,7 +232,10 @@
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);
 
-	if (!(mo.flags & MS_REMOUNT))
+	if (mo.flags & MS_REMOUNT) {
+                del_mtab_entry(&mo);
+                add_mtab_entry(&mo);
+        } else
 		add_mtab_entry(&mo);
 
 	unblock_sigint();



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-07-19 22:21 adas
  0 siblings, 0 replies; 14+ messages in thread
From: adas @ 2007-07-19 22:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	adas at sourceware.org	2007-07-19 22:21:50

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Fix for bz248177: We delete the old /etc/mtab entry and add a new one during remount. Any changes made to the mount options using remount are reflected in /etc/mtab now.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.4&r2=1.20.2.5

--- cluster/gfs2/mount/mount.gfs2.c	2007/06/13 18:13:33	1.20.2.4
+++ cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:21:50	1.20.2.5
@@ -232,7 +232,10 @@
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);
 
-	if (!(mo.flags & MS_REMOUNT))
+	if (mo.flags & MS_REMOUNT) {
+                del_mtab_entry(&mo);
+                add_mtab_entry(&mo);
+        } else
 		add_mtab_entry(&mo);
 
 	unblock_sigint();



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-07-26 16:34 cfeist
  0 siblings, 0 replies; 14+ messages in thread
From: cfeist @ 2007-07-26 16:34 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL51
Changes by:	cfeist at sourceware.org	2007-07-26 16:34:33

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	- Comment out check_sys_fs do to bz#247853, this check should happen after
	we try to load the module.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL51&r1=1.20.2.4.2.1&r2=1.20.2.4.2.2

--- cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:21:20	1.20.2.4.2.1
+++ cluster/gfs2/mount/mount.gfs2.c	2007/07/26 16:34:32	1.20.2.4.2.2
@@ -199,7 +199,7 @@
 		exit(EXIT_SUCCESS);
 	}
 
-	check_sys_fs(fsname);
+	/* check_sys_fs(fsname); */
 
 	read_options(argc, argv, &mo);
 	check_options(&mo);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-07-26 16:36 cfeist
  0 siblings, 0 replies; 14+ messages in thread
From: cfeist @ 2007-07-26 16:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	cfeist at sourceware.org	2007-07-26 16:36:43

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	- Comment out check_sys_fs do to bz#247853, this check should happen after
	we try to load the module.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.5&r2=1.20.2.6

--- cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:21:50	1.20.2.5
+++ cluster/gfs2/mount/mount.gfs2.c	2007/07/26 16:36:43	1.20.2.6
@@ -199,7 +199,7 @@
 		exit(EXIT_SUCCESS);
 	}
 
-	check_sys_fs(fsname);
+	/* check_sys_fs(fsname); */
 
 	read_options(argc, argv, &mo);
 	check_options(&mo);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-08-06 19:23 teigland
  0 siblings, 0 replies; 14+ messages in thread
From: teigland @ 2007-08-06 19:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2007-08-06 19:23:40

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Remove check_sys_fs() since it breaks on-demand fs module loading from the
	kernel (already changed on RHEL5 branch).
	Use strerror() instead of errno in another spot to be more user friendly.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.25&r2=1.26

--- cluster/gfs2/mount/mount.gfs2.c	2007/07/19 22:20:50	1.25
+++ cluster/gfs2/mount/mount.gfs2.c	2007/08/06 19:23:40	1.26
@@ -155,6 +155,7 @@
 		lock_dlm_leave(mo, sb, mnterr);
 }
 
+#if 0
 static void check_sys_fs(char *fsname)
 {
 	DIR *d;
@@ -176,6 +177,7 @@
 	die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
 	    fsname);
 }
+#endif
 
 int main(int argc, char **argv)
 {
@@ -199,7 +201,11 @@
 		exit(EXIT_SUCCESS);
 	}
 
-	check_sys_fs(fsname);
+	/* This breaks on-demand fs module loading from the kernel; could we
+	   try to load the module first here and then check again and fail if
+	   nothing?  I'd really like to avoid joining the group and then
+	   backing out if the mount fails to load the module. */
+	/* check_sys_fs(fsname); */
 
 	read_options(argc, argv, &mo);
 	check_options(&mo);
@@ -227,7 +233,8 @@
 
 		if (errno == EBUSY)
 			die("%s already mounted or %s busy\n", mo.dev, mo.dir);
-		die("error %d mounting %s on %s\n", errno, mo.dev, mo.dir);
+		die("error mounting %s on %s: %s\n", mo.dev, mo.dir,
+		    strerror(errno));
 	}
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2007-08-06 19:26 teigland
  0 siblings, 0 replies; 14+ messages in thread
From: teigland @ 2007-08-06 19:26 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	teigland at sourceware.org	2007-08-06 19:26:52

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	Use strerror() instead of errno in another spot to be more user friendly.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.6&r2=1.20.2.7

--- cluster/gfs2/mount/mount.gfs2.c	2007/07/26 16:36:43	1.20.2.6
+++ cluster/gfs2/mount/mount.gfs2.c	2007/08/06 19:26:52	1.20.2.7
@@ -155,6 +155,7 @@
 		lock_dlm_leave(mo, sb, mnterr);
 }
 
+#if 0
 static void check_sys_fs(char *fsname)
 {
 	DIR *d;
@@ -176,6 +177,7 @@
 	die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
 	    fsname);
 }
+#endif
 
 int main(int argc, char **argv)
 {
@@ -199,6 +201,10 @@
 		exit(EXIT_SUCCESS);
 	}
 
+	/* This breaks on-demand fs module loading from the kernel; could we
+	   try to load the module first here and then check again and fail if
+	   nothing?  I'd really like to avoid joining the group and then
+	   backing out if the mount fails to load the module. */
 	/* check_sys_fs(fsname); */
 
 	read_options(argc, argv, &mo);
@@ -227,7 +233,8 @@
 
 		if (errno == EBUSY)
 			die("%s already mounted or %s busy\n", mo.dev, mo.dir);
-		die("error %d mounting %s on %s\n", errno, mo.dev, mo.dir);
+		die("error mounting %s on %s: %s\n", mo.dev, mo.dir,
+		    strerror(errno));
 	}
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2008-01-18 17:51 adas
  0 siblings, 0 replies; 14+ messages in thread
From: adas @ 2008-01-18 17:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2008-01-18 17:51:38

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	fix for bz333961 - adds support for -n and -f mount options

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.27&r2=1.28

--- cluster/gfs2/mount/mount.gfs2.c	2007/08/22 08:58:46	1.27
+++ cluster/gfs2/mount/mount.gfs2.c	2008/01/18 17:51:38	1.28
@@ -10,7 +10,7 @@
 
 char *prog_name;
 char *fsname;
-int verbose;
+int verbose, fake_mount = 0, no_mtab = 0;
 static sigset_t old_sigset;
 
 static void print_version(void)
@@ -48,7 +48,7 @@
 	/* FIXME: check for "quiet" option and don't print in that case */
 
 	while (cont) {
-		optchar = getopt(argc, argv, "hVo:t:v");
+		optchar = getopt(argc, argv, "hVo:t:vfn");
 
 		switch (optchar) {
 		case EOF:
@@ -77,6 +77,14 @@
 				strncpy(mo->type, optarg, 4);
 			break;
 
+		case 'f':
+			fake_mount = 1;
+			break;
+			
+		case 'n':
+			no_mtab = 1;
+			break;
+
 		default:
 			break;
 		}
@@ -184,7 +192,7 @@
 	struct mount_options mo;
 	struct gen_sb sb;
 	char *proto;
-	int rv;
+	int rv = 0;
 
 	memset(&mo, 0, sizeof(mo));
 	memset(&sb, 0, sizeof(sb));
@@ -219,6 +227,7 @@
 	   adding the mtab entry */
 	block_sigint();
 
+	if (!fake_mount) {
 	rv = mount_lockproto(proto, &mo, &sb);
 	if (rv < 0)
 		die("error mounting lockproto %s\n", proto);
@@ -238,12 +247,15 @@
 	}
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);
+	}
 
+	if (!no_mtab) {
 	if (mo.flags & MS_REMOUNT) {
                 del_mtab_entry(&mo);
                 add_mtab_entry(&mo);
         } else
 		add_mtab_entry(&mo);
+	}
 
 	unblock_sigint();
 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Cluster-devel] cluster/gfs2/mount mount.gfs2.c
@ 2008-01-18 17:51 adas
  0 siblings, 0 replies; 14+ messages in thread
From: adas @ 2008-01-18 17:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	adas at sourceware.org	2008-01-18 17:51:42

Modified files:
	gfs2/mount     : mount.gfs2.c 

Log message:
	fix for bz333961 - adds support for -n and -f mount options

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.7&r2=1.20.2.8

--- cluster/gfs2/mount/mount.gfs2.c	2007/08/06 19:26:52	1.20.2.7
+++ cluster/gfs2/mount/mount.gfs2.c	2008/01/18 17:51:41	1.20.2.8
@@ -10,7 +10,7 @@
 
 char *prog_name;
 char *fsname;
-int verbose;
+int verbose, fake_mount = 0, no_mtab = 0;
 static sigset_t old_sigset;
 
 static void print_version(void)
@@ -48,7 +48,7 @@
 	/* FIXME: check for "quiet" option and don't print in that case */
 
 	while (cont) {
-		optchar = getopt(argc, argv, "hVo:t:v");
+		optchar = getopt(argc, argv, "hVo:t:vfn");
 
 		switch (optchar) {
 		case EOF:
@@ -77,6 +77,14 @@
 				strncpy(mo->type, optarg, 4);
 			break;
 
+		case 'f':
+			fake_mount = 1;
+			break;
+			
+		case 'n':
+			no_mtab = 1;
+			break;
+
 		default:
 			break;
 		}
@@ -184,7 +192,7 @@
 	struct mount_options mo;
 	struct gen_sb sb;
 	char *proto;
-	int rv;
+	int rv = 0;
 
 	memset(&mo, 0, sizeof(mo));
 	memset(&sb, 0, sizeof(sb));
@@ -219,6 +227,7 @@
 	   adding the mtab entry */
 	block_sigint();
 
+	if (!fake_mount) {
 	rv = mount_lockproto(proto, &mo, &sb);
 	if (rv < 0)
 		die("error mounting lockproto %s\n", proto);
@@ -238,12 +247,15 @@
 	}
 	log_debug("mount(2) ok");
 	mount_result_lockproto(proto, &mo, &sb, 0);
+	}
 
+	if (!no_mtab) {
 	if (mo.flags & MS_REMOUNT) {
                 del_mtab_entry(&mo);
                 add_mtab_entry(&mo);
         } else
 		add_mtab_entry(&mo);
+	}
 
 	unblock_sigint();
 



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-01-18 17:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 16:36 [Cluster-devel] cluster/gfs2/mount mount.gfs2.c cfeist
  -- strict thread matches above, loose matches on Subject: below --
2008-01-18 17:51 adas
2008-01-18 17:51 adas
2007-08-06 19:26 teigland
2007-08-06 19:23 teigland
2007-07-26 16:34 cfeist
2007-07-19 22:21 adas
2007-07-19 22:21 adas
2007-07-19 22:20 adas
2007-05-14 19:08 rpeterso
2007-05-14 19:01 rpeterso
2007-04-23 19:18 teigland
2007-04-23 19:18 teigland
2006-08-11 16:59 teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).