Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 636015 Details for
Bug 853895
CLI: read only glusterfs mount fails
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
fuse-bridge: Pass unknown option down to fuse
glusterfs-3.3.0-pass-unknown-option-down-to-fuse.patch (text/plain), 7.74 KB, created by
Niels de Vos
on 2012-10-31 10:49:39 UTC
(
hide
)
Description:
fuse-bridge: Pass unknown option down to fuse
Filename:
MIME Type:
Creator:
Niels de Vos
Created:
2012-10-31 10:49:39 UTC
Size:
7.74 KB
patch
obsolete
>From a5c205c100f7f29c60b193930cad21df572ce677 Mon Sep 17 00:00:00 2001 >From: Niels de Vos <ndevos@redhat.com> >Date: Wed, 31 Oct 2012 11:10:32 +0100 >Subject: [PATCH] fuse-bridge: Pass unknown option down to fuse > >Upstream commit ab039cc10f8493c6964ddc5b1510219708a31c60: > > In Linux, certain "filesystem-specific" options (passed in > string form in last argument to mount(2)), such as "rootcontext" > or "context" are in fact common to all filesystems, including > fuse. We should pass them down to the actual mount(2) call > untouched. > > This is achieved by adding "fuse-mountopts" option to mount/fuse > translator and adjusting the mount helper to propagate it with > unrecognized options as they are encountered. > > BUG: 852754 > Change-Id: I309203090c02025334561be235864d8d04e4159b > Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com> > Reviewed-on: http://review.gluster.org/3871 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Anand Avati <avati@redhat.com> > >Signed-off-by: Niels de Vos <ndevos@redhat.com> >--- > glusterfsd/src/glusterfsd.c | 17 +++++++++++++++++ > glusterfsd/src/glusterfsd.h | 1 + > libglusterfs/src/glusterfs.h | 3 ++- > xlators/mount/fuse/src/fuse-bridge.c | 13 +++++++++++-- > xlators/mount/fuse/src/fuse-bridge.h | 1 + > xlators/mount/fuse/utils/mount.glusterfs.in | 16 ++++++++++++++-- > 6 files changed, 46 insertions(+), 5 deletions(-) > >diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c >index ebd12bf..7f875da 100644 >--- a/glusterfsd/src/glusterfsd.c >+++ b/glusterfsd/src/glusterfsd.c >@@ -189,6 +189,8 @@ static struct argp_option gf_options[] = { > "Enable strict volume file checking"}, > {"mem-accounting", ARGP_MEM_ACCOUNTING_KEY, 0, OPTION_HIDDEN, > "Enable internal memory accounting"}, >+ {"fuse-mountopts", ARGP_FUSE_MOUNTOPTS_KEY, "OPTIONS", OPTION_HIDDEN, >+ "Extra mount options to pass to FUSE"}, > {0, 0, 0, 0, "Miscellaneous Options:"}, > {0, } > }; >@@ -406,6 +408,17 @@ create_fuse_mount (glusterfs_ctx_t *ctx) > } > } > >+ if (cmd_args->fuse_mountopts) { >+ ret = dict_set_static_ptr (master->options, ZR_FUSE_MOUNTOPTS, >+ cmd_args->fuse_mountopts); >+ if (ret < 0) { >+ gf_log ("glusterfsd", GF_LOG_ERROR, >+ "failed to set dict value for key %s", >+ ZR_FUSE_MOUNTOPTS); >+ goto err; >+ } >+ } >+ > ret = xlator_init (master); > if (ret) { > gf_log ("", GF_LOG_DEBUG, "failed to initialize fuse translator"); >@@ -810,6 +823,10 @@ parse_opts (int key, char *arg, struct argp_state *state) > ctx = glusterfs_ctx_get (); > ctx->mem_accounting = 1; > break; >+ >+ case ARGP_FUSE_MOUNTOPTS_KEY: >+ cmd_args->fuse_mountopts = gf_strdup (arg); >+ break; > } > > return 0; >diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h >index 8ec1219..32d9faa 100644 >--- a/glusterfsd/src/glusterfsd.h >+++ b/glusterfsd/src/glusterfsd.h >@@ -87,6 +87,7 @@ enum argp_option_keys { > ARGP_USER_MAP_ROOT_KEY = 156, > ARGP_MEM_ACCOUNTING_KEY = 157, > ARGP_SELINUX_KEY = 158, >+ ARGP_FUSE_MOUNTOPTS_KEY = 159, > }; > > struct _gfd_vol_top_priv_t { >diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h >index 52344c0..8f1cb17 100644 >--- a/libglusterfs/src/glusterfs.h >+++ b/libglusterfs/src/glusterfs.h >@@ -75,6 +75,7 @@ > #define ZR_DIRECT_IO_OPT "direct-io-mode" > #define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check" > #define ZR_DUMP_FUSE "dump-fuse" >+#define ZR_FUSE_MOUNTOPTS "fuse-mountopts" > > #define GF_XATTR_CLRLK_CMD "glusterfs.clrlk" > #define GF_XATTR_PATHINFO_KEY "trusted.glusterfs.pathinfo" >@@ -313,7 +314,7 @@ struct _cmd_args { > pid_t client_pid; > int client_pid_set; > unsigned uid_map_root; >- >+ char *fuse_mountopts; > > /* key args */ > char *mount_point; >diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c >index 7293c22..9790002 100644 >--- a/xlators/mount/fuse/src/fuse-bridge.c >+++ b/xlators/mount/fuse/src/fuse-bridge.c >@@ -4501,6 +4501,10 @@ init (xlator_t *this_xl) > if (ret != 0) > priv->uid_map_root = 0; > >+ ret = dict_get_str (options, "fuse-mountopts", &priv->fuse_mountopts); >+ if (ret != 0) >+ priv->fuse_mountopts = NULL; >+ > priv->direct_io_mode = 2; > ret = dict_get_str (options, ZR_DIRECT_IO_OPT, &value_string); > if (ret == 0) { >@@ -4593,9 +4597,11 @@ init (xlator_t *this_xl) > goto cleanup_exit; > } > >- gf_asprintf (&mnt_args, "%s%sallow_other,max_read=131072", >+ gf_asprintf (&mnt_args, "%s%s%s%sallow_other,max_read=131072", > priv->read_only ? "ro," : "", >- priv->acl ? "" : "default_permissions,"); >+ priv->acl ? "" : "default_permissions,", >+ priv->fuse_mountopts ? priv->fuse_mountopts : "", >+ priv->fuse_mountopts ? "," : ""); > if (!mnt_args) > goto cleanup_exit; > >@@ -4724,5 +4730,8 @@ struct volume_options options[] = { > { .key = {"read-only"}, > .type = GF_OPTION_TYPE_BOOL > }, >+ { .key = {"fuse-mountopts"}, >+ .type = GF_OPTION_TYPE_STR >+ }, > { .key = {NULL} }, > }; >diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h >index c919cf2..9193a8a 100644 >--- a/xlators/mount/fuse/src/fuse-bridge.h >+++ b/xlators/mount/fuse/src/fuse-bridge.h >@@ -110,6 +110,7 @@ struct fuse_private { > gf_boolean_t selinux; > gf_boolean_t read_only; > fdtable_t *fdtable; >+ char *fuse_mountopts; > > /* For fuse-reverse-validation */ > int revchan_in; >diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in >index 8dcf8ca..530bf9f 100755 >--- a/xlators/mount/fuse/utils/mount.glusterfs.in >+++ b/xlators/mount/fuse/utils/mount.glusterfs.in >@@ -97,6 +97,10 @@ start_glusterfs () > cmd_line=$(echo "$cmd_line --direct-io-mode=$direct_io_mode"); > fi > >+ if [ -n "$fuse_mountopts" ]; then >+ cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts"); >+ fi >+ > if [ -n "$volume_name" ]; then > cmd_line=$(echo "$cmd_line --volume-name=$volume_name"); > fi >@@ -125,6 +129,10 @@ start_glusterfs () > cmd_line=$(echo "$cmd_line --volfile=$volfile_loc"); > fi > >+ if [ -n "$fuse_mountopts" ]; then >+ cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts"); >+ fi >+ > cmd_line=$(echo "$cmd_line $mount_point"); > err=0; > $cmd_line; >@@ -274,7 +282,12 @@ main () > volfile_max_fetch_attempts=$value ;; > "backupvolfile-server") > backupvolfile_server=$value ;; >- *) echo "unknown option $key (ignored)" ;; >+ "fuse-mountopts") fuse_mountopts=$value ;; >+ *) >+ # Passthru >+ [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts," >+ fuse_mountopts="$fuse_mountopts$pair" >+ ;; > esac > esac > done >@@ -343,4 +356,3 @@ main () > } > > _init "$@" && main "$@"; >- >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 853895
:
636015