From 4d5bb6da25278bda95f50ab70da17f2d4eb2ffdf Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 25 Mar 2019 20:59:29 +0100 Subject: [PATCH] qa: krbd_fallocate.sh: zero can be munged to truncate The test case is issuing discards that span two objects: the tail of the first object is truncated, the head of the second object is zeroed. These discards aren't serial, so there is a race: discard i ~ i + 1: truncate i, zero i + 1 discard i + 1 ~ i + 2: truncate i + 1, zero i + 2 can be executed as truncate i + 1, zero i + 2, truncate i, zero i + 1 For object i + 1, the sequence ends up being truncate tail, then zero head. This zero op is munged to truncate on the OSD, resulting in size 0 instead of OBJECT_SIZE / 2. Signed-off-by: Ilya Dryomov (cherry picked from commit 673673f53d0c258e6096a05d9de979b2c20adddf) --- qa/workunits/rbd/krbd_fallocate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/workunits/rbd/krbd_fallocate.sh b/qa/workunits/rbd/krbd_fallocate.sh index f81d4b9de80..f6e80656063 100755 --- a/qa/workunits/rbd/krbd_fallocate.sh +++ b/qa/workunits/rbd/krbd_fallocate.sh @@ -74,7 +74,7 @@ $(printf %x $IMAGE_SIZE) EOF [[ $(rados -p rbd ls | grep -c rbd_data.$IMAGE_ID) -eq $num_objects_expected ]] for ((i = 0; i < $num_objects_expected; i++)); do - rados -p rbd stat rbd_data.$IMAGE_ID.$(printf %016x $i) | grep "size $((OBJECT_SIZE / 2))" + rados -p rbd stat rbd_data.$IMAGE_ID.$(printf %016x $i) | egrep "(size $((OBJECT_SIZE / 2)))|(size 0)" done } -- 2.47.3