From 6dec62331051e9380f04ed392761f543504ac0ab Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Tue, 14 Mar 2023 13:36:49 +0100 Subject: [PATCH] bug-1728770-pass-xattrs.t: force re-read disk contents The test wants to corrupt a disk, but in some cases the data that is being corrupted is alread cached, so the damaged data is never seen by the kernel. This patch forces a drop of the caches to ensure that the corrupted data is read and the error is triggered. Updates: #4020 Signed-off-by: Xavi Hernandez --- tests/bugs/replicate/bug-1728770-pass-xattrs.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bugs/replicate/bug-1728770-pass-xattrs.t b/tests/bugs/replicate/bug-1728770-pass-xattrs.t index 78ec632fe97..bfbef93070a 100644 --- a/tests/bugs/replicate/bug-1728770-pass-xattrs.t +++ b/tests/bugs/replicate/bug-1728770-pass-xattrs.t @@ -32,9 +32,9 @@ TEST $CLI volume set $V0 health-check-interval 1000; TEST $CLI volume start $V0; TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0; -#corrupt last disk +# Corrupt last disk and drop the caches to force an error dd if=/dev/urandom of=/dev/mapper/${LVM_PREFIX}_vg_6-brick_lvm bs=512K count=200 status=progress && sync - +echo 3 >/proc/sys/vm/drop_caches # Test the disk is now returning EIO for touch and ls EXPECT_WITHIN $DISK_FAIL_TIMEOUT "^1$" fop_on_bad_disk "$L6"