summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2012-11-09 14:43:38 +0100
committerVijay Bellur <vbellur@redhat.com>2012-11-19 00:49:36 -0800
commit702b2912970e7cc19416aff7d3696d15977efc2f (patch)
tree7acc75db04d042f4178506c2b1d0c14ee1faac0d /xlators
parent474d3e08313acb74633a22e970326fb98b9122d3 (diff)
fuse: handle mountflags properly
The internal mount API had no access to the generic mountflags used by mount(2). Thus the "ro" mount option that needs to be passed down to mount(2) as as a mountflag was incorrectly mangled into the fuse-specific mount parameter string (cf. http://review.gluster.com/655). This commit fixes the internal API and the "ro" issue. It also adds a check for the "rw" and "ro" mount options in tests/basic/mount.t. Thanks to Csaba Henk (csaba@) for suggestions and proposing an updated patch. Change-Id: I7f7bf49ae44d148f5c16f10736a0e412fb8f5e67 BUG: 853895 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/4163 Reviewed-by: Csaba Henk <csaba@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 9be7d91cc45..544dec0c3b5 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -4678,6 +4678,7 @@ init (xlator_t *this_xl)
int fsname_allocated = 0;
glusterfs_ctx_t *ctx = NULL;
gf_boolean_t sync_to_mount = _gf_false;
+ unsigned long mntflags = 0;
char *mnt_args = NULL;
eh_t *event = NULL;
@@ -4889,8 +4890,9 @@ init (xlator_t *this_xl)
goto cleanup_exit;
}
- gf_asprintf (&mnt_args, "%s%s%s%sallow_other,max_read=131072",
- priv->read_only ? "ro," : "",
+ if (priv->read_only)
+ mntflags |= MS_RDONLY;
+ gf_asprintf (&mnt_args, "%s%s%sallow_other,max_read=131072",
priv->acl ? "" : "default_permissions,",
priv->fuse_mountopts ? priv->fuse_mountopts : "",
priv->fuse_mountopts ? "," : "");
@@ -4903,7 +4905,7 @@ init (xlator_t *this_xl)
goto cleanup_exit;
}
- priv->fd = gf_fuse_mount (priv->mount_point, fsname, mnt_args,
+ priv->fd = gf_fuse_mount (priv->mount_point, fsname, mntflags, mnt_args,
sync_to_mount ? &ctx->mnt_pid : NULL,
priv->status_pipe[1]);
if (priv->fd == -1)