From 7f5e1ce326e3bd55c8a16b4345a0bf284b6aef5a Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 16 Oct 2021 23:12:34 +0200 Subject: [PATCH] test/librbd: set FUA on writes in remove_full_try() Work around write-back or write-around cache getting enabled (e.g. if one runs the tests with rbd_cache_writethrough_until_flush disabled). Fixes: https://tracker.ceph.com/issues/52883 Signed-off-by: Ilya Dryomov --- src/test/librbd/test_librbd.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 1ea88f1ca68e0..825b915d0992d 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -2145,7 +2145,8 @@ static void remove_full_try(rados_ioctx_t ioctx, const std::string& image_name, ssize_t ret; for (off = 0; off < size; off += len) { ret = rbd_write_zeroes(image, off, len, - RBD_WRITE_ZEROES_FLAG_THICK_PROVISION, 0); + RBD_WRITE_ZEROES_FLAG_THICK_PROVISION, + LIBRADOS_OP_FLAG_FADVISE_FUA); if (ret < 0) { break; } -- 2.39.5