From 33ca7a7384491bf78f1c905a9085c17415eb1d91 Mon Sep 17 00:00:00 2001 From: vmallika Date: Tue, 22 Dec 2015 16:32:49 +0530 Subject: quota: handle quota xattr removal when quota is enabled again When a quota is disable and enabled again before completing the cleanup operation, this can remove the new xattrs and quota accounting can become wrong Remove removing the xattr, check if quota enabled again and the xattr is new Change-Id: Idda216f1e7346a9b843dbc112ea3e6faa9c47483 BUG: 1293601 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/13065 Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- tests/bugs/quota/bug-1293601.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/bugs/quota/bug-1293601.t (limited to 'tests/bugs/quota') diff --git a/tests/bugs/quota/bug-1293601.t b/tests/bugs/quota/bug-1293601.t new file mode 100644 index 00000000000..9b8a13a61e5 --- /dev/null +++ b/tests/bugs/quota/bug-1293601.t @@ -0,0 +1,35 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; +TESTS_EXPECTED_IN_LOOP=1044 + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4} +TEST $CLI volume start $V0 +TEST $CLI volume quota $V0 enable +TEST $CLI volume quota $V0 limit-usage / 2MB + +TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; + +for i in {1..1024}; do + TEST_IN_LOOP dd if=/dev/zero of=$M0/f$i bs=1k count=1 +done + +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/" + +for i in {1..10}; do + TEST_IN_LOOP $CLI volume quota $V0 disable + TEST_IN_LOOP $CLI volume quota $V0 enable +done + +TEST $CLI volume quota $V0 limit-usage / 2MB +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/" + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 +cleanup; -- cgit