diff options
author | vmallika <vmallika@redhat.com> | 2015-12-04 16:51:18 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2015-12-08 23:23:09 -0800 |
commit | eb1a6e9f88cfd4c80c6af7260e5e6537cb76b6c0 (patch) | |
tree | 0ef19b263272d99a6ad9028ce88a421331adb831 | |
parent | 156022b67f5da2ca27a607ee9e7608fdf5e91a20 (diff) |
quota: copy quota_version value in func glusterd_volinfo_dup
quota_version is a new variable introduced for
quota xattr versioning feature.
quota_version was not copied when creating duplicate
volinfo in function 'glusterd_volinfo_dup'
so any feature like snapshot/tiering using
glusterd_volinfo_dup will get the default value
of quota_version instead of the correct number
and can cause a problem
Change-Id: I7b0f418002d49aa7210e2e741e65ee5b2593e6a6
BUG: 1288474
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/12881
Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
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>
-rwxr-xr-x | tests/bugs/quota/bug-1288474.t | 48 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/bugs/quota/bug-1288474.t b/tests/bugs/quota/bug-1288474.t new file mode 100755 index 00000000000..2ead6ef4d74 --- /dev/null +++ b/tests/bugs/quota/bug-1288474.t @@ -0,0 +1,48 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../tier.rc + +NUM_BRICKS=2 + +function create_dist_tier_vol () { + mkdir $B0/cold + mkdir $B0/hot + TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} + TEST $CLI volume start $V0 + TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} +} + +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +#Create and start a tiered volume +create_dist_tier_vol $NUM_BRICKS + +TEST $CLI volume quota $V0 enable +TEST $CLI volume quota $V0 limit-usage / 10MB + +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 + +#check quota list after detach tier +TEST $CLI volume detach-tier $V0 start +sleep 1 +TEST $CLI volume detach-tier $V0 force +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 + +#check quota list after attach tier +rm -rf $B0/hot +mkdir $B0/hot +TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup; + diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 9cf0bf982bd..816babf3189 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -627,6 +627,7 @@ glusterd_volinfo_dup (glusterd_volinfo_t *volinfo, new_volinfo->brick_count = volinfo->brick_count; new_volinfo->tier_info = volinfo->tier_info; new_volinfo->quota_conf_version = volinfo->quota_conf_version; + new_volinfo->quota_version = volinfo->quota_version; new_volinfo->snap_max_hard_limit = volinfo->snap_max_hard_limit; dict_copy (volinfo->dict, new_volinfo->dict); |