Improved .gitignore
PATCH 1/4 Improved .gitignore
Ignore dotfiles, tags, and verifier state.
--- .gitignore | 3 +++ 1 file changed, 3 insertions(+)
.gitignore +3 -0
@@ -4,6 +4,9 @@ .dep .libs .ltdep +.* +*.state +tags /local.config /results
Signature · 1 line
2.32.0.rc0
PATCH 2/4 Initial bcachefs support
To get started, you'll need to get bcachefs from the kernel repository
https://evilpiepirate.org/git/bcachefs.git/
and tools from
https://evilpiepirate.org/git/bcache-tools.git/
Build kernel as normal, enabling CONFIG_BCACHEFS_FS (and probably CONFIG_BCACHEFS_DEBUG), and build and install tools. Then running fstests is exactly the same as other local filesystems - just set FSTYP=bcachefs
Also see https://evilpiepirate.org/git/ktest.git/ for a tool for conveniently building kernel and running fstests inside a qemu VM.
This patch also updates generic/441 to run the more thorough test on bcachefs, and generic/425 to not run on bcachefs (since bcachefs does not store xattrs in blocks)
--- common/attr | 6 ++++++ common/config | 3 +++ common/quota | 4 ++-- common/rc | 11 +++++++++++ tests/generic/425 | 3 +++ tests/generic/441 | 2 +- 6 files changed, 26 insertions(+), 3 deletions(-)
common/attr +6 -0
@@ -33,6 +33,9 @@ _acl_get_max() echo 506 fi ;; + bcachefs) + echo 251 + ;; *) echo 0 ;;
@@ -273,6 +276,9 @@ pvfs2) 9p|ceph|nfs) MAX_ATTRVAL_SIZE=65536 ;; +bcachefs) + MAX_ATTRVAL_SIZE=1024 + ;; *) # Assume max ~1 block of attrs BLOCK_SIZE=`_get_block_size $TEST_DIR`
common/config +3 -0
@@ -416,6 +416,9 @@ _mkfs_opts() btrfs) export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS" ;; + bcachefs) + export MKFS_OPTIONS=$BCACHEFS_MKFS_OPTIONS + ;; *) ;; esac
common/quota +2 -2
@@ -17,7 +17,7 @@ _require_quota() _notrun "Installed kernel does not support quotas" fi ;; - gfs2|ocfs2) + gfs2|ocfs2|bcachefs) ;; xfs) if [ ! -f /proc/fs/xfs/xqmstat ]; then
@@ -278,7 +278,7 @@ _check_quota_usage() VFS_QUOTA=0 case $FSTYP in - ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2) + ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2|bcachefs) VFS_QUOTA=1 quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;;
common/rc +11 -0
@@ -1065,6 +1065,9 @@ _scratch_mkfs_sized() fi export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS" ;; + bcachefs) + $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" ;;
@@ -1133,6 +1136,9 @@ _scratch_mkfs_blocksized() ocfs2) yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize $SCRATCH_DEV ;; + bcachefs) + ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" ;;
@@ -1179,6 +1185,11 @@ _repair_scratch_fs() fi return $res ;; + bcachefs) + # With bcachefs, if fsck detects any errors we consider it a bug and we + # want the test to fail: + _check_scratch_fs + ;; *) local dev=$SCRATCH_DEV local fstyp=$FSTYP
tests/generic/425 +3 -0
@@ -30,6 +30,9 @@ _cleanup() # real QA test starts here _supported_fs generic + +[ $FSTYP = bcachefs ] && _notrun "bcachefs does not store xattrs in blocks" + _require_scratch _require_attrs _require_xfs_io_command "fiemap" "-a"
tests/generic/441 +1 -1
@@ -40,7 +40,7 @@ case $FSTYP in btrfs) _notrun "btrfs has a specialized test for this" ;; - ext3|ext4|xfs) + ext3|ext4|xfs|bcachefs) # Do the more thorough test if we have a logdev _has_logdev && sflag='' ;;
Signature · 1 line
2.32.0.rc0
PATCH 3/4 generic/{455,457,482}: make dmlogwrites tests work on bcachefs
In reply to Kent Overstreetbcachefs has log structured btree nodes, in addition to a regular journal, which means that unless we replay to markers in the log in the same order that they happened and are careful to avoid writing in between replaying to different events - we need to wipe and start fresh each time.
--- tests/generic/455 | 14 ++++++++++++++ tests/generic/457 | 14 ++++++++++++++ tests/generic/482 | 27 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-)
tests/generic/455 +14 -0
@@ -35,6 +35,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1
@@ -44,6 +55,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)
@@ -101,6 +113,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs
@@ -111,6 +124,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do
tests/generic/457 +14 -0
@@ -37,6 +37,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1
@@ -46,6 +57,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)
@@ -105,6 +117,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs
@@ -115,6 +128,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do
tests/generic/482 +20 -7
@@ -77,16 +77,29 @@ prev=$(_log_writes_mark_to_entry_number mkfs) cur=$(_log_writes_find_next_fua $prev) [ -z "$cur" ] && _fail "failed to locate next FUA write" +if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace +fi + while [ ! -z "$cur" ]; do _log_writes_replay_log_range $cur $DMTHIN_VOL_DEV >> $seqres.full - # Here we need extra mount to replay the log, mainly for journal based - # fs, as their fsck will report dirty log as error. - # We don't care to preserve any data on the replay dev, as we can replay - # back to the point we need, and in fact sometimes creating/deleting - # snapshots repeatedly can be slower than replaying the log. - _dmthin_mount - _dmthin_check_fs + if [ "$FSTYP" = "bcachefs" ]; then + # bcachefs will get confused if fsck does writes to replay the log, + # but then we replay writes from an earlier point in time on the + # same fs - but fsck in -n mode won't do any writes: + _check_scratch_fs -n $DMTHIN_VOL_DEV + else + # Here we need extra mount to replay the log, mainly for journal based + # fs, as their fsck will report dirty log as error. + # We don't care to preserve any data on the replay dev, as we can replay + # back to the point we need, and in fact sometimes creating/deleting + # snapshots repeatedly can be slower than replaying the log. + + _dmthin_mount + _dmthin_check_fs + fi prev=$cur cur=$(_log_writes_find_next_fua $(($cur + 1)))
Signature · 1 line
2.32.0.rc0
PATCH 4/4 generic/269: add _check_scratch_fs
In reply to Kent OverstreetThis probably should be in every test that uses the scratch device.
--- tests/generic/269 | 2 ++ 1 file changed, 2 insertions(+)
tests/generic/269 +2 -0
@@ -63,5 +63,7 @@ if ! _scratch_unmount; then status=1 exit fi + +_check_scratch_fs status=0 exit
Signature · 1 line
2.32.0.rc0
PATCH v2 1/4 Improved .gitignore
In reply to Kent OverstreetIgnore dotfiles, tags, and verifier state.
--- .gitignore | 3 +++ 1 file changed, 3 insertions(+)
.gitignore +3 -0
@@ -4,6 +4,9 @@ .dep .libs .ltdep +.* +*.state +tags /local.config /results
Signature · 1 line
2.32.0.rc0
PATCH v2 2/4 Initial bcachefs support
In reply to Kent OverstreetTo get started, you'll need to get bcachefs from the kernel repository
https://evilpiepirate.org/git/bcachefs.git/
and tools from
https://evilpiepirate.org/git/bcache-tools.git/
Build kernel as normal, enabling CONFIG_BCACHEFS_FS (and probably CONFIG_BCACHEFS_DEBUG), and build and install tools. Then running fstests is exactly the same as other local filesystems - just set FSTYP=bcachefs
Also see https://evilpiepirate.org/git/ktest.git/ for a tool for conveniently building kernel and running fstests inside a qemu VM.
This patch also updates generic/441 to run the more thorough test on bcachefs, and generic/425 to not run on bcachefs (since bcachefs does not store xattrs in blocks)
--- common/attr | 6 ++++++ common/config | 3 +++ common/quota | 4 ++-- common/rc | 11 +++++++++++ tests/generic/425 | 3 +++ tests/generic/441 | 2 +- 6 files changed, 26 insertions(+), 3 deletions(-)
common/attr +6 -0
@@ -33,6 +33,9 @@ _acl_get_max() echo 506 fi ;; + bcachefs) + echo 251 + ;; *) echo 0 ;;
@@ -273,6 +276,9 @@ pvfs2) 9p|ceph|nfs) MAX_ATTRVAL_SIZE=65536 ;; +bcachefs) + MAX_ATTRVAL_SIZE=1024 + ;; *) # Assume max ~1 block of attrs BLOCK_SIZE=`_get_block_size $TEST_DIR`
common/config +3 -0
@@ -416,6 +416,9 @@ _mkfs_opts() btrfs) export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS" ;; + bcachefs) + export MKFS_OPTIONS=$BCACHEFS_MKFS_OPTIONS + ;; *) ;; esac
common/quota +2 -2
@@ -17,7 +17,7 @@ _require_quota() _notrun "Installed kernel does not support quotas" fi ;; - gfs2|ocfs2) + gfs2|ocfs2|bcachefs) ;; xfs) if [ ! -f /proc/fs/xfs/xqmstat ]; then
@@ -278,7 +278,7 @@ _check_quota_usage() VFS_QUOTA=0 case $FSTYP in - ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2) + ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2|bcachefs) VFS_QUOTA=1 quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;;
common/rc +11 -0
@@ -1065,6 +1065,9 @@ _scratch_mkfs_sized() fi export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS" ;; + bcachefs) + $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS --fs_size=$fssize --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized" ;;
@@ -1133,6 +1136,9 @@ _scratch_mkfs_blocksized() ocfs2) yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize -C $blocksize $SCRATCH_DEV ;; + bcachefs) + ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS --block_size=$blocksize $SCRATCH_DEV + ;; *) _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" ;;
@@ -1179,6 +1185,11 @@ _repair_scratch_fs() fi return $res ;; + bcachefs) + # With bcachefs, if fsck detects any errors we consider it a bug and we + # want the test to fail: + _check_scratch_fs + ;; *) local dev=$SCRATCH_DEV local fstyp=$FSTYP
tests/generic/425 +3 -0
@@ -30,6 +30,9 @@ _cleanup() # real QA test starts here _supported_fs generic + +[ $FSTYP = bcachefs ] && _notrun "bcachefs does not store xattrs in blocks" + _require_scratch _require_attrs _require_xfs_io_command "fiemap" "-a"
tests/generic/441 +1 -1
@@ -40,7 +40,7 @@ case $FSTYP in btrfs) _notrun "btrfs has a specialized test for this" ;; - ext3|ext4|xfs) + ext3|ext4|xfs|bcachefs) # Do the more thorough test if we have a logdev _has_logdev && sflag='' ;;
Signature · 1 line
2.32.0.rc0
PATCH v2 3/4 generic/{455,457,482}: make dmlogwrites tests work on bcachefs
In reply to Kent Overstreetbcachefs has log structured btree nodes, in addition to a regular journal, which means that unless we replay to markers in the log in the same order that they happened and are careful to avoid writing in between replaying to different events - we need to wipe and start fresh each time.
--- tests/generic/455 | 14 ++++++++++++++ tests/generic/457 | 14 ++++++++++++++ tests/generic/482 | 27 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-)
tests/generic/455 +14 -0
@@ -35,6 +35,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1
@@ -44,6 +55,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)
@@ -101,6 +113,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs
@@ -111,6 +124,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do
tests/generic/457 +14 -0
@@ -37,6 +37,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1
@@ -46,6 +57,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)
@@ -105,6 +117,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs
@@ -115,6 +128,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; do
tests/generic/482 +20 -7
@@ -77,16 +77,29 @@ prev=$(_log_writes_mark_to_entry_number mkfs) cur=$(_log_writes_find_next_fua $prev) [ -z "$cur" ] && _fail "failed to locate next FUA write" +if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace +fi + while [ ! -z "$cur" ]; do _log_writes_replay_log_range $cur $DMTHIN_VOL_DEV >> $seqres.full - # Here we need extra mount to replay the log, mainly for journal based - # fs, as their fsck will report dirty log as error. - # We don't care to preserve any data on the replay dev, as we can replay - # back to the point we need, and in fact sometimes creating/deleting - # snapshots repeatedly can be slower than replaying the log. - _dmthin_mount - _dmthin_check_fs + if [ "$FSTYP" = "bcachefs" ]; then + # bcachefs will get confused if fsck does writes to replay the log, + # but then we replay writes from an earlier point in time on the + # same fs - but fsck in -n mode won't do any writes: + _check_scratch_fs -n $DMTHIN_VOL_DEV + else + # Here we need extra mount to replay the log, mainly for journal based + # fs, as their fsck will report dirty log as error. + # We don't care to preserve any data on the replay dev, as we can replay + # back to the point we need, and in fact sometimes creating/deleting + # snapshots repeatedly can be slower than replaying the log. + + _dmthin_mount + _dmthin_check_fs + fi prev=$cur cur=$(_log_writes_find_next_fua $(($cur + 1)))
Signature · 1 line
2.32.0.rc0
Re: [PATCH v2 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs
Quoted 21 lines · Kent Overstreet
bcachefs has log structured btree nodes, in addition to a regular journal, which means that unless we replay to markers in the log in the same order that they happened and are careful to avoid writing in between replaying to different events - we need to wipe and start fresh each time.
Signed-off-by Kent Overstreet <[email protected]>--- tests/generic/455 | 14 ++++++++++++++ tests/generic/457 | 14 ++++++++++++++ tests/generic/482 | 27 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-)tests/generic/455 +0
-0@@ -35,6 +35,17 @@ _require_dm_target thin-pool rm -f $seqres.full
tests/generic/455 _require_dm_target thin-pool · line 47
Quoted 10 lines
tests/generic/455 +10
-0+_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +}
I think we probably could make it a common helper, and currently only bcachefs needs reset, and more log structured filesystems may be supported in the future.
Thanks,
Eryu
Quoted 117 lines
tests/generic/455 +4
-0+ check_files() { local name=$1@@ -44,6 +55,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)@@ -101,6 +113,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs@@ -111,6 +124,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; dotests/generic/457 +14
-0@@ -37,6 +37,17 @@ _require_dm_target thin-pool rm -f $seqres.full +_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +} + check_files() { local name=$1@@ -46,6 +57,7 @@ check_files() local filename=$(basename $i) local mark="${filename##*.}" echo "checking $filename" >> $seqres.full + _reset_dmthin _log_writes_replay_log $filename $DMTHIN_VOL_DEV _dmthin_mount local expected_md5=$(_md5_checksum $i)@@ -105,6 +117,7 @@ _dmthin_check_fs # check pre umount echo "checking pre umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log last $DMTHIN_VOL_DEV _dmthin_mount _dmthin_check_fs@@ -115,6 +128,7 @@ done # Check the end echo "checking post umount" >> $seqres.full +_reset_dmthin _log_writes_replay_log end $DMTHIN_VOL_DEV _dmthin_mount for j in `seq 0 $((NUM_FILES-1))`; dotests/generic/482 +20
-7@@ -77,16 +77,29 @@ prev=$(_log_writes_mark_to_entry_number mkfs) cur=$(_log_writes_find_next_fua $prev) [ -z "$cur" ] && _fail "failed to locate next FUA write" +if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace +fi + while [ ! -z "$cur" ]; do _log_writes_replay_log_range $cur $DMTHIN_VOL_DEV >> $seqres.full - # Here we need extra mount to replay the log, mainly for journal based - # fs, as their fsck will report dirty log as error. - # We don't care to preserve any data on the replay dev, as we can replay - # back to the point we need, and in fact sometimes creating/deleting - # snapshots repeatedly can be slower than replaying the log. - _dmthin_mount - _dmthin_check_fs + if [ "$FSTYP" = "bcachefs" ]; then + # bcachefs will get confused if fsck does writes to replay the log, + # but then we replay writes from an earlier point in time on the + # same fs - but fsck in -n mode won't do any writes: + _check_scratch_fs -n $DMTHIN_VOL_DEV + else + # Here we need extra mount to replay the log, mainly for journal based + # fs, as their fsck will report dirty log as error. + # We don't care to preserve any data on the replay dev, as we can replay + # back to the point we need, and in fact sometimes creating/deleting + # snapshots repeatedly can be slower than replaying the log. + + _dmthin_mount + _dmthin_check_fs + fi prev=$cur cur=$(_log_writes_find_next_fua $(($cur + 1)))Signature · 1 line
2.32.0.rc0
Re: [PATCH v2 3/4] generic/{455,457,482}: make dmlogwrites tests work on bcachefs
Quoted 22 lines · Eryu Guan
Quoted 21 lines · Kent Overstreet
bcachefs has log structured btree nodes, in addition to a regular journal, which means that unless we replay to markers in the log in the same order that they happened and are careful to avoid writing in between replaying to different events - we need to wipe and start fresh each time.
Signed-off-by Kent Overstreet <[email protected]>--- tests/generic/455 | 14 ++++++++++++++ tests/generic/457 | 14 ++++++++++++++ tests/generic/482 | 27 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-)tests/generic/455 +0
-0@@ -35,6 +35,17 @@ _require_dm_target thin-pool rm -f $seqres.full
Quoted 14 lines
tests/generic/455 _require_dm_target thin-pool · line 47
Quoted 10 lines
tests/generic/455 +10
-0+_reset_dmthin() +{ + # With bcachefs, we need to wipe and start fresh every time we replay to a + # different point in time - if we see metadata from a future point in time, + # or an unrelated mount, bcachefs will get confused: + if [ "$FSTYP" = "bcachefs" ]; then + _dmthin_cleanup + _dmthin_init $devsize $devsize $csize $lowspace + fi +}I think we probably could make it a common helper, and currently only bcachefs needs reset, and more log structured filesystems may be supported in the future.
I think it might be better to wait until we have more dmlogwrites tests or another filesystem that needs this - I don't think this would be a good common helper as is, it's too coupled to what the tests are doing - factoring out helpers just because you spot identical code is an anti pattern when there isn't a good notion of what you're abstracting
Right now 455 and 457 are basically identical anyways, factoring out a single helper and ignoring the rest doesn't make much sense to me.
PATCH v2 4/4 generic/269: add _check_scratch_fs
In reply to Kent OverstreetThis probably should be in every test that uses the scratch device.
--- tests/generic/269 | 2 ++ 1 file changed, 2 insertions(+)
tests/generic/269 +2 -0
@@ -63,5 +63,7 @@ if ! _scratch_unmount; then status=1 exit fi + +_check_scratch_fs status=0 exit
Signature · 1 line
2.32.0.rc0
Re: [PATCH v2 4/4] generic/269: add _check_scratch_fs
Quoted 1 line · Kent Overstreet
This probably should be in every test that uses the scratch device.
Um, it is -- ./check runs fsck on the test and scratch devices if you _require_test or _require_scratch'd them (which this test does). What weird output did you see?
--D
Quoted 20 lines
Signed-off-by Kent Overstreet <[email protected]>--- tests/generic/269 | 2 ++ 1 file changed, 2 insertions(+)tests/generic/269 +2
-0@@ -63,5 +63,7 @@ if ! _scratch_unmount; then status=1 exit fi + +_check_scratch_fs status=0 exitSignature · 1 line
2.32.0.rc0
Re: [PATCH v2 4/4] generic/269: add _check_scratch_fs
Quoted 6 lines · Darrick J. Wong
Quoted 1 line · Kent Overstreet
This probably should be in every test that uses the scratch device.
Um, it is -- ./check runs fsck on the test and scratch devices if you
_require_testor _require_scratch'd them (which this test does). What weird output did you see?
I could've sworn I had generic/269 pass until I adedd that, but I just rechecked and it's doing what you describe - my bad, I'll drop this one.