summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-12-09 13:13:17 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-12-22 01:30:25 -0800
commit72176d439780afdb8b67de86182dd7444f1fb7d5 (patch)
tree6ac3f60dedd3a7ee4473f0f4cb77c49595353ffa /xlators/mgmt/glusterd/src
parent21368d565d94f4dea2ff119c86bf93cd90514848 (diff)
quota: fix backward compatibility of new quota volinfo option
This is a backport of http://review.gluster.org/#/c/12642/ 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> Change-Id: I878202dcf5b44dcbbeff0d5b798649363a96e422 BUG: 1283187 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12643 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/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c14
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 6495aa46d30..fe1b9070017 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -97,6 +97,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 2c9ab006d3e..c16f25f0d6f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -1023,11 +1023,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);