]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: fixups for the new krbd discard behavior 27905/head
authorIlya Dryomov <idryomov@gmail.com>
Mon, 25 Mar 2019 19:58:00 +0000 (20:58 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 1 May 2019 15:23:59 +0000 (17:23 +0200)
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>
(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"

qa/workunits/rbd/krbd_data_pool.sh
qa/workunits/rbd/krbd_fallocate.sh

index 7d72882133988b322086e6b926253e70cfda69d9..4977e7d0e4ec11e8369bac6a5b67e5d9234fe691 100755 (executable)
@@ -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)) ]]
index 2081d33b6e71856194d30340ab8d33f4a1816914..712644ce07dcb1a33cab79d7c19a4e07eb8a67ba 100755 (executable)
@@ -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