All of lore.kernel.org
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2/mount mount.gfs2.c umount.gfs2.c
Date: 25 Jul 2006 13:58:17 -0000	[thread overview]
Message-ID: <20060725135817.1325.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-07-25 13:58:17

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

Log message:
	From: fabbione at ubuntu.com
	
	This one was a nasty bug that was causing several issues.
	
	For example:
	
	mount -t gfs /dev/foo /mnt -> ok
	mount -t gfs /dev/foo /mnt/ -> nok failing with:
	can't find /proc/mounts entry for directory /mnt/
	
	(caused by read_proc_mounts in util.c when comparing with /proc/mounts
	that does not reference the trailing /).
	
	Other bugs are also fixed by making mo->dir consistent.
	
	mount -t gfs /dev/foo /mnt -> ok
	umount /mnt/ -> nok:
	/sbin/umount.gfs: lock_dlm_leave: gfs_controld leave error: -1
	
	because the mo->dir is also registered in lock_dlm daemon.
	
	This was causing a severe inconsistence that was blocking
	mounting/umounting
	or other volumes/devices.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/umount.gfs2.c.diff?cvsroot=cluster&r1=1.10&r2=1.11

--- cluster/gfs2/mount/mount.gfs2.c	2006/07/20 20:19:04	1.14
+++ cluster/gfs2/mount/mount.gfs2.c	2006/07/25 13:58:16	1.15
@@ -37,6 +37,7 @@
 {
 	int cont = 1;
 	int optchar;
+	int l;
 
 	/* FIXME: check for "quiet" option and don't print in that case */
 
@@ -80,8 +81,12 @@
 
 	++optind;
 
-	if (optind < argc && argv[optind])
+	if (optind < argc && argv[optind]) {
 		strncpy(mo->dir, argv[optind], PATH_MAX);
+		l = strlen(mo->dir);
+		if (mo->dir[l-1] == '/')
+			mo->dir[l-1] = 0;
+	}
 
 	log_debug("mount %s %s", mo->dev, mo->dir);
 }
--- cluster/gfs2/mount/umount.gfs2.c	2006/07/20 20:19:04	1.10
+++ cluster/gfs2/mount/umount.gfs2.c	2006/07/25 13:58:16	1.11
@@ -32,6 +32,7 @@
 {
 	int cont = 1;
 	int optchar;
+	int l;
 
 	/* FIXME: check for "quiet" option and don't print in that case */
 
@@ -65,8 +66,12 @@
 		}
 	}
 
-	if (optind < argc && argv[optind])
+	if (optind < argc && argv[optind]) {
 		strncpy(mo->dir, argv[optind], PATH_MAX);
+		l = strlen(mo->dir);
+		if (mo->dir[l-1] == '/')
+			mo->dir[l-1] = 0;
+	}
 
 	log_debug("umount %s", mo->dir);
 }



             reply	other threads:[~2006-07-25 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-25 13:58 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-28 13:58 [Cluster-devel] cluster/gfs2/mount mount.gfs2.c umount.gfs2.c rpeterso
2007-06-13 18:12 teigland
2007-06-13 18:13 teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060725135817.1325.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.