summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-12-03 14:55:36 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-12-08 23:21:15 -0800
commit156022b67f5da2ca27a607ee9e7608fdf5e91a20 (patch)
treec667230e0726f64884c3eae511c367e13b8c5a7c /xlators/mgmt/glusterd/src
parent28da53e26e88f23f8917810ce0177f2628aa7e9a (diff)
glusterd/quota: quota-version conflict in export/import volinfo
When exporting/importing voinfo during handshake, quota conf and quota xattr version were using same key 'quota-version' and updated wrong values when importing quota version values. Change-Id: If939d6f5bc4851d4114963877be72dda21834f0f BUG: 1287996 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12865 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h2
5 files changed, 12 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index 12198cc..e58370a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -1499,12 +1499,12 @@ glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
if (GF_QUOTA_OPTION_TYPE_ENABLE == type)
- volinfo->quota_version++;
+ volinfo->quota_xattr_version++;
ret = glusterd_store_volinfo (volinfo,
GLUSTERD_VOLINFO_VER_AC_INCREMENT);
if (ret) {
if (GF_QUOTA_OPTION_TYPE_ENABLE == type)
- volinfo->quota_version--;
+ volinfo->quota_xattr_version--;
goto out;
}
@@ -1515,7 +1515,7 @@ glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
"volfiles");
if (GF_QUOTA_OPTION_TYPE_ENABLE == type) {
/* rollback volinfo */
- volinfo->quota_version--;
+ volinfo->quota_xattr_version--;
ret = glusterd_store_volinfo (volinfo,
GLUSTERD_VOLINFO_VER_AC_INCREMENT);
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 5d9004c..c436e3b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -1019,7 +1019,7 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
goto out;
}
- snprintf (buf, sizeof (buf), "%d", volinfo->quota_version);
+ snprintf (buf, sizeof (buf), "%d", volinfo->quota_xattr_version);
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION,
buf);
if (ret)
@@ -2687,7 +2687,7 @@ glusterd_store_update_volinfo (glusterd_volinfo_t *volinfo)
volinfo->tier_info.cold_type = atoi (value);
} else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION,
strlen (GLUSTERD_STORE_KEY_VOL_QUOTA_VERSION))) {
- volinfo->quota_version = atoi (value);
+ volinfo->quota_xattr_version = atoi (value);
} else {
if (is_key_glusterd_hooks_friendly (key)) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 848d0cc..9cf0bf9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2574,8 +2574,8 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
ret = dict_set_int32 (dict, key, volinfo->caps);
memset (key, 0, sizeof (key));
- snprintf (key, sizeof (key), "%s%d.quota-version", prefix, count);
- ret = dict_set_int32 (dict, key, volinfo->quota_version);
+ snprintf (key, sizeof (key), "%s%d.quota-xattr-version", prefix, count);
+ ret = dict_set_int32 (dict, key, volinfo->quota_xattr_version);
out:
GF_FREE (volume_id_str);
GF_FREE (rebalance_id_str);
@@ -3667,9 +3667,10 @@ glusterd_import_volinfo (dict_t *peer_data, int count,
ret = dict_get_int32 (peer_data, key, &new_volinfo->caps);
memset (key, 0, sizeof (key));
- snprintf (key, sizeof (key), "%s%d.quota_version", prefix, count);
+ snprintf (key, sizeof (key), "%s%d.quota-xattr-version", prefix, count);
/*This is not present in older glusterfs versions, so ignore ret value*/
- ret = dict_get_int32 (peer_data, key, &new_volinfo->quota_version);
+ ret = dict_get_int32 (peer_data, key,
+ &new_volinfo->quota_xattr_version);
ret = glusterd_import_bricks (peer_data, count, new_volinfo, prefix);
if (ret)
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index b3dd47d..ebe696a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1898,7 +1898,7 @@ brick_graph_add_marker (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
goto out;
- snprintf (buf, sizeof (buf), "%d", volinfo->quota_version);
+ snprintf (buf, sizeof (buf), "%d", volinfo->quota_xattr_version);
ret = xlator_set_option (xl, "quota-version", buf);
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 817112e..35195eb 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -428,7 +428,7 @@ struct glusterd_volinfo_ {
gd_quorum_status_t quorum_status;
glusterd_snapdsvc_t snapd;
- int32_t quota_version;
+ int32_t quota_xattr_version;
};
typedef enum gd_snap_status_ {