Skip to contentSkip to conversation

btrfs/333: require scratch before checking encoded reads

PATCH Superseded Prabhakar Pujeri 3 participants 3 messages Aug 31 Btrfs file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs/333: require scratch before checking encoded reads

_require_btrfs_iouring_encoded_read() formats and mounts the scratch device while checking for encoded-read support. Without a configured scratch device, the test therefore fails before reaching its existing _require_scratch call.

Move _require_scratch before the encoded-read check so the test is skipped before its first scratch operation.

---
 tests/btrfs/333 | 1 +
 1 file changed, 1 insertion(+)
tests/btrfs/333 +1 -0
index 6214d7c..9dcdf1c 100755
@@ -13,6 +13,7 @@ _begin_fstest auto quick compress rw io_uring ioctl
 
 _require_command src/btrfs_encoded_read
 _require_command src/btrfs_encoded_write
+_require_scratch
 _require_btrfs_iouring_encoded_read
 # Encoded writes are reject for inodes with the NODATASUM flag, so we must skip
 # the test if running with either the nodatasum or nodatacow (which implies
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Prabhakar Pujeri

_require_btrfs_iouring_encoded_read() formats and mounts the scratch device while checking for encoded-read support. Without a configured scratch device, the test therefore fails before reaching its existing _require_scratch call.

Move _require_scratch before the encoded-read check so the test is skipped before its first scratch operation.

That looks right to me,

--D

Quoted 20 lines
---
 tests/btrfs/333 | 1 +
 1 file changed, 1 insertion(+)
tests/btrfs/333 +1 -0
index 6214d7c..9dcdf1c 100755
@@ -13,6 +13,7 @@ _begin_fstest auto quick compress rw io_uring ioctl
 
 _require_command src/btrfs_encoded_read
 _require_command src/btrfs_encoded_write
+_require_scratch
 _require_btrfs_iouring_encoded_read
 # Encoded writes are reject for inodes with the NODATASUM flag, so we must skip
 # the test if running with either the nodatasum or nodatacow (which implies
Signature · 1 line
2.55.0
#2 lore raw
In reply to Prabhakar Pujeri
Quoted 4 lines · Prabhakar Pujeri

_require_btrfs_iouring_encoded_read() formats and mounts the scratch device while checking for encoded-read support. Without a configured scratch device, the test therefore fails before reaching its existing _require_scratch call.

In that case it's better to just add _require_scratch to _require_btrfs_iouring_encoded_read(), instead of changing every possible caller.

BTW, without a scratch device, more than half of the tests will be skipped, thus it may not provide much coverage for such runs.

Thanks,
Qu

Quoted 21 lines

Move _require_scratch before the encoded-read check so the test is skipped before its first scratch operation.

---
  tests/btrfs/333 | 1 +
  1 file changed, 1 insertion(+)
tests/btrfs/333 +1 -0
index 6214d7c..9dcdf1c 100755
@@ -13,6 +13,7 @@ _begin_fstest auto quick compress rw io_uring ioctl
 
  _require_command src/btrfs_encoded_read
  _require_command src/btrfs_encoded_write
+_require_scratch
  _require_btrfs_iouring_encoded_read
  # Encoded writes are reject for inodes with the NODATASUM flag, so we must skip
  # the test if running with either the nodatasum or nodatacow (which implies