diff options
Diffstat (limited to 'xlators/mount')
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 22 | ||||
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.h | 8 | ||||
| -rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 13 | 
3 files changed, 42 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 315259ece7b..d9055468e43 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5323,6 +5323,18 @@ init (xlator_t *this_xl)          GF_OPTION_INIT ("congestion-threshold", priv->congestion_threshold,                          int32, cleanup_exit); +        GF_OPTION_INIT("no-root-squash", priv->no_root_squash, bool, +                       cleanup_exit); +        /* change the client_pid to no-root-squash pid only if the +           client is none of defrag process, hadoop access and gsyncd process. +        */ +        if (!priv->client_pid_set) { +                if (priv->no_root_squash == _gf_true) { +                        priv->client_pid_set = _gf_true; +                        priv->client_pid = GF_CLIENT_PID_NO_ROOT_SQUASH; +                } +        } +          /* user has set only background-qlen, not congestion-threshold,             use the fuse kernel driver formula to set congestion. ie, 75% */          if (dict_get (this_xl->options, "background-qlen") && @@ -5563,5 +5575,15 @@ struct volume_options options[] = {            .type = GF_OPTION_TYPE_BOOL,            .default_value = "yes"          }, +        { .key = {"no-root-squash"}, +          .type = GF_OPTION_TYPE_BOOL, +          .default_value = "false", +          .description = "This is the mount option for disabling the " +          "root squash for the client irrespective of whether the root-squash " +          "option for the volume is set or not. But this option is honoured " +          "only for the trusted clients. For non trusted clients this value " +          "does not have any affect and the volume option for root-squash is " +          "honoured.", +        },          { .key = {NULL} },  }; diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 34794b6ea45..f1c4cb3f0d8 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -104,6 +104,14 @@ struct fuse_private {  	int32_t	             fopen_keep_cache;  	int32_t		     gid_cache_timeout;          gf_boolean_t         enable_ino32; +        /* This is the mount option for disabling the root-squash for the +           mount irrespective of whether the root-squash option for the +           volume is set or not. But this option is honoured only for +           thr trusted clients. For non trusted clients this value does +           not have any affect and the volume option for root-squash is +           honoured. +        */ +        gf_boolean_t        no_root_squash;          fdtable_t           *fdtable;  	gid_cache_t	     gid_cache;          char                *fuse_mountopts; diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index ff6b524605a..d22f6a69b1e 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -171,7 +171,11 @@ start_glusterfs ()          cmd_line=$(echo "$cmd_line --aux-gfid-mount");      fi -    # options with values start here +    if [ -n "$no_root_squash" ]; then +        cmd_line=$(echo "$cmd_line --no-root-squash"); +    fi + +#options with values start here      if [ -n "$log_level" ]; then          cmd_line=$(echo "$cmd_line --log-level=$log_level");      fi @@ -442,6 +446,13 @@ with_options()          "use-readdirp")              use_readdirp=$value              ;; +        "root-squash") +            if [ $value == "no" ] || +                [ $value == "off" ] || +                [ $value == "disable" ] || +                [ $value == "false" ] ; then +                no_root_squash=1; +            fi ;;          *)              echo "Invalid option: $key"              exit 0  | 
