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>
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
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)) ]]
#!/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
# 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