diff options
author | vmallika <vmallika@redhat.com> | 2015-12-09 13:13:17 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2015-12-22 01:29:51 -0800 |
commit | 105dfa9f562b177a6faf4a0958e6d1b5840cee94 (patch) | |
tree | f8aaae6fbf82322e24e26b2576a15a5815b4be1a /xlators | |
parent | 683c880a02086effc5009a8420289b445ea423f0 (diff) |
quota: fix backward compatibility of new quota volinfo option
quota-version features is implemented for 3.7.6
please see below patch for more details:
http://review.gluster.org/#/c/12386
As part of this feature, new volume info option 'quota-version'
was introduced, this can cause check-sum problem
when a one of the node in a cluster is upgraded to 3.7.6
(heterogeneous cluster)
So do a OP_VERSION check when storing this option
in volume info
Change-Id: Ic5b03a1e3f1236b645a065b1fadee7950307e191
BUG: 1283178
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12642
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 14 |
2 files changed, 18 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index e58370af068..73018ad44dc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -92,6 +92,15 @@ glusterd_is_quota_supported (int32_t type, char **op_errstr) type == GF_QUOTA_OPTION_TYPE_REMOVE)) goto out; + /* Quota xattr version implemented in 3.7.6 + * quota-version is incremented when quota is enabled + * so don't allow enabling quota in heterogeneous + * cluster during upgrade + */ + if (conf->op_version < GD_OP_VERSION_3_7_6 && + type == GF_QUOTA_OPTION_TYPE_ENABLE) + goto out; + supported = _gf_true; out: diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index c436e3b8195..5f04f7cdffd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1019,11 +1019,15 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo) goto out; } - snprintf (buf, sizeof (buf), "%d", volinfo->quota_xattr_version); - ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION, - buf); - if (ret) - goto out; + if (conf->op_version >= GD_OP_VERSION_3_7_6) { + snprintf (buf, sizeof (buf), "%d", + volinfo->quota_xattr_version); + ret = gf_store_save_value (fd, + GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION, + buf); + if (ret) + goto out; + } ret = glusterd_volume_write_tier_details (fd, volinfo); |