From: Ilya Dryomov Date: Mon, 25 Mar 2019 19:58:00 +0000 (+0100) Subject: qa/workunits/rbd: fixups for the new krbd discard behavior X-Git-Tag: v12.2.13~179^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5fd6e1945aeed64170c5c8d3c86794a2d08840ff;p=ceph.git qa/workunits/rbd: fixups for the new krbd discard behavior With discard_granularity set to alloc_size, we no longer get object size alignment from blk_bio_discard_split(). This assumption is pretty deeply ingrained in krbd_data_pool.sh, so make it explicit. For krbd_fallocate.sh, just fix the expectation. Signed-off-by: Ilya Dryomov (cherry picked from commit f3f757aaa39c73615749926f6503c2e83ca7f0d1) Conflicts: qa/workunits/rbd/krbd_fallocate.sh - luminous does not have a7d89c07946f89ad28987d65d9ba71c464c32431 so we keep the function name "assert_deallocated_unaligned" --- diff --git a/qa/workunits/rbd/krbd_data_pool.sh b/qa/workunits/rbd/krbd_data_pool.sh index 7d7288213398..4977e7d0e4ec 100755 --- a/qa/workunits/rbd/krbd_data_pool.sh +++ b/qa/workunits/rbd/krbd_data_pool.sh @@ -61,7 +61,8 @@ function mkfs_and_mount() { local dev dev=$(sudo rbd map $spec) - mkfs.ext4 -q -E discard $dev + blkdiscard $dev + mkfs.ext4 -q -E nodiscard $dev sudo mount $dev /mnt sudo umount /mnt sudo rbd unmap $dev @@ -187,7 +188,7 @@ for pool in rbd rbdnonzero; do done done -# mkfs should discard some objects everywhere but in clonesonly +# mkfs_and_mount should discard some objects everywhere but in clonesonly [[ $(list_HEADs rbd | wc -l) -lt $((NUM_META_RBDS + 5 * NUM_OBJECTS)) ]] [[ $(list_HEADs repdata | wc -l) -lt $((1 + 14 * NUM_OBJECTS)) ]] [[ $(list_HEADs ecdata | wc -l) -lt $((1 + 14 * NUM_OBJECTS)) ]] diff --git a/qa/workunits/rbd/krbd_fallocate.sh b/qa/workunits/rbd/krbd_fallocate.sh index 2081d33b6e71..712644ce07dc 100755 --- a/qa/workunits/rbd/krbd_fallocate.sh +++ b/qa/workunits/rbd/krbd_fallocate.sh @@ -1,12 +1,9 @@ #!/bin/bash -# This documents the state of things as of 4.12-rc4. -# # - fallocate -z deallocates because BLKDEV_ZERO_NOUNMAP hint is ignored by # krbd # -# - unaligned fallocate -z/-p appear to not deallocate -- see caveat #2 in -# linux.git commit 6ac56951dc10 ("rbd: implement REQ_OP_WRITE_ZEROES") +# - big unaligned blkdiscard and fallocate -z/-p leave the objects in place set -ex @@ -107,7 +104,7 @@ assert_deallocated # unaligned blkdev_issue_discard allocate py_blkdiscard $((OBJECT_SIZE / 2)) -assert_deallocated_unaligned 1 +assert_deallocated_unaligned $NUM_OBJECTS # unaligned blkdev_issue_zeroout w/ BLKDEV_ZERO_NOUNMAP allocate