summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
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:29:51 -0800
commit105dfa9f562b177a6faf4a0958e6d1b5840cee94 (patch)
treef8aaae6fbf82322e24e26b2576a15a5815b4be1a /xlators/mgmt/glusterd/src/glusterd-store.c
parent683c880a02086effc5009a8420289b445ea423f0 (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/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c14
1 files changed, 9 insertions, 5 deletions
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);