Skip to contentSkip to conversation

btrfs/172,206: call _log_writes_cleanup in _cleanup

PATCH New Su Yue 1 participant 1 message Mar 7, 2024 Btrfs file system

lore
Share & tools
lore

Su Yue

author
#0 lore raw

PATCH v3 1/1 btrfs/172,206: call _log_writes_cleanup in _cleanup

From: Su Yue <[email protected]>

Because block group tree requires require no-holes feature, _log_writes_mkfs "-O ^no-holes" fails when "-O block-group-tree" is given in MKFS_OPTION.
Without explicit _log_writes_cleanup, the two tests fail with logwrites-test device left. And all next tests will fail due to SCRATCH DEVICE EBUSY.

Fix it by overriding _cleanup to call _log_writes_cleanup.

---
changelog:
v3:
Adjust custom _cleanup().
v2:
Remove unneeded comments for _cleanup.
Add rvbs.

---
 tests/btrfs/172 | 7 +++++++
 tests/btrfs/206 | 7 +++++++
 2 files changed, 14 insertions(+)
tests/btrfs/172 +7 -0
index f5acc6982cd7..f2997c047eff 100755
@@ -13,6 +13,13 @@
 . ./common/preamble
 _begin_fstest auto quick log replay recoveryloop
 
+_cleanup()
+{
+	cd /
+	_log_writes_cleanup &> /dev/null
+	rm -f $tmp.*
+}
+
 # Import common functions.
 . ./common/filter
 . ./common/dmlogwrites
tests/btrfs/206 +7 -0
index f6571649076f..6ac3d27bbde3 100755
@@ -14,6 +14,13 @@
 . ./common/preamble
 _begin_fstest auto quick log replay recoveryloop punch prealloc
 
+_cleanup()
+{
+	cd /
+	_log_writes_cleanup &> /dev/null
+	rm -f $tmp.*
+}
+
 # Import common functions.
 . ./common/filter
 . ./common/dmlogwrites
Signature · 1 line
2.44.0