From f3f757aaa39c73615749926f6503c2e83ca7f0d1 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 25 Mar 2019 20:58:00 +0100 Subject: [PATCH] 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 --- qa/workunits/rbd/krbd_data_pool.sh | 5 +++-- qa/workunits/rbd/krbd_fallocate.sh | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/qa/workunits/rbd/krbd_data_pool.sh b/qa/workunits/rbd/krbd_data_pool.sh index 23dc3806015fe..e8fc8348c6015 100755 --- a/qa/workunits/rbd/krbd_data_pool.sh +++ b/qa/workunits/rbd/krbd_data_pool.sh @@ -63,7 +63,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 @@ -189,7 +190,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 91c9a10f359b4..f6e80656063ea 100755 --- a/qa/workunits/rbd/krbd_fallocate.sh +++ b/qa/workunits/rbd/krbd_fallocate.sh @@ -1,12 +1,9 @@ #!/usr/bin/env 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 @@ -118,7 +115,7 @@ assert_zeroes 0 # unaligned blkdev_issue_discard allocate py_blkdiscard $((OBJECT_SIZE / 2)) -assert_zeroes_unaligned 1 +assert_zeroes_unaligned $NUM_OBJECTS # unaligned blkdev_issue_zeroout w/ BLKDEV_ZERO_NOUNMAP allocate -- 2.39.5