From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4673 invoked by alias); 29 Jun 2009 19:12:27 -0000 Received: (qmail 4667 invoked by alias); 29 Jun 2009 19:12:27 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE2 - /sbin/mount.gfs2: can't find /proc/mounts entry for directory / To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 3ec98b77e3fad4b81e2d14b01c5a25e97521ef50 X-Git-Newrev: e5a9b91bbeb5cacd2db9e9f36beec80f8e6e94ef From: Bob Peterson Message-Id: <20090629191202.9DF7E1201FE@lists.fedorahosted.org> Date: Mon, 29 Jun 2009 19:12:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00787.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e5a9b91bbeb5cacd2db9e9f36beec80f8e6e94ef Commit: e5a9b91bbeb5cacd2db9e9f36beec80f8e6e94ef Parent: 3ec98b77e3fad4b81e2d14b01c5a25e97521ef50 Author: Bob Peterson AuthorDate: Mon Jun 29 13:59:14 2009 -0500 Committer: Bob Peterson CommitterDate: Mon Jun 29 14:03:14 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 92a77d6..e5c6793 100644 --- a/gfs2/mount/util.c +++ b/gfs2/mount/util.c @@ -179,18 +179,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);