diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2015-09-28 17:20:19 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-01-23 11:07:29 -0500 |
commit | 71b3664c5d740f931759b99adfb41e6d2abf5ea3 (patch) | |
tree | f1e3ccc85a16f12987fe42d5d2f0a66a312e3228 /xlators/mgmt | |
parent | d256989adf2c98037914c5b0aef7274b5a70f276 (diff) |
features/trash: Create trash directory only when it is enabled
Previously trash directory was being created as part of volume
start operation. And also the user/admin could not delete this
directory from volume even if it is not needed. This patch will
fix the same. From now onwards creation and enforcement on trash
directory will come into pictrure only when trash translator is
enabled. Similarly exact same behaviour is reflected on internal-op
directory inside trash directory.
Upstream reference :
>Change-Id: I3e58316a7b299a691885e458c960438bec2220fb
>BUG: 1264849
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
>Reviewed-on: http://review.gluster.org/12256
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>Tested-by: Anoop C S <anoopcs@redhat.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Anoop C S <anoopcs@redhat.com>
>Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
>(cherry picked from commit 07b9853ad0c92b341be33a6cd632013c416221c8)
Change-Id: I3e58316a7b299a691885e458c960438bec2220fb
BUG: 1415581
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://review.gluster.org/16454
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 5650bb2e7be..d3e8875306f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1234,6 +1234,16 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) if (glusterd_check_globaloption (key)) global_opt = _gf_true; + ret = glusterd_validate_shared_storage (key, value, errstr); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_SHARED_STRG_VOL_OPT_VALIDATE_FAIL, + "Failed to validate shared " + "storage volume options"); + goto out; + } + + if (volinfo) { ret = glusterd_volinfo_get (volinfo, VKEY_FEATURES_TRASH, &val_dup); @@ -1245,15 +1255,6 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) } } - ret = glusterd_validate_shared_storage (key, value, errstr); - if (ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, - GD_MSG_SHARED_STRG_VOL_OPT_VALIDATE_FAIL, - "Failed to validate shared " - "storage volume options"); - goto out; - } - if (!strcmp(key, "features.trash-dir") && trash_enabled) { if (strchr (value, '/')) { snprintf (errstr, sizeof (errstr), |