fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generic/457: post-check fs on thin-vol device instead of scratch device
@ 2021-08-20 12:10 Kai-Wen Hu
  0 siblings, 0 replies; only message in thread
From: Kai-Wen Hu @ 2021-08-20 12:10 UTC (permalink / raw)
  To: fstests; +Cc: Kai-Wen Hu, Chung-Chiang Cheng, Robbie Ko

Recently, we found that this test running with btrfs didn't
pass the post-check fsck on scratch device.  This issue occured
due to the commit 5faafc77f ("dm space maps: don't reset space map
allocation cursor when committing") and the use of SSD as scratch
device.

In this test, it does not directly use the filesystem on scratch
device. It runs test on dm-thin volume tying two linear-mapping
devices, and those two linear devices are created from the scratch
device.  When the test runs, it will write data on dm-thin volume,
and dirty the underlying scratch device.

Since the commit (5faafc77f) changes the dm space allocation policy,
it may cause more dirty blocks on underlying scratch device when we
write data on thin volume.  So it makes more chance to overwrite the
position of btrfs-meta on the scratch device.  Besides, our scratch
device is SSD, so there is only one copy of btrfs meta on the scratch
device.  Once the btrfs-meta is overwritten, the btrfs volume will
crash, and cannot pass the fsck check.

Because, this test won't directly use the fs on scratch device.  We
just disable the post-check fsck on scratch device, instead, we run
post-check fsck on thin-vol device.

Reviewed-by: Chung-Chiang Cheng <cccheng@synology.com>
Reviewed-by: Robbie Ko <robbieko@synology.com>
Signed-off-by: Kai-Wen Hu <kevinhu@synology.com>
---
 tests/generic/457 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/generic/457 b/tests/generic/457
index f4fdd81d..7e0a3157 100755
--- a/tests/generic/457
+++ b/tests/generic/457
@@ -29,6 +29,8 @@ _require_scratch_reflink
 _require_cp_reflink
 _require_log_writes
 _require_dm_target thin-pool
+# $SCRATCH_DEV won't be directly created filesystem on, so fsck isn't required
+rm -f "${RESULT_DIR}/require_scratch"
 
 check_files()
 {
@@ -114,6 +116,7 @@ for j in `seq 0 $((NUM_FILES-1))`; do
 	md5=$(_md5_checksum $SCRATCH_MNT/testfile$j)
 	[ "${md5}" != "${test_md5[$j]}" ] && _fail "testfile$j end md5sum mismatched"
 done
+_dmthin_check_fs
 
 echo "Silence is golden"
 status=0
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-20 12:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 12:10 [PATCH] generic/457: post-check fs on thin-vol device instead of scratch device Kai-Wen Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).