[Gluster-devel] can mount several times

Matthias Saou thias at spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net
Tue Jan 8 12:55:41 UTC 2008


Sascha Ottolski wrote :

> don't know if it's a bug or a feature: I have fstab entries for my gluster 
> mounts. If I do "mount -a" several times, I have several number of identical 
> looking mounts. Same things happens if glusterfs is called manually:
> 
> glusterfs on /mnt/gluster-test type fuse 
> (rw,nosuid,nodev,allow_other,default_permissions,max_read=1048576)
> glusterfs on /mnt/gluster-test type fuse 
> (rw,nosuid,nodev,allow_other,default_permissions,max_read=1048576)

This quick patch will "fix" the problem when using "mount -a" or any
kind of netfs service which calls the mount.glusterfs script. IIRC this
maining list filters out attachments, so here it is (EOLs are munged
up, fix accordingly) :

--- glusterfs-1.3.8.orig/glusterfs-fuse/utils/mount.glusterfs.in
2008-01-08 12:49:35.000000000 +0100
+++ glusterfs-1.3.8/glusterfs-fuse/utils/mount.glusterfs.in
2008-01-08 13:44:30.000000000 +0100
@@ -121,6 +121,12 @@ main ()
     # $2=$(echo "$@" | sed -n 's/[^ ]* \([^ ]*\).*/\1/p'); 
     mount_point="$2";
+
+    # Simple check to avoid multiple identical mounts
+    if grep -q "glusterfs $mount_point fuse" /etc/mtab; then
+        echo "$0: according to mtab, a glusterfs is already mounted on
$mount_point"
+        exit 1
+    fi
     
     fs_options=$(echo "$fs_options,$new_fs_options");

This is probably not portable at all (tested only on Fedora/RHEL), and
I'm sure there must be a much more elegant way to fix the problem ;-)

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora release 8 (Werewolf) - Linux kernel 2.6.23.9-85.fc8
Load : 0.33 0.47 0.55





More information about the Gluster-devel mailing list