From: Ilya Dryomov Date: Fri, 19 Jul 2024 17:35:28 +0000 (+0200) Subject: qa/workunits/rbd: avoid caching effects in luks-encryption.sh X-Git-Tag: v17.2.8~251^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fbcfa77cafd24d1d93274d36247a0953210dbb8;p=ceph.git qa/workunits/rbd: avoid caching effects in luks-encryption.sh Commit 40f6f5224bce ("qa/workunits/rbd: fix issues in luks-encryption.sh") did the right thing for reads, which solved most of the issue. However, it actually made a step in the opposite direction for writes -- depending on the RBD cache settings, rbd-nbd virtual devices can behave as physical devices with a volatile write cache, so fsync is required. While at it, involving O_DIRECT for reads isn't needed outside of test_encryption_format(). Fixes: https://tracker.ceph.com/issues/67051 Signed-off-by: Ilya Dryomov (cherry picked from commit 9e1c0342e9931e898d795d47f923edd3b4324f4a) Conflicts: qa/workunits/rbd/luks-encryption.sh [ commit 1d3de19c4005 ("tools/rbd: add encryption format support for cloned image") not in quincy ] --- diff --git a/qa/workunits/rbd/luks-encryption.sh b/qa/workunits/rbd/luks-encryption.sh index 47a94a6e5781..91e8073da7ca 100755 --- a/qa/workunits/rbd/luks-encryption.sh +++ b/qa/workunits/rbd/luks-encryption.sh @@ -43,12 +43,12 @@ function test_encryption_format() { sudo chmod 666 $LIBRBD_DEV # write via librbd && compare - dd if=/tmp/testdata1 of=$LIBRBD_DEV oflag=direct bs=1M + dd if=/tmp/testdata1 of=$LIBRBD_DEV conv=fsync bs=1M dd if=/dev/mapper/cryptsetupdev of=/tmp/cmpdata iflag=direct bs=4M count=4 cmp -n 16MB /tmp/cmpdata /tmp/testdata1 # write via cryptsetup && compare - dd if=/tmp/testdata2 of=/dev/mapper/cryptsetupdev oflag=direct bs=1M + dd if=/tmp/testdata2 of=/dev/mapper/cryptsetupdev conv=fsync bs=1M dd if=$LIBRBD_DEV of=/tmp/cmpdata iflag=direct bs=4M count=4 cmp -n 16MB /tmp/cmpdata /tmp/testdata2 }