]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: fixups for the new krbd discard behavior 27192/head
authorIlya Dryomov <idryomov@gmail.com>
Mon, 25 Mar 2019 19:58:00 +0000 (20:58 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 25 Mar 2019 21:06:14 +0000 (22:06 +0100)
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 <idryomov@gmail.com>
qa/workunits/rbd/krbd_data_pool.sh
qa/workunits/rbd/krbd_fallocate.sh

index 23dc3806015fe4aca4c9d8da6ef4a1f5ec624390..e8fc8348c60155ec82846457fb21385a50896157 100755 (executable)
@@ -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)) ]]
index 91c9a10f359b40c7a14d6806b568634fa5552510..f6e80656063eaaee606a54cc611455fed7a14e07 100755 (executable)
@@ -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