gfs2-utils: master - Revert "mount.gfs2 - gfs2 mounts doubled up in mtab"
Abhijith Das
adas at fedoraproject.org
Thu Jul 21 19:13:34 UTC 2011
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=3f3ba519e40ef5a956a9cd3cac2b928c67a91a1b
Commit: 3f3ba519e40ef5a956a9cd3cac2b928c67a91a1b
Parent: b212f8cde707fc2cd716f271fc62350803c195c8
Author: Abhi Das <adas at tux.(none)>
AuthorDate: Thu Jul 21 14:12:50 2011 -0500
Committer: Abhi Das <adas at tux.(none)>
CommitterDate: Thu Jul 21 14:12:50 2011 -0500
Revert "mount.gfs2 - gfs2 mounts doubled up in mtab"
This reverts commit b212f8cde707fc2cd716f271fc62350803c195c8.
---
gfs2/mount/mtab.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/gfs2/mount/mtab.c b/gfs2/mount/mtab.c
index a9804d8..148ff14 100644
--- a/gfs2/mount/mtab.c
+++ b/gfs2/mount/mtab.c
@@ -120,7 +120,6 @@ void del_mtab_entry(struct mount_options *mo)
mode_t old_umask;
struct stat sbuf;
int found = 0;
- char *abs_path, *abs_dev;
if (ignore_mtab())
return;
@@ -140,19 +139,14 @@ void del_mtab_entry(struct mount_options *mo)
while (fgets(line, PATH_MAX, mtab)) {
/* exclude the line matching the fs being unmounted
from the next version of mtab */
- sscanf(line, "%s %s %s", device, path, type);
- abs_path = realpath(path, NULL);
- abs_dev = realpath(device, NULL);
- if ((strncmp(type, "gfs", 3) == 0) &&
- (strcmp(abs_path, mo->dir) == 0) &&
- (strcmp(abs_dev, mo->dev) == 0)) {
+
+ if ((sscanf(line, "%s %s %s", device, path, type) == 3) &&
+ (strncmp(type, "gfs", 3) == 0) &&
+ (strcmp(path, mo->dir) == 0) &&
+ (strcmp(device, mo->dev) == 0)) {
found = 1;
- free(abs_path);
- free(abs_dev);
continue;
}
- free(abs_path);
- free(abs_dev);
/* all other lines from mtab are included in
the next version of mtab */
More information about the cluster-commits
mailing list