public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: gfs2-utils: master - /sbin/mount.gfs2: can't find /proc/mounts entry for directory /
Date: Mon, 29 Jun 2009 19:10:00 -0000	[thread overview]
Message-ID: <20090629190944.6C7141201FE@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=1365855e4d376690fd1b9c9b93316333bbf6c333
Commit:        1365855e4d376690fd1b9c9b93316333bbf6c333
Parent:        ae3d671ef9de9887283d89b59bd6b7c4788fb7b9
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Mon Jun 29 13:59:14 2009 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Mon Jun 29 14:09:28 2009 -0500

/sbin/mount.gfs2: can't find /proc/mounts entry for directory /

bz 507893

The gfs2 mount helper was identifying devices by name rather than
by number.  That works fine most of the time, but not in all
cases, like when the root file system is gfs2.  This patch uses
device ids to identify the devices, as it should be.
---
 gfs2/mount/util.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c
index 57a432a..16f8985 100644
--- a/gfs2/mount/util.c
+++ b/gfs2/mount/util.c
@@ -220,18 +220,29 @@ void read_proc_mounts(struct mount_options *mo)
 	char save_opts[PATH_MAX];
 	char save_device[PATH_MAX];
 	int found = 0;
+	struct stat st_mo_dev, st_mounts_dev;
 
 	file = fopen("/proc/mounts", "r");
 	if (!file)
 		die("can't open /proc/mounts: %s\n", strerror(errno));
 
+	memset(&st_mo_dev, 0, sizeof(struct stat));
+	if (mo->dev[0]) {
+		if (stat(mo->dev, &st_mo_dev))
+			warn("Can't stat device %s.\n", mo->dev);
+	}
+
 	while (fgets(line, PATH_MAX, file)) {
 		if (sscanf(line, "%s %s %s %s", device, path, type, opts) != 4)
 			continue;
 		if (strcmp(path, mo->dir))
 			continue;
-		if (mo->dev[0] && strcmp(device, mo->dev))
-			continue;
+		if (mo->dev[0]) {
+			if (stat(device, &st_mounts_dev))
+				continue;
+			if (st_mo_dev.st_rdev != st_mounts_dev.st_rdev)
+				continue;
+		}
 		if (strcmp(type, fsname))
 			die("%s is not a %s filesystem\n", mo->dir, fsname);
 


                 reply	other threads:[~2009-06-29 19:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090629190944.6C7141201FE@lists.fedorahosted.org \
    --to=rpeterso@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 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 read-only IMAP folder(s) and NNTP newsgroup(s).