Skip to contentSkip to conversation

btrfs/333: require scratch before checking encoded reads

PATCH New Prabhakar Pujeri 1 participant 1 message Sep 2 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v3 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, callers therefore fail inside the helper before any scratch requirement is checked.

Add _require_scratch at the top of the helper so that all of its callers skip cleanly when no scratch device is present.

---
Changes in v3:
- Move the change log below the "---" marker, per Qu Wenruo's review.
- Add Qu Wenruo's Reviewed-by.

Changes in v2:
- Move _require_scratch into _require_btrfs_iouring_encoded_read() so the requirement is enforced for all callers of the helper, per Qu Wenruo's suggestion. Revert the v1 caller-side change in btrfs/333.
- Cc Qu Wenruo.

v2: https://lore.kernel.org/fstests/[email protected]/
v1: https://lore.kernel.org/fstests/[email protected]/

 common/btrfs | 1 +
 1 file changed, 1 insertion(+)
common/btrfs +1 -0
index a75fbf1c..ccac8626 100644
@@ -1055,6 +1055,7 @@ _require_btrfs_iouring_encoded_read()
 	local tmpfile
 	local ret
 
+	_require_scratch
 	_require_command src/btrfs_encoded_read
 
 	_scratch_mkfs &> /dev/null
Signature · 1 line
2.55.0