diff options
-rw-r--r-- | tests/bugs/quota/bug-1287996.t | 24 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 6 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 2 |
6 files changed, 36 insertions, 11 deletions
diff --git a/tests/bugs/quota/bug-1287996.t b/tests/bugs/quota/bug-1287996.t new file mode 100644 index 0000000000..d75b7a2689 --- /dev/null +++ b/tests/bugs/quota/bug-1287996.t @@ -0,0 +1,24 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../cluster.rc + +function check_peers { + $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l +} + +cleanup; + +TEST launch_cluster 2; + +TEST $CLI_1 volume create $V0 $H1:$B1/$V0 +TEST $CLI_1 volume start $V0 +TEST $CLI_1 volume quota $V0 enable + +TEST $CLI_1 peer probe $H2; +EXPECT_WITHIN $PROBE_TIMEOUT 1 check_peers + + +TEST $CLI_1 volume stop $V0 +TEST $CLI_1 volume delete $V0 +cleanup; diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index 12198cc6ca..e58370af06 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 5d9004c496..c436e3b819 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 848d0cce46..9cf0bf982b 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 b3dd47d09f..ebe696a1cf 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 817112e9ac..35195eb219 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_ { |