cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] Handle multiple filesystems on a single mountpoint
@ 2010-08-23 12:29 Pierre Carrier
  2010-08-23 12:29 ` Pierre Carrier
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre Carrier @ 2010-08-23 12:29 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hello,


Here is a patch against gfs1-utils.git

Use-case:
When both a GFS and a GFS2 filesystems are mounted on the same mountpoint,
# umount /example
/sbin/umount.gfs2: /example is not a gfs2 filesystem
/sbin/umount.gfs: /example is not a gfs filesystem
/sbin/umount.gfs2: /example is not a gfs2 filesystem


Best regards,

-- 
Pierre
---
 gfs/gfs_tool/util.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gfs/gfs_tool/util.c b/gfs/gfs_tool/util.c
index f467b7e..bc9cf50 100644
--- a/gfs/gfs_tool/util.c
+++ b/gfs/gfs_tool/util.c
@@ -123,7 +123,7 @@ mp2cookie(char *mp, int ioctl_ok)
 	char *list, **lines;
 	FILE *file;
 	char line[256], device[256], dev_id[256];
-	unsigned int x;
+	unsigned int x, non_gfs_found = 0;
 	struct stat st;
 
 	cookie = malloc(256);
@@ -145,8 +145,10 @@ mp2cookie(char *mp, int ioctl_ok)
 			continue;
 		if (strcmp(path, mp))
 			continue;
-		if (strcmp(type, "gfs"))
-			die("%s is not a GFS filesystem\n", mp);
+		if (strcmp(type, "gfs")) {
+			non_gfs_found++;
+			continue;
+		}
 
 		if (stat(device, &st))
 			continue;
@@ -154,6 +156,9 @@ mp2cookie(char *mp, int ioctl_ok)
 		break;
 	}
 
+	if(!dev_id[0] && non_gfs_found)
+		die("Only %u non-GFS filesystems are mounted on %s\n", non_gfs_found, mp);
+
 	fclose(file);
 
 	for (x = 0; *lines[x]; x++) {
-- 
1.7.2.1



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

end of thread, other threads:[~2010-08-23 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 12:29 [Cluster-devel] [PATCH] Handle multiple filesystems on a single mountpoint Pierre Carrier
2010-08-23 12:29 ` Pierre Carrier

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).