* [PATCH 0/5] Refactor *_fs_sysfs_* helpers
@ 2026-09-14 17:25 Zorro Lang
2026-09-14 17:25 ` [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr Zorro Lang
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
As we talked in:
https://lore.kernel.org/fstests/amhKovVDjwawoWdQ@zlang-mailbox/
This patchset refactors two redundant and messy sets of *_fs_sysfs_* helpers
(PATCH 1/5 2/5), introduces helpers for /sys/fs/$FSTYP/features (PATCH 3/5 4/5),
and replaces the original btrfs-specific helpers with these common ones
(PATCH 5/5).
Thanks,
Zorro
Zorro Lang (5):
fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr
common/sysfs: adjust function naming
common/rc: add helpers for /sys/fs/$FSTYP/features/
common/rc: use common helper in _require_fanotify_ioerrors for f2fs
fstests: replace btrfs specific helpers with common sysfs helpers
common/btrfs | 41 ++----------------
common/rc | 103 ++++++++++++++++++++++++++++++++--------------
common/sysfs | 72 ++++++++++++++++----------------
common/xfs | 22 +++++-----
tests/btrfs/010 | 3 +-
tests/btrfs/055 | 2 +-
tests/btrfs/056 | 2 +-
tests/btrfs/112 | 2 +-
tests/btrfs/131 | 2 +-
tests/btrfs/165 | 2 +-
tests/btrfs/188 | 2 +-
tests/btrfs/192 | 2 +-
tests/btrfs/201 | 2 +-
tests/btrfs/205 | 2 +-
tests/btrfs/209 | 2 +-
tests/btrfs/211 | 2 +-
tests/btrfs/219 | 3 +-
tests/btrfs/231 | 2 +-
tests/btrfs/253 | 28 ++++++-------
tests/btrfs/285 | 3 +-
tests/btrfs/296 | 8 +---
tests/btrfs/304 | 4 +-
tests/btrfs/305 | 4 +-
tests/btrfs/306 | 4 +-
tests/btrfs/307 | 4 +-
tests/btrfs/308 | 4 +-
tests/btrfs/311 | 2 +-
tests/btrfs/313 | 2 +-
tests/btrfs/314 | 2 +-
tests/btrfs/315 | 2 +-
tests/btrfs/329 | 4 +-
tests/btrfs/334 | 4 +-
tests/btrfs/342 | 2 +-
tests/btrfs/352 | 2 +-
tests/f2fs/025 | 2 +-
tests/generic/098 | 2 +-
tests/generic/101 | 2 +-
tests/xfs/006 | 4 +-
tests/xfs/177 | 4 +-
tests/xfs/264 | 14 +++----
tests/xfs/668 | 6 +--
tests/xfs/669 | 6 +--
tests/xfs/670 | 2 +-
43 files changed, 194 insertions(+), 195 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
@ 2026-09-14 17:25 ` Zorro Lang
2026-09-15 6:56 ` Christoph Hellwig
2026-09-14 17:25 ` [PATCH 2/5] common/sysfs: adjust function naming Zorro Lang
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
There is heavy overlap between _require_fs_sysfs and
_require_fs_sysfs_attr, and their ambiguous names make it difficult
to tell them apart.
So merge them into a single function with "_dev_" included in the
name to distinguish per-device entries from other paths like
/sys/fs/$FSTYP/features/.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
common/btrfs | 4 +--
common/rc | 70 ++++++++++++++++++++-----------------------------
common/sysfs | 6 ++---
common/xfs | 22 ++++++++--------
tests/btrfs/253 | 26 +++++++++---------
tests/btrfs/285 | 2 +-
tests/btrfs/334 | 2 +-
tests/f2fs/025 | 2 +-
tests/xfs/006 | 4 +--
tests/xfs/177 | 4 +--
tests/xfs/264 | 14 +++++-----
tests/xfs/668 | 6 ++---
tests/xfs/669 | 6 ++---
tests/xfs/670 | 2 +-
14 files changed, 78 insertions(+), 92 deletions(-)
diff --git a/common/btrfs b/common/btrfs
index 0bfb02dd..fb1523ab 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -903,8 +903,8 @@ _qgroup_mode()
_fail "Usage: _qgroup_mode <mounted_device>"
fi
- if _has_fs_sysfs_attr $dev /qgroups/mode; then
- _get_fs_sysfs_attr $dev qgroups/mode
+ if _has_fs_sysfs_dev_attr $dev /qgroups/mode; then
+ _get_fs_sysfs_dev_attr $dev qgroups/mode
else
echo "qgroup"
fi
diff --git a/common/rc b/common/rc
index 8add0eed..b99e28a5 100644
--- a/common/rc
+++ b/common/rc
@@ -4209,7 +4209,7 @@ _require_fs_survives_data_write_eio()
# This is an XFS per-mount sysfs attribute, not a block queue
# attribute. Its existence means XFS mounted this instance with
# zoned filesystem semantics.
- if _has_fs_sysfs_attr "$dev" "zoned/max_open_zones"; then
+ if _has_fs_sysfs_dev_attr "$dev" "zoned/max_open_zones"; then
_notrun "zoned XFS shuts down on data write EIO"
fi
;;
@@ -5445,8 +5445,8 @@ _fs_sysfs_dname()
# - content: the content of $attr
#
# Usage example:
-# _set_fs_sysfs_attr /dev/mapper/scratch-dev error/fail_at_unmount 0
-_set_fs_sysfs_attr()
+# _set_fs_sysfs_dev_attr /dev/mapper/scratch-dev error/fail_at_unmount 0
+_set_fs_sysfs_dev_attr()
{
local dev=$1
shift
@@ -5455,7 +5455,7 @@ _set_fs_sysfs_attr()
local content="$*"
if [ ! -b "$dev" -o -z "$attr" -o -z "$content" ];then
- _fail "Usage: _set_fs_sysfs_attr <mounted_device> <attr> <content>"
+ _fail "Usage: _set_fs_sysfs_dev_attr <mounted_device> <attr> <content>"
fi
local dname=$(_fs_sysfs_dname $dev)
@@ -5471,14 +5471,14 @@ _set_fs_sysfs_attr()
# - attr: path name under /sys/fs/$FSTYP/$dev
#
# Usage example:
-# _get_fs_sysfs_attr /dev/mapper/scratch-dev error/fail_at_unmount
-_get_fs_sysfs_attr()
+# _get_fs_sysfs_dev_attr /dev/mapper/scratch-dev error/fail_at_unmount
+_get_fs_sysfs_dev_attr()
{
local dev=$1
local attr=$2
if [ ! -b "$dev" -o -z "$attr" ];then
- _fail "Usage: _get_fs_sysfs_attr <mounted_device> <attr>"
+ _fail "Usage: _get_fs_sysfs_dev_attr <mounted_device> <attr>"
fi
local dname=$(_fs_sysfs_dname $dev)
@@ -5493,14 +5493,14 @@ _get_fs_sysfs_attr()
# - attr: path name under /sys/fs/$FSTYP/$dev
#
# Usage example:
-# _has_fs_sysfs_attr /dev/mapper/scratch-dev error/fail_at_unmount
-_has_fs_sysfs_attr()
+# _has_fs_sysfs_dev_attr /dev/mapper/scratch-dev error/fail_at_unmount
+_has_fs_sysfs_dev_attr()
{
local dev=$1
local attr=$2
if [ ! -b "$dev" -o -z "$attr" ];then
- _fail "Usage: _has_fs_sysfs_attr <mounted_device> <attr>"
+ _fail "Usage: _has_fs_sysfs_dev_attr <mounted_device> <attr>"
fi
local dname=$(_fs_sysfs_dname $dev)
@@ -5509,43 +5509,29 @@ _has_fs_sysfs_attr()
}
# Require the existence of a sysfs entry at /sys/fs/$FSTYP/$DEV/$ATTR
-# All arguments are necessary, and in this order:
+#
+# If only one argument is given, it is taken as the attribute under
+# $TEST_DEV. Otherwise the arguments are, in this order:
# - dev: device name, e.g. $SCRATCH_DEV
# - attr: path name under /sys/fs/$FSTYP/$dev
#
-# Usage example:
-# _require_fs_sysfs_attr /dev/mapper/scratch-dev error/fail_at_unmount
-_require_fs_sysfs_attr()
+# Usage examples:
+# _require_fs_sysfs_dev_attr error/fail_at_unmount
+# _require_fs_sysfs_dev_attr /dev/mapper/scratch-dev error/fail_at_unmount
+_require_fs_sysfs_dev_attr()
{
- _has_fs_sysfs_attr "$@" && return
-
- local dev=$1
- local attr=$2
- local dname=$(_fs_sysfs_dname $dev)
-
- _notrun "This test requires /sys/fs/${FSTYP}/${dname}/${attr}"
-}
+ local dev attr
-# Test for the existence of a sysfs entry at /sys/fs/$FSTYP/DEV/$ATTR
-#
-# Only one argument is needed:
-# - attr: path name under /sys/fs/$FSTYP/DEV
-#
-# Usage example:
-# _has_fs_sysfs error/fail_at_unmount
-_has_fs_sysfs()
-{
- _has_fs_sysfs_attr $TEST_DEV "$@"
-}
-
-# Require the existence of a sysfs entry at /sys/fs/$FSTYP/DEV/$ATTR
-_require_fs_sysfs()
-{
- _has_fs_sysfs "$@" && return
-
- local attr=$1
- local dname=$(_short_dev $TEST_DEV)
+ if [ $# -eq 1 ];then
+ dev=$TEST_DEV
+ attr=$1
+ else
+ dev=$1
+ attr=$2
+ fi
+ _has_fs_sysfs_dev_attr "$dev" "$attr" && return
+ local dname=$(_fs_sysfs_dname $dev)
_notrun "This test requires /sys/fs/${FSTYP}/${dname}/${attr}"
}
@@ -6266,7 +6252,7 @@ _require_fanotify_ioerrors()
;;
ext4)
# added at the same time as err_report_sec
- x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
+ x="$(_get_fs_sysfs_dev_attr $TEST_DEV err_report_sec)"
test -n "$x" && return 0
;;
f2fs)
diff --git a/common/sysfs b/common/sysfs
index 16d4b482..c36ab426 100644
--- a/common/sysfs
+++ b/common/sysfs
@@ -61,11 +61,11 @@ _set_sysfs_policy()
shift
local policy=$@
- _set_fs_sysfs_attr $dev $attr ${policy}
+ _set_fs_sysfs_dev_attr $dev $attr ${policy}
case "$FSTYP" in
btrfs)
- _get_fs_sysfs_attr $dev $attr | grep -q "[${policy}]"
+ _get_fs_sysfs_dev_attr $dev $attr | grep -q "[${policy}]"
if [[ $? != 0 ]]; then
echo "Setting sysfs $attr $policy failed"
fi
@@ -85,7 +85,7 @@ _set_sysfs_policy_must_fail()
shift
local policy=$@
- _set_fs_sysfs_attr $dev $attr ${policy} | _filter_sysfs_error \
+ _set_fs_sysfs_dev_attr $dev $attr ${policy} | _filter_sysfs_error \
| tee -a $seqres.full
}
diff --git a/common/xfs b/common/xfs
index 98981e62..cb484a06 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1167,23 +1167,23 @@ _reset_xfs_sysfs_error_handling()
_fail "Usage: reset_xfs_sysfs_error_handling <device>"
fi
- _set_fs_sysfs_attr $dev error/fail_at_unmount 1
+ _set_fs_sysfs_dev_attr $dev error/fail_at_unmount 1
echo -n "error/fail_at_unmount="
- _get_fs_sysfs_attr $dev error/fail_at_unmount
+ _get_fs_sysfs_dev_attr $dev error/fail_at_unmount
# Make sure all will be configured to retry forever by default, except
# for ENODEV, which is an unrecoverable error, so it will be configured
# to not retry on error by default.
for e in default EIO ENOSPC; do
- _set_fs_sysfs_attr $dev \
+ _set_fs_sysfs_dev_attr $dev \
error/metadata/${e}/max_retries -1
echo -n "error/metadata/${e}/max_retries="
- _get_fs_sysfs_attr $dev error/metadata/${e}/max_retries
+ _get_fs_sysfs_dev_attr $dev error/metadata/${e}/max_retries
- _set_fs_sysfs_attr $dev \
+ _set_fs_sysfs_dev_attr $dev \
error/metadata/${e}/retry_timeout_seconds -1
echo -n "error/metadata/${e}/retry_timeout_seconds="
- _get_fs_sysfs_attr $dev \
+ _get_fs_sysfs_dev_attr $dev \
error/metadata/${e}/retry_timeout_seconds
done
}
@@ -1226,13 +1226,13 @@ _xfs_prepare_for_eio_shutdown()
_add_dmesg_filter "Internal error"
# Don't retry any writes during the (presumably) post-shutdown unmount
- _has_fs_sysfs "$ctlfile" && _set_fs_sysfs_attr $dev "$ctlfile" 1
+ _has_fs_sysfs_dev_attr $dev "$ctlfile" && _set_fs_sysfs_dev_attr $dev "$ctlfile" 1
# Disable retry of metadata writes that fail with EIO
for ctl in max_retries retry_timeout_seconds; do
ctlfile="error/metadata/EIO/$ctl"
- _has_fs_sysfs "$ctlfile" && _set_fs_sysfs_attr $dev "$ctlfile" 0
+ _has_fs_sysfs_dev_attr $dev "$ctlfile" && _set_fs_sysfs_dev_attr $dev "$ctlfile" 0
done
}
@@ -2146,7 +2146,7 @@ _scratch_xfs_force_no_metadir()
# do not run on zoned file systems
_require_xfs_scratch_non_zoned()
{
- if _has_fs_sysfs_attr $SCRATCH_DEV "zoned/max_open_zones"; then
+ if _has_fs_sysfs_dev_attr $SCRATCH_DEV "zoned/max_open_zones"; then
_notrun "Not supported on zoned file systems"
fi
}
@@ -2157,12 +2157,12 @@ _require_xfs_scratch_zoned()
local attr="zoned/max_open_zones"
local min_open_zones=$1
- if ! _has_fs_sysfs_attr $SCRATCH_DEV $attr; then
+ if ! _has_fs_sysfs_dev_attr $SCRATCH_DEV $attr; then
_notrun "Requires zoned file system"
fi
if [ -n "${min_open_zones}" ]; then
- local has_open_zones=`_get_fs_sysfs_attr $SCRATCH_DEV $attr`
+ local has_open_zones=`_get_fs_sysfs_dev_attr $SCRATCH_DEV $attr`
if [ "${min_open_zones}" -gt "${has_open_zones}" ]; then
_notrun "Requires at least ${min_open_zones} open zones"
diff --git a/tests/btrfs/253 b/tests/btrfs/253
index a0cc9b55..5843643d 100755
--- a/tests/btrfs/253
+++ b/tests/btrfs/253
@@ -90,8 +90,8 @@ _scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
# Check if there is sufficient sysfs support.
-_require_fs_sysfs allocation/metadata/chunk_size
-_require_fs_sysfs allocation/metadata/force_chunk_alloc
+_require_fs_sysfs_dev_attr allocation/metadata/chunk_size
+_require_fs_sysfs_dev_attr allocation/metadata/force_chunk_alloc
# Get free space.
free_space FREE_SPACE_MB
@@ -119,7 +119,7 @@ FIRST_DATA_CHUNK_SIZE_B=$((1024 * 1024 * 1024))
# For metadata, we are safe to use the exported value, as the default
# metadata chunk size limit is already smaller than its stripe size.
-FIRST_METADATA_CHUNK_SIZE_B=$(_get_fs_sysfs_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size)
+FIRST_METADATA_CHUNK_SIZE_B=$(_get_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size)
echo "Orig Data chunk size = ${FIRST_DATA_CHUNK_SIZE_B}" >> ${seqres}.full
echo "Orig Metaata chunk size = ${FIRST_METADATA_CHUNK_SIZE_B}" >> ${seqres}.full
@@ -138,8 +138,8 @@ alloc_size "Metadata" METADATA_SIZE_START_MB
echo "Block group Data alloc size = ${DATA_SIZE_START_MB}MB" >> $seqres.full
echo "Block group Metadata alloc size = ${METADATA_SIZE_START_MB}MB" >> $seqres.full
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/metadata/force_chunk_alloc 1
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/metadata/force_chunk_alloc 1
alloc_size "Data" FIRST_DATA_SIZE_MB
alloc_size "Metadata" FIRST_METADATA_SIZE_MB
@@ -171,15 +171,15 @@ fi
echo "Second block group Data alloc size = ${SECOND_DATA_CHUNK_SIZE_B}" >> $seqres.full
echo "Second block group Metadata alloc size = ${SECOND_METADATA_CHUNK_SIZE_B}" >> $seqres.full
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/chunk_size ${SECOND_DATA_CHUNK_SIZE_B}
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size ${SECOND_METADATA_CHUNK_SIZE_B}
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/chunk_size ${SECOND_DATA_CHUNK_SIZE_B}
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size ${SECOND_METADATA_CHUNK_SIZE_B}
-SECOND_DATA_CHUNK_SIZE_READ_B=$(_get_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/chunk_size)
-SECOND_METADATA_CHUNK_SIZE_READ_B=$(_get_fs_sysfs_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size)
+SECOND_DATA_CHUNK_SIZE_READ_B=$(_get_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/chunk_size)
+SECOND_METADATA_CHUNK_SIZE_READ_B=$(_get_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/metadata/chunk_size)
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
echo "Allocated data chunk" >> $seqres.full
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/metadata/force_chunk_alloc 1
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/metadata/force_chunk_alloc 1
echo "Allocated metadata chunk" >> $seqres.full
alloc_size "Data" SECOND_DATA_SIZE_MB
@@ -210,12 +210,12 @@ echo "Allocation size in bytes = ${THIRD_DATA_CHUNK_SIZE_B}" >> ${seqres}.full
# Do allocation until free space is exhausted.
#
echo "Third allocation."
-_set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/chunk_size ${THIRD_DATA_CHUNK_SIZE_B}
+_set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/chunk_size ${THIRD_DATA_CHUNK_SIZE_B}
free_space FREE_SPACE_MB
while [ $FREE_SPACE_MB -gt $THIRD_DATA_CHUNK_SIZE_MB ]; do
alloc_size "Data" THIRD_DATA_SIZE_MB
- _set_fs_sysfs_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
+ _set_fs_sysfs_dev_attr ${SCRATCH_BDEV} allocation/data/force_chunk_alloc 1
free_space FREE_SPACE_MB
done
diff --git a/tests/btrfs/285 b/tests/btrfs/285
index 5ceb69d4..6a1eb236 100755
--- a/tests/btrfs/285
+++ b/tests/btrfs/285
@@ -16,7 +16,7 @@ sysfs_size_classes() {
_require_scratch
_require_btrfs_fs_sysfs
-_require_fs_sysfs allocation/data/size_classes
+_require_fs_sysfs_dev_attr allocation/data/size_classes
f="$SCRATCH_MNT/f"
small=$((16 * 1024))
diff --git a/tests/btrfs/334 b/tests/btrfs/334
index d81ec921..08b66dc7 100755
--- a/tests/btrfs/334
+++ b/tests/btrfs/334
@@ -13,7 +13,7 @@ _begin_fstest auto quick
. ./common/filter
_require_test
-_require_fs_sysfs_attr $TEST_DEV allocation/data/chunk_size
+_require_fs_sysfs_dev_attr $TEST_DEV allocation/data/chunk_size
_verify_sysfs_syntax $TEST_DEV allocation/data/chunk_size 256m
diff --git a/tests/f2fs/025 b/tests/f2fs/025
index 6fc18d98..31dd56a8 100755
--- a/tests/f2fs/025
+++ b/tests/f2fs/025
@@ -21,7 +21,7 @@ _require_scratch_shutdown
_require_xfs_io_command "pwrite"
_require_xfs_io_command "truncate"
_require_f2fs_io_command gc_urgent
-_require_fs_sysfs_attr $TEST_DEV gc_urgent
+_require_fs_sysfs_dev_attr $TEST_DEV gc_urgent
_require_check_dmesg
# Clear options to avoid interference from external configurations
diff --git a/tests/xfs/006 b/tests/xfs/006
index 20fd104b..443e2db2 100755
--- a/tests/xfs/006
+++ b/tests/xfs/006
@@ -25,7 +25,7 @@ _cleanup()
_require_scratch
_require_dm_target error
-_require_fs_sysfs error/fail_at_unmount
+_require_fs_sysfs_dev_attr error/fail_at_unmount
_scratch_mkfs > $seqres.full 2>&1
_dmerror_init
@@ -38,7 +38,7 @@ _reset_xfs_sysfs_error_handling $DMERROR_DEV
# errors at unmount time. _fail the test if we fail to set it to 1,
# because the test probably will hang in such case and block
# subsequent tests.
-attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
+attr=`_get_fs_sysfs_dev_attr $DMERROR_DEV error/fail_at_unmount`
if [ "$attr" != "1" ]; then
_fail "Failed to set error/fail_at_unmount: $attr"
fi
diff --git a/tests/xfs/177 b/tests/xfs/177
index 8d23f66d..e9b4661d 100755
--- a/tests/xfs/177
+++ b/tests/xfs/177
@@ -48,10 +48,10 @@ _require_scratch
# We require /sys/fs/xfs/$device/stats/stats to monitor per-filesystem inode
# cache usage.
-_require_fs_sysfs stats/stats
+_require_fs_sysfs_dev_attr stats/stats
count_xfs_inode_objs() {
- _get_fs_sysfs_attr $SCRATCH_DEV stats/stats | awk '/vnodes/ {print $2}'
+ _get_fs_sysfs_dev_attr $SCRATCH_DEV stats/stats | awk '/vnodes/ {print $2}'
}
dump_debug_info() {
diff --git a/tests/xfs/264 b/tests/xfs/264
index a6e816d3..0820eecd 100755
--- a/tests/xfs/264
+++ b/tests/xfs/264
@@ -24,9 +24,9 @@ _cleanup()
_require_scratch
_require_dm_target error
-_require_fs_sysfs error/fail_at_unmount
-_require_fs_sysfs error/metadata/EIO/max_retries
-_require_fs_sysfs error/metadata/EIO/retry_timeout_seconds
+_require_fs_sysfs_dev_attr error/fail_at_unmount
+_require_fs_sysfs_dev_attr error/metadata/EIO/max_retries
+_require_fs_sysfs_dev_attr error/metadata/EIO/retry_timeout_seconds
_scratch_mkfs >> $seqres.full 2>&1
_dmerror_init
@@ -39,12 +39,12 @@ do_test()
_dmerror_mount
_reset_xfs_sysfs_error_handling $DMERROR_DEV
# Disable fail_at_unmount before test EIO error handling
- _set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 0
+ _set_fs_sysfs_dev_attr $DMERROR_DEV error/fail_at_unmount 0
echo -n "error/fail_at_unmount="
- _get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount
+ _get_fs_sysfs_dev_attr $DMERROR_DEV error/fail_at_unmount
- _set_fs_sysfs_attr $DMERROR_DEV $attr 1
- num=`_get_fs_sysfs_attr $DMERROR_DEV $attr`
+ _set_fs_sysfs_dev_attr $DMERROR_DEV $attr 1
+ num=`_get_fs_sysfs_dev_attr $DMERROR_DEV $attr`
echo "$attr=$num"
# _fail the test if we fail to set $attr to 1, because the test
# probably will hang in such case and block subsequent tests.
diff --git a/tests/xfs/668 b/tests/xfs/668
index 940a6a38..900099e8 100755
--- a/tests/xfs/668
+++ b/tests/xfs/668
@@ -36,7 +36,7 @@ done
# remount read-only and set the gc limit to free up unused space
_scratch_remount ro
rt_available_pre="$(_xfs_get_user_available_rt_blocks "$SCRATCH_MNT")"
-_set_fs_sysfs_attr $SCRATCH_DEV "zoned/zonegc_low_space" 100
+_set_fs_sysfs_dev_attr $SCRATCH_DEV "zoned/zonegc_low_space" 100
# reclaiming a zone with 5% used blocks should take way less than 1 second
sleep 1
@@ -46,14 +46,14 @@ rt_available_post="$(_xfs_get_user_available_rt_blocks "$SCRATCH_MNT")"
[ "$rt_available_post" -gt "$rt_available_pre" ] && \
_fail "gc should not run while read only"
-_set_fs_sysfs_attr $SCRATCH_DEV "zoned/zonegc_low_space" 0
+_set_fs_sysfs_dev_attr $SCRATCH_DEV "zoned/zonegc_low_space" 0
# remount rw and check that gc starts, frees up blocks and stops after
# the threshold is set to reclaim the unused blocks
_scratch_remount rw
rt_available_pre="$(_xfs_get_user_available_rt_blocks "$SCRATCH_MNT")"
-_set_fs_sysfs_attr $SCRATCH_DEV "zoned/zonegc_low_space" 100
+_set_fs_sysfs_dev_attr $SCRATCH_DEV "zoned/zonegc_low_space" 100
i=0
while [ $(_xfs_get_rt_gc_required "$SCRATCH_MNT") -eq "1" ]; do
diff --git a/tests/xfs/669 b/tests/xfs/669
index 25e3f04a..c9c5bc79 100755
--- a/tests/xfs/669
+++ b/tests/xfs/669
@@ -35,7 +35,7 @@ $MKFS_XFS_PROG -b size=${bsize} -r zoned=1,rgsize=${blocks}b \
_mount $SCRATCH_DEV $SCRATCH_MNT -o max_open_zones=${open_zones} || \
_notrun "Zoned allocator not supported"
-_has_fs_sysfs_attr $SCRATCH_DEV zoned/nr_open_zones || \
+_has_fs_sysfs_dev_attr $SCRATCH_DEV zoned/nr_open_zones || \
_notrun "This test requires /sys/fs/${FSTYP}/$SCRATCH_DEV/zoned/nr_open_zones"
for i in $(seq 1 $nr_files); do
@@ -51,8 +51,8 @@ done
_scratch_unmount
_mount $SCRATCH_DEV $SCRATCH_MNT -o max_open_zones=${open_zones}
-max_open=$(_get_fs_sysfs_attr $SCRATCH_DEV zoned/max_open_zones)
-nr_open=$(_get_fs_sysfs_attr $SCRATCH_DEV zoned/nr_open_zones)
+max_open=$(_get_fs_sysfs_dev_attr $SCRATCH_DEV zoned/max_open_zones)
+nr_open=$(_get_fs_sysfs_dev_attr $SCRATCH_DEV zoned/nr_open_zones)
if [ ${max_open} -ne $((open_zones - 1)) ]; then
_fail "Test needs adjustments for multiple open GC zones"
diff --git a/tests/xfs/670 b/tests/xfs/670
index 9b248d96..a9df3deb 100755
--- a/tests/xfs/670
+++ b/tests/xfs/670
@@ -36,7 +36,7 @@ $XFS_GROWFS_PROG $SCRATCH_MNT -R $((2 * rblocks)) >> $seqres.full 2>&1 || \
# For zoned file systems, check that the growfs did increase the available free
# zones. This avoids a hang on unfixed kernels when filling later.
free_zones_post=$(_xfs_get_mountstat $SCRATCH_MNT "free zones:")
-if _has_fs_sysfs_attr $SCRATCH_DEV "zoned/max_open_zones"; then
+if _has_fs_sysfs_dev_attr $SCRATCH_DEV "zoned/max_open_zones"; then
if [ "$free_zones_pre" == "$free_zones_post" ]; then
_fail "growfs did not increase free zones"
fi
--
2.55.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] common/sysfs: adjust function naming
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
2026-09-14 17:25 ` [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr Zorro Lang
@ 2026-09-14 17:25 ` Zorro Lang
2026-09-15 6:57 ` Christoph Hellwig
2026-09-14 17:25 ` [PATCH 3/5] common/rc: add helpers for /sys/fs/$FSTYP/features/ Zorro Lang
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
Add the _dev_ infix to helper functions associated with
/sys/fs/$FSTYP/<devices> to distinguish them from upcoming
/sys/fs/$FSTYP/features/ related helpers.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
common/sysfs | 66 ++++++++++++++++++++++++-------------------------
tests/btrfs/253 | 2 +-
tests/btrfs/329 | 4 +--
tests/btrfs/334 | 2 +-
4 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/common/sysfs b/common/sysfs
index c36ab426..ede5bcb6 100644
--- a/common/sysfs
+++ b/common/sysfs
@@ -12,8 +12,8 @@
# - policy: policy within /sys/fs/$FSTYP/$dev
#
# Usage example:
-# _has_fs_sysfs_attr_policy /dev/mapper/scratch-dev read_policy round-robin
-_has_fs_sysfs_attr_policy()
+# _has_fs_sysfs_dev_policy /dev/mapper/scratch-dev read_policy round-robin
+_has_fs_sysfs_dev_policy()
{
local dev=$1
local attr=$2
@@ -21,7 +21,7 @@ _has_fs_sysfs_attr_policy()
if [ ! -b "$dev" -o -z "$attr" -o -z "$policy" ]; then
_fail \
- "Usage: _has_fs_sysfs_attr_policy <mounted_device> <attr> <policy>"
+ "Usage: _has_fs_sysfs_dev_policy <mounted_device> <attr> <policy>"
fi
local dname=$(_fs_sysfs_dname $dev)
@@ -40,10 +40,10 @@ _has_fs_sysfs_attr_policy()
# - policy: mentioned in /sys/fs/$FSTYP/$dev/$attr
#
# Usage example:
-# _require_fs_sysfs_attr_policy /dev/mapper/scratch-dev read_policy round-robin
-_require_fs_sysfs_attr_policy()
+# _require_fs_sysfs_dev_policy /dev/mapper/scratch-dev read_policy round-robin
+_require_fs_sysfs_dev_policy()
{
- _has_fs_sysfs_attr_policy "$@" && return
+ _has_fs_sysfs_dev_policy "$@" && return
local dev=$1
local attr=$2
@@ -53,7 +53,7 @@ _require_fs_sysfs_attr_policy()
_notrun "This test requires /sys/fs/${FSTYP}/${dname}/${attr} ${policy}"
}
-_set_sysfs_policy()
+_set_sysfs_dev_policy()
{
local dev=$1
local attr=$2
@@ -77,7 +77,7 @@ _set_sysfs_policy()
esac
}
-_set_sysfs_policy_must_fail()
+_set_sysfs_dev_policy_must_fail()
{
local dev=$1
local attr=$2
@@ -91,18 +91,18 @@ _set_sysfs_policy_must_fail()
# Verify sysfs attribute rejects invalid input.
# Usage syntax:
-# _verify_sysfs_syntax <$dev> <$attr> <$policy> [$value]
+# _verify_sysfs_dev_syntax <$dev> <$attr> <$policy> [$value]
# Examples:
-# _verify_sysfs_syntax $TEST_DEV read_policy pid
-# _verify_sysfs_syntax $TEST_DEV read_policy round-robin 4k
+# _verify_sysfs_dev_syntax $TEST_DEV read_policy pid
+# _verify_sysfs_dev_syntax $TEST_DEV read_policy round-robin 4k
# Note:
# Testcase must include
# . ./common/filter
# Prerequisite checks are kept outside this function
# to make them clear to the test case, rather than hiding
# them deep inside another function.
-# _require_fs_sysfs_attr_policy $TEST_DEV $attr $policy
-_verify_sysfs_syntax()
+# _require_fs_sysfs_dev_policy $TEST_DEV $attr $policy
+_verify_sysfs_dev_syntax()
{
local dev=$1
local attr=$2
@@ -110,23 +110,23 @@ _verify_sysfs_syntax()
local value=$4
# Test policy specified wrongly. Must fail.
- _set_sysfs_policy_must_fail $dev $attr "'$policy $policy'"
- _set_sysfs_policy_must_fail $dev $attr "'$policy t'"
- _set_sysfs_policy_must_fail $dev $attr "' '"
- _set_sysfs_policy_must_fail $dev $attr "'${policy} n'"
- _set_sysfs_policy_must_fail $dev $attr "'n ${policy}'"
- _set_sysfs_policy_must_fail $dev $attr "' ${policy}'"
- _set_sysfs_policy_must_fail $dev $attr "' ${policy} '"
- _set_sysfs_policy_must_fail $dev $attr "'${policy} '"
- _set_sysfs_policy_must_fail $dev $attr _${policy}
- _set_sysfs_policy_must_fail $dev $attr ${policy}_
- _set_sysfs_policy_must_fail $dev $attr _${policy}_
- _set_sysfs_policy_must_fail $dev $attr ${policy}:
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy $policy'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy t'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "' '"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'${policy} n'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'n ${policy}'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "' ${policy}'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "' ${policy} '"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'${policy} '"
+ _set_sysfs_dev_policy_must_fail $dev $attr _${policy}
+ _set_sysfs_dev_policy_must_fail $dev $attr ${policy}_
+ _set_sysfs_dev_policy_must_fail $dev $attr _${policy}_
+ _set_sysfs_dev_policy_must_fail $dev $attr ${policy}:
# Test policy longer than 32 chars fails stable.
- _set_sysfs_policy_must_fail $dev $attr 'jfdkkkkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjffjfjfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
+ _set_sysfs_dev_policy_must_fail $dev $attr 'jfdkkkkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjffjfjfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
# Test policy specified correctly. Must pass.
- _set_sysfs_policy $dev $attr $policy
+ _set_sysfs_dev_policy $dev $attr $policy
# If the policy has no value return
if [[ -z $value ]]; then
@@ -134,12 +134,12 @@ _verify_sysfs_syntax()
fi
# Test value specified wrongly. Must fail.
- _set_sysfs_policy_must_fail $dev $attr "'$policy: $value'"
- _set_sysfs_policy_must_fail $dev $attr "'$policy:$value '"
- _set_sysfs_policy_must_fail $dev $attr "'$policy:$value typo'"
- _set_sysfs_policy_must_fail $dev $attr "'$policy:${value}typo'"
- _set_sysfs_policy_must_fail $dev $attr "'$policy :$value'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy: $value'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy:$value '"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy:$value typo'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy:${value}typo'"
+ _set_sysfs_dev_policy_must_fail $dev $attr "'$policy :$value'"
# Test policy and value all specified correctly. Must pass.
- _set_sysfs_policy $dev $attr $policy:$value
+ _set_sysfs_dev_policy $dev $attr $policy:$value
}
diff --git a/tests/btrfs/253 b/tests/btrfs/253
index 5843643d..b1443328 100755
--- a/tests/btrfs/253
+++ b/tests/btrfs/253
@@ -226,7 +226,7 @@ alloc_size "Data" FOURTH_DATA_SIZE_MB
# Force chunk allocation of system block type must fail.
#
echo "Force allocation of system block type must fail."
-_set_sysfs_policy_must_fail ${SCRATCH_BDEV} allocation/system/force_chunk_alloc 1
+_set_sysfs_dev_policy_must_fail ${SCRATCH_BDEV} allocation/system/force_chunk_alloc 1
#
# Verification of initial allocation.
diff --git a/tests/btrfs/329 b/tests/btrfs/329
index f4fadded..86e9a380 100755
--- a/tests/btrfs/329
+++ b/tests/btrfs/329
@@ -13,9 +13,9 @@ _begin_fstest auto quick
. ./common/filter
_require_test
-_require_fs_sysfs_attr_policy $TEST_DEV read_policy round-robin
+_require_fs_sysfs_dev_policy $TEST_DEV read_policy round-robin
-_verify_sysfs_syntax $TEST_DEV read_policy round-robin 4096
+_verify_sysfs_dev_syntax $TEST_DEV read_policy round-robin 4096
status=0
exit
diff --git a/tests/btrfs/334 b/tests/btrfs/334
index 08b66dc7..ae9b72b7 100755
--- a/tests/btrfs/334
+++ b/tests/btrfs/334
@@ -15,7 +15,7 @@ _begin_fstest auto quick
_require_test
_require_fs_sysfs_dev_attr $TEST_DEV allocation/data/chunk_size
-_verify_sysfs_syntax $TEST_DEV allocation/data/chunk_size 256m
+_verify_sysfs_dev_syntax $TEST_DEV allocation/data/chunk_size 256m
status=0
exit
--
2.55.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] common/rc: add helpers for /sys/fs/$FSTYP/features/
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
2026-09-14 17:25 ` [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr Zorro Lang
2026-09-14 17:25 ` [PATCH 2/5] common/sysfs: adjust function naming Zorro Lang
@ 2026-09-14 17:25 ` Zorro Lang
2026-09-14 17:25 ` [PATCH 4/5] common/rc: use common helper in _require_fanotify_ioerrors for f2fs Zorro Lang
2026-09-14 17:25 ` [PATCH 5/5] fstests: replace btrfs specific helpers with common sysfs helpers Zorro Lang
4 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
More and more test cases depend on /sys/fs/$FSTYP/features/ entries.
To improve code structure and maintainability, introduce the
- _has_fs_sysfs_feature_attr
- _get_fs_sysfs_feature_attr
- _require_fs_sysfs_feature_attr
helpers.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
common/rc | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/common/rc b/common/rc
index b99e28a5..439ca0d5 100644
--- a/common/rc
+++ b/common/rc
@@ -5535,6 +5535,58 @@ _require_fs_sysfs_dev_attr()
_notrun "This test requires /sys/fs/${FSTYP}/${dname}/${attr}"
}
+# Print the content of /sys/fs/$FSTYP/features/$ATTR
+#
+# Only one argument is needed:
+# - attr: path name under /sys/fs/$FSTYP/features
+#
+# Usage example:
+# _get_fs_sysfs_feature_attr send_stream_version
+_get_fs_sysfs_feature_attr()
+{
+ local attr=$1
+
+ if [ -z "$attr" ];then
+ _fail "Usage: _get_fs_sysfs_feature_attr <attr>"
+ fi
+
+ cat /sys/fs/${FSTYP}/features/${attr}
+}
+
+# Test for the existence of a sysfs entry at /sys/fs/$FSTYP/features/$ATTR
+#
+# Only one argument is needed:
+# - attr: path name under /sys/fs/$FSTYP/features
+#
+# Usage example:
+# _has_fs_sysfs_feature_attr raid56
+_has_fs_sysfs_feature_attr()
+{
+ local attr=$1
+
+ if [ -z "$attr" ];then
+ _fail "Usage: _has_fs_sysfs_feature_attr <attr>"
+ fi
+
+ test -e /sys/fs/${FSTYP}/features/${attr}
+}
+
+# Require the existence of a sysfs entry at /sys/fs/$FSTYP/features/$ATTR
+#
+# Only one argument is needed:
+# - attr: path name under /sys/fs/$FSTYP/features
+#
+# Usage example:
+# _require_fs_sysfs_feature_attr raid56
+_require_fs_sysfs_feature_attr()
+{
+ local attr=$1
+
+ _has_fs_sysfs_feature_attr "$attr" && return
+
+ _notrun "This test requires /sys/fs/${FSTYP}/features/${attr}"
+}
+
# Generic test for specific filesystem feature.
# Currently only implemented to test overlayfs features.
_require_scratch_feature()
--
2.55.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] common/rc: use common helper in _require_fanotify_ioerrors for f2fs
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
` (2 preceding siblings ...)
2026-09-14 17:25 ` [PATCH 3/5] common/rc: add helpers for /sys/fs/$FSTYP/features/ Zorro Lang
@ 2026-09-14 17:25 ` Zorro Lang
2026-09-14 17:25 ` [PATCH 5/5] fstests: replace btrfs specific helpers with common sysfs helpers Zorro Lang
4 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
The f2fs branch of _require_fanotify_ioerrors() reads the raw
/sys/fs/f2fs/features/fserror path. Use the new
_get_fs_sysfs_feature_attr helper instead.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
common/rc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/rc b/common/rc
index 439ca0d5..711c5507 100644
--- a/common/rc
+++ b/common/rc
@@ -6308,8 +6308,8 @@ _require_fanotify_ioerrors()
test -n "$x" && return 0
;;
f2fs)
- local feat_file="/sys/fs/f2fs/features/fserror"
- if [ -f "$feat_file" ] && [ "$(cat "$feat_file")" = "supported" ]; then
+ x="$(_get_fs_sysfs_feature_attr fserror 2>/dev/null)"
+ if [ "$x" = "supported" ];then
return 0
fi
;;
--
2.55.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] fstests: replace btrfs specific helpers with common sysfs helpers
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
` (3 preceding siblings ...)
2026-09-14 17:25 ` [PATCH 4/5] common/rc: use common helper in _require_fanotify_ioerrors for f2fs Zorro Lang
@ 2026-09-14 17:25 ` Zorro Lang
4 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-14 17:25 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
Switch from btrfs specific helpers to the generic sysfs helpers
across btrfs test cases, reduce code duplication.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
common/btrfs | 37 ++-----------------------------------
common/rc | 3 ++-
tests/btrfs/010 | 3 ++-
tests/btrfs/055 | 2 +-
tests/btrfs/056 | 2 +-
tests/btrfs/112 | 2 +-
tests/btrfs/131 | 2 +-
tests/btrfs/165 | 2 +-
tests/btrfs/188 | 2 +-
tests/btrfs/192 | 2 +-
tests/btrfs/201 | 2 +-
tests/btrfs/205 | 2 +-
tests/btrfs/209 | 2 +-
tests/btrfs/211 | 2 +-
tests/btrfs/219 | 3 +--
tests/btrfs/231 | 2 +-
tests/btrfs/285 | 1 -
tests/btrfs/296 | 8 +-------
tests/btrfs/304 | 4 ++--
tests/btrfs/305 | 4 ++--
tests/btrfs/306 | 4 ++--
tests/btrfs/307 | 4 ++--
tests/btrfs/308 | 4 ++--
tests/btrfs/311 | 2 +-
tests/btrfs/313 | 2 +-
tests/btrfs/314 | 2 +-
tests/btrfs/315 | 2 +-
tests/btrfs/342 | 2 +-
tests/btrfs/352 | 2 +-
tests/generic/098 | 2 +-
tests/generic/101 | 2 +-
31 files changed, 38 insertions(+), 77 deletions(-)
diff --git a/common/btrfs b/common/btrfs
index fb1523ab..b7c894a0 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -100,26 +100,6 @@ _require_btrfs_mkfs_uuid_option()
fi
}
-_require_btrfs_fs_feature()
-{
- if [ -z $1 ]; then
- echo "Missing feature name argument for _require_btrfs_fs_feature"
- _exit 1
- fi
- feat=$1
- modprobe btrfs > /dev/null 2>&1
- [ -e /sys/fs/btrfs/features/$feat ] || \
- _notrun "Feature $feat not supported by the available btrfs version"
-}
-
-_require_btrfs_fs_sysfs()
-{
- modprobe btrfs > /dev/null 2>&1
- [ -e /sys/fs/btrfs/features ] || \
- _notrun "Sysfs not supported by the available btrfs version"
-
-}
-
_require_btrfs_no_compress()
{
if _normalize_mount_options "$MOUNT_OPTIONS" | grep -q "compress"; then
@@ -959,18 +939,6 @@ _require_scratch_enable_simple_quota()
_scratch_unmount
}
-_has_btrfs_sysfs_feature_attr()
-{
- local feature_attr=$1
-
- [ -z $feature_attr ] && \
- _fail "Missing feature name argument for _has_btrfs_sysfs_attr"
-
- modprobe btrfs &> /dev/null
-
- test -e /sys/fs/btrfs/features/$feature_attr
-}
-
# Print the fsid and metadata uuid replaced with constant strings FSID and
# METADATA_UUID. Compare temp_fsid with fsid and metadata_uuid, then echo what
# it matches to or TEMP_FSID. This helps in comparing with the golden output.
@@ -980,9 +948,8 @@ _check_temp_fsid()
local fsid
local metadata_uuid
- _require_btrfs_fs_sysfs
- _require_btrfs_fs_feature temp_fsid
- _require_btrfs_fs_feature metadata_uuid
+ _require_fs_sysfs_feature_attr temp_fsid
+ _require_fs_sysfs_feature_attr metadata_uuid
_require_btrfs_command inspect-internal dump-super
# on disk fsid
diff --git a/common/rc b/common/rc
index 711c5507..3020a0c5 100644
--- a/common/rc
+++ b/common/rc
@@ -5582,6 +5582,7 @@ _require_fs_sysfs_feature_attr()
{
local attr=$1
+ modprobe $FSTYP > /dev/null 2>&1
_has_fs_sysfs_feature_attr "$attr" && return
_notrun "This test requires /sys/fs/${FSTYP}/features/${attr}"
@@ -6084,7 +6085,7 @@ _require_duplicate_fsid()
{
case "$FSTYP" in
"btrfs")
- _require_btrfs_fs_feature temp_fsid
+ _require_fs_sysfs_feature_attr temp_fsid
;;
"ext4")
;;
diff --git a/tests/btrfs/010 b/tests/btrfs/010
index d27c6dd2..10d30b70 100755
--- a/tests/btrfs/010
+++ b/tests/btrfs/010
@@ -23,7 +23,8 @@ _cleanup()
. ./common/filter
_require_test
-_require_btrfs_fs_sysfs
+_require_fs_sysfs_dev_attr $TEST_DEV allocation/metadata/bytes_may_use
+_require_fs_sysfs_dev_attr $TEST_DEV allocation/global_rsv_reserved
# Create 32k extents. All of these extents will be accounted as outstanding and
# reserved.
diff --git a/tests/btrfs/055 b/tests/btrfs/055
index bd0755d2..5d6fba4b 100755
--- a/tests/btrfs/055
+++ b/tests/btrfs/055
@@ -25,7 +25,7 @@ _cleanup()
_require_scratch
_require_cloner
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
test_btrfs_clone_with_holes()
diff --git a/tests/btrfs/056 b/tests/btrfs/056
index 08f9aac6..10e676a7 100755
--- a/tests/btrfs/056
+++ b/tests/btrfs/056
@@ -29,7 +29,7 @@ _cleanup()
_require_scratch
_require_cloner
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
diff --git a/tests/btrfs/112 b/tests/btrfs/112
index 1326b824..5ff5eb73 100755
--- a/tests/btrfs/112
+++ b/tests/btrfs/112
@@ -15,7 +15,7 @@ _begin_fstest auto quick clone prealloc compress
_require_scratch
_require_cloner
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_xfs_io_command "falloc"
diff --git a/tests/btrfs/131 b/tests/btrfs/131
index b54b8326..fa9c00ae 100755
--- a/tests/btrfs/131
+++ b/tests/btrfs/131
@@ -16,7 +16,7 @@ _begin_fstest auto quick
_require_scratch
_require_btrfs_command inspect-internal dump-super
-_require_btrfs_fs_feature free_space_tree
+_require_fs_sysfs_feature_attr free_space_tree
_require_btrfs_v1_cache
_scratch_mkfs >/dev/null 2>&1
diff --git a/tests/btrfs/165 b/tests/btrfs/165
index a1099d88..9dc8afab 100755
--- a/tests/btrfs/165
+++ b/tests/btrfs/165
@@ -34,7 +34,7 @@ rm_r_subvol() {
. ./common/filter
_require_scratch
-_require_btrfs_fs_feature "rmdir_subvol"
+_require_fs_sysfs_feature_attr "rmdir_subvol"
_scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
_scratch_mount
diff --git a/tests/btrfs/188 b/tests/btrfs/188
index 6a3e9831..24169040 100755
--- a/tests/btrfs/188
+++ b/tests/btrfs/188
@@ -24,7 +24,7 @@ _cleanup()
_require_test
_require_scratch
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_xfs_io_command "fpunch"
_require_xfs_io_command "falloc" "-k"
diff --git a/tests/btrfs/192 b/tests/btrfs/192
index 56ec2b28..f40ef46e 100755
--- a/tests/btrfs/192
+++ b/tests/btrfs/192
@@ -28,7 +28,7 @@ _cleanup()
_require_command "$BLKDISCARD_PROG" blkdiscard
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_log_writes
_require_scratch
diff --git a/tests/btrfs/201 b/tests/btrfs/201
index 50262086..a40bd77b 100755
--- a/tests/btrfs/201
+++ b/tests/btrfs/201
@@ -27,7 +27,7 @@ _require_scratch
_require_dm_target flakey
_require_attrs
_require_xfs_io_command "fpunch"
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_odirect
diff --git a/tests/btrfs/205 b/tests/btrfs/205
index a557ab14..4f5161a6 100755
--- a/tests/btrfs/205
+++ b/tests/btrfs/205
@@ -22,7 +22,7 @@ _begin_fstest auto quick clone compress prealloc
_require_scratch_reflink
_require_xfs_io_command "falloc" "-k"
_require_command "$CHATTR_PROG" chattr
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
# We want to create a compressed inline extent representing 4K of data for file
# foo1 and then clone it into a file without compression, and since compression
diff --git a/tests/btrfs/209 b/tests/btrfs/209
index bd98b635..10876731 100755
--- a/tests/btrfs/209
+++ b/tests/btrfs/209
@@ -26,7 +26,7 @@ _cleanup()
_require_scratch
_require_dm_target flakey
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_xfs_io_command "sync_range"
diff --git a/tests/btrfs/211 b/tests/btrfs/211
index 38dbadf9..3a8b22a1 100755
--- a/tests/btrfs/211
+++ b/tests/btrfs/211
@@ -27,7 +27,7 @@ _require_scratch
_require_xfs_io_command "falloc" "-k"
# fiemap needed by _count_extents()
_require_xfs_io_command "fiemap"
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
diff --git a/tests/btrfs/219 b/tests/btrfs/219
index 052f61a3..358cccb4 100755
--- a/tests/btrfs/219
+++ b/tests/btrfs/219
@@ -47,7 +47,6 @@ loop_dev2=""
_require_test
_require_loop
-_require_btrfs_fs_sysfs
_require_btrfs_forget_or_module_loadable
_fixed_by_kernel_commit 5f58d783fd78 \
"btrfs: free device in btrfs_close_devices for a single device filesystem"
@@ -91,7 +90,7 @@ _btrfs_forget_or_module_reload
_mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \
_fail "Failed to mount the third time"
-if ! _has_btrfs_sysfs_feature_attr temp_fsid; then
+if ! _has_fs_sysfs_feature_attr temp_fsid; then
_mount $loop_dev2 $loop_mnt2 > /dev/null 2>&1 && \
_fail "We were allowed to mount when we should have failed"
fi
diff --git a/tests/btrfs/231 b/tests/btrfs/231
index 5ebb2fdd..9e7f3eb1 100755
--- a/tests/btrfs/231
+++ b/tests/btrfs/231
@@ -25,7 +25,7 @@ _cleanup()
. ./common/dmflakey
_require_scratch
-_require_btrfs_fs_feature "no_holes"
+_require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
diff --git a/tests/btrfs/285 b/tests/btrfs/285
index 6a1eb236..d45779d5 100755
--- a/tests/btrfs/285
+++ b/tests/btrfs/285
@@ -15,7 +15,6 @@ sysfs_size_classes() {
}
_require_scratch
-_require_btrfs_fs_sysfs
_require_fs_sysfs_dev_attr allocation/data/size_classes
f="$SCRATCH_MNT/f"
diff --git a/tests/btrfs/296 b/tests/btrfs/296
index 0baf89c0..19e3fdea 100755
--- a/tests/btrfs/296
+++ b/tests/btrfs/296
@@ -14,14 +14,8 @@ _require_scratch_dev_pool 3
_fixed_by_kernel_commit b7625f461da6 \
"btrfs: sysfs: update fs features directory asynchronously"
-# We need the global features support
-_require_btrfs_fs_sysfs
-
-global_features="/sys/fs/btrfs/features"
# Make sure we have support RAID1C34 first
-if [ ! -f "${global_features}/raid1c34" ]; then
- _notrun "no RAID1C34 support"
-fi
+_require_fs_sysfs_feature_attr raid1c34
_scratch_dev_pool_get 3
diff --git a/tests/btrfs/304 b/tests/btrfs/304
index 18f73590..ec165a21 100755
--- a/tests/btrfs/304
+++ b/tests/btrfs/304
@@ -16,8 +16,8 @@ _begin_fstest auto quick raid remount volume raid-stripe-tree
_require_btrfs_command inspect-internal dump-tree
_require_btrfs_mkfs_feature "raid-stripe-tree"
_require_scratch_dev_pool 4
-_require_btrfs_fs_feature "raid_stripe_tree"
-_require_btrfs_fs_feature "free_space_tree"
+_require_fs_sysfs_feature_attr "raid_stripe_tree"
+_require_fs_sysfs_feature_attr "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
_require_btrfs_support_sectorsize 4096
diff --git a/tests/btrfs/305 b/tests/btrfs/305
index 45747627..ddb3a8ee 100755
--- a/tests/btrfs/305
+++ b/tests/btrfs/305
@@ -17,8 +17,8 @@ _begin_fstest auto quick raid remount volume raid-stripe-tree
_require_btrfs_command inspect-internal dump-tree
_require_btrfs_mkfs_feature "raid-stripe-tree"
_require_scratch_dev_pool 4
-_require_btrfs_fs_feature "raid_stripe_tree"
-_require_btrfs_fs_feature "free_space_tree"
+_require_fs_sysfs_feature_attr "raid_stripe_tree"
+_require_fs_sysfs_feature_attr "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
_require_btrfs_support_sectorsize 4096
diff --git a/tests/btrfs/306 b/tests/btrfs/306
index db3defc8..ebc21190 100755
--- a/tests/btrfs/306
+++ b/tests/btrfs/306
@@ -17,8 +17,8 @@ _begin_fstest auto quick raid remount volume raid-stripe-tree
_require_btrfs_command inspect-internal dump-tree
_require_btrfs_mkfs_feature "raid-stripe-tree"
_require_scratch_dev_pool 4
-_require_btrfs_fs_feature "raid_stripe_tree"
-_require_btrfs_fs_feature "free_space_tree"
+_require_fs_sysfs_feature_attr "raid_stripe_tree"
+_require_fs_sysfs_feature_attr "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
_require_btrfs_support_sectorsize 4096
diff --git a/tests/btrfs/307 b/tests/btrfs/307
index 02a9d4d3..552fdf19 100755
--- a/tests/btrfs/307
+++ b/tests/btrfs/307
@@ -16,8 +16,8 @@ _begin_fstest auto quick raid remount volume raid-stripe-tree
_require_btrfs_command inspect-internal dump-tree
_require_btrfs_mkfs_feature "raid-stripe-tree"
_require_scratch_dev_pool 4
-_require_btrfs_fs_feature "raid_stripe_tree"
-_require_btrfs_fs_feature "free_space_tree"
+_require_fs_sysfs_feature_attr "raid_stripe_tree"
+_require_fs_sysfs_feature_attr "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
diff --git a/tests/btrfs/308 b/tests/btrfs/308
index c4ccaa0f..9fab9795 100755
--- a/tests/btrfs/308
+++ b/tests/btrfs/308
@@ -17,8 +17,8 @@ _begin_fstest auto quick raid remount volume raid-stripe-tree
_require_btrfs_command inspect-internal dump-tree
_require_btrfs_mkfs_feature "raid-stripe-tree"
_require_scratch_dev_pool 4
-_require_btrfs_fs_feature "raid_stripe_tree"
-_require_btrfs_fs_feature "free_space_tree"
+_require_fs_sysfs_feature_attr "raid_stripe_tree"
+_require_fs_sysfs_feature_attr "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
_require_btrfs_no_nodatacow
diff --git a/tests/btrfs/311 b/tests/btrfs/311
index 9ac997db..81d57da1 100755
--- a/tests/btrfs/311
+++ b/tests/btrfs/311
@@ -24,7 +24,7 @@ _cleanup()
_require_cp_reflink
_require_scratch
-_require_btrfs_fs_feature temp_fsid
+_require_fs_sysfs_feature_attr temp_fsid
mnt1=$TEST_DIR/$seq/mnt1
mkdir -p $mnt1
diff --git a/tests/btrfs/313 b/tests/btrfs/313
index 7d09aaad..4729d2a4 100755
--- a/tests/btrfs/313
+++ b/tests/btrfs/313
@@ -22,7 +22,7 @@ _cleanup()
_require_cp_reflink
_require_scratch_dev_pool 2
-_require_btrfs_fs_feature temp_fsid
+_require_fs_sysfs_feature_attr temp_fsid
_scratch_dev_pool_get 2
diff --git a/tests/btrfs/314 b/tests/btrfs/314
index 01646157..8f4dfd82 100755
--- a/tests/btrfs/314
+++ b/tests/btrfs/314
@@ -22,7 +22,7 @@ _cleanup()
. ./common/filter.btrfs
_require_scratch_dev_pool 2
-_require_btrfs_fs_feature temp_fsid
+_require_fs_sysfs_feature_attr temp_fsid
_scratch_dev_pool_get 2
diff --git a/tests/btrfs/315 b/tests/btrfs/315
index b9fdba6a..74574bdd 100755
--- a/tests/btrfs/315
+++ b/tests/btrfs/315
@@ -21,7 +21,7 @@ _cleanup()
. ./common/filter
_require_scratch_dev_pool 3
-_require_btrfs_fs_feature temp_fsid
+_require_fs_sysfs_feature_attr temp_fsid
_scratch_dev_pool_get 3
diff --git a/tests/btrfs/342 b/tests/btrfs/342
index e88b47e0..96446640 100755
--- a/tests/btrfs/342
+++ b/tests/btrfs/342
@@ -13,7 +13,7 @@ _begin_fstest auto quick
_require_scratch
_require_btrfs_command inspect-internal dump-super
-_require_btrfs_fs_feature free_space_tree
+_require_fs_sysfs_feature_attr free_space_tree
# The block-group-tree feature relies on v2 cache, thus it doesn't support
# "nospace_cache" mount option.
diff --git a/tests/btrfs/352 b/tests/btrfs/352
index 1d40c09c..9551f3d4 100755
--- a/tests/btrfs/352
+++ b/tests/btrfs/352
@@ -14,7 +14,7 @@ _begin_fstest auto quick remount
_fixed_by_kernel_commit XXXXXXXXXXXX \
"btrfs: fix leaking BTRFS_FS_STATE_REMOUNTING flag"
-_require_btrfs_fs_feature supported_rescue_options
+_require_fs_sysfs_feature_attr supported_rescue_options
if ! grep -q "ignorebadroots" "/sys/fs/btrfs/features/supported_rescue_options"; then
_notrun "\"rescue=ignorebadroots\" mount option not supported"
diff --git a/tests/generic/098 b/tests/generic/098
index ff6cf908..ff003f60 100755
--- a/tests/generic/098
+++ b/tests/generic/098
@@ -24,7 +24,7 @@ _require_scratch
# feature is enabled (introduced in kernel 3.14). So enable the feature if the
# fs being tested is btrfs.
if [ $FSTYP == "btrfs" ]; then
- _require_btrfs_fs_feature "no_holes"
+ _require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
MKFS_OPTIONS="$MKFS_OPTIONS -O no-holes"
fi
diff --git a/tests/generic/101 b/tests/generic/101
index 31660277..e51be5b5 100755
--- a/tests/generic/101
+++ b/tests/generic/101
@@ -32,7 +32,7 @@ _require_dm_target flakey
# feature is enabled (introduced in kernel 3.14). So enable the feature if the
# fs being tested is btrfs.
if [ $FSTYP == "btrfs" ]; then
- _require_btrfs_fs_feature "no_holes"
+ _require_fs_sysfs_feature_attr "no_holes"
_require_btrfs_mkfs_feature "no-holes"
MKFS_OPTIONS="$MKFS_OPTIONS -O no-holes"
fi
--
2.55.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr
2026-09-14 17:25 ` [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr Zorro Lang
@ 2026-09-15 6:56 ` Christoph Hellwig
2026-09-15 14:33 ` Zorro Lang
0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2026-09-15 6:56 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
On Tue, Sep 15, 2026 at 01:25:05AM +0800, Zorro Lang wrote:
> There is heavy overlap between _require_fs_sysfs and
> _require_fs_sysfs_attr, and their ambiguous names make it difficult
> to tell them apart.
>
> So merge them into a single function with "_dev_" included in the
> name to distinguish per-device entries from other paths like
> /sys/fs/$FSTYP/features/.
I have a bit of a hard time understanding this message. From looking
at the diff this seems to:
- rename _has_fs_sysfs_attr to _has_fs_sysfs_dev_attr
- rename _get_fs_sysfs_attr to _get_fs_sysfs_dev_attr
- rename _set_fs_sysfs_attr to _set_fs_sysfs_dev_attr
- rename _require_fs_sysfs_attr to _require_fs_sysfs_dev_attr
- remove _require_fs_sysfs
right? Maybe spell that out and split the pure renames from code
removal?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] common/sysfs: adjust function naming
2026-09-14 17:25 ` [PATCH 2/5] common/sysfs: adjust function naming Zorro Lang
@ 2026-09-15 6:57 ` Christoph Hellwig
2026-09-15 14:46 ` Zorro Lang
0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2026-09-15 6:57 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
On Tue, Sep 15, 2026 at 01:25:06AM +0800, Zorro Lang wrote:
> Add the _dev_ infix to helper functions associated with
> /sys/fs/$FSTYP/<devices> to distinguish them from upcoming
> /sys/fs/$FSTYP/features/ related helpers.
Should these even exist as separate helper? And if so they probably
should have btrfs in the names?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr
2026-09-15 6:56 ` Christoph Hellwig
@ 2026-09-15 14:33 ` Zorro Lang
0 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-15 14:33 UTC (permalink / raw)
To: Christoph Hellwig
Cc: fstests, linux-xfs, linux-btrfs, Anand Suveer Jain, Chao Yu
On Mon, Sep 14, 2026 at 11:56:06PM -0700, Christoph Hellwig wrote:
> On Tue, Sep 15, 2026 at 01:25:05AM +0800, Zorro Lang wrote:
> > There is heavy overlap between _require_fs_sysfs and
> > _require_fs_sysfs_attr, and their ambiguous names make it difficult
> > to tell them apart.
> >
> > So merge them into a single function with "_dev_" included in the
> > name to distinguish per-device entries from other paths like
> > /sys/fs/$FSTYP/features/.
>
> I have a bit of a hard time understanding this message. From looking
> at the diff this seems to:
>
> - rename _has_fs_sysfs_attr to _has_fs_sysfs_dev_attr
> - rename _get_fs_sysfs_attr to _get_fs_sysfs_dev_attr
> - rename _set_fs_sysfs_attr to _set_fs_sysfs_dev_attr
> - rename _require_fs_sysfs_attr to _require_fs_sysfs_dev_attr
> - remove _require_fs_sysfs
And remove _has_fs_sysfs.
>
> right? Maybe spell that out and split the pure renames from code
> removal?
Sure, that makes sense. I will incorporate the rename into PATCH 2/5 in
the next revision.
Thanks,
Zorro
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] common/sysfs: adjust function naming
2026-09-15 6:57 ` Christoph Hellwig
@ 2026-09-15 14:46 ` Zorro Lang
0 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-09-15 14:46 UTC (permalink / raw)
To: Christoph Hellwig, Anand Suveer Jain
Cc: fstests, linux-xfs, linux-btrfs, Chao Yu
On Mon, Sep 14, 2026 at 11:57:41PM -0700, Christoph Hellwig wrote:
> On Tue, Sep 15, 2026 at 01:25:06AM +0800, Zorro Lang wrote:
> > Add the _dev_ infix to helper functions associated with
> > /sys/fs/$FSTYP/<devices> to distinguish them from upcoming
> > /sys/fs/$FSTYP/features/ related helpers.
>
> Should these even exist as separate helper? And if so they probably
> should have btrfs in the names?
Hmm... as far as I know, btrfs is the only filesystem that exposes this
"policy" concept under /sys/fs/$FSTYP/ (correct me if I'm wrong). I'm
not sure if this was intended to be a generic design; if not, it makes
sense to add the btrfs prefix and move it over to common/btrfs.
These helpers were originally introduced by Anand. *Anand*, what do you think?
If you agree that too, I can help to do that in next version.
Thanks,
Zorro
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-09-15 14:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 17:25 [PATCH 0/5] Refactor *_fs_sysfs_* helpers Zorro Lang
2026-09-14 17:25 ` [PATCH 1/5] fstests: consolidate _require_fs_sysfs and _require_fs_sysfs_attr Zorro Lang
2026-09-15 6:56 ` Christoph Hellwig
2026-09-15 14:33 ` Zorro Lang
2026-09-14 17:25 ` [PATCH 2/5] common/sysfs: adjust function naming Zorro Lang
2026-09-15 6:57 ` Christoph Hellwig
2026-09-15 14:46 ` Zorro Lang
2026-09-14 17:25 ` [PATCH 3/5] common/rc: add helpers for /sys/fs/$FSTYP/features/ Zorro Lang
2026-09-14 17:25 ` [PATCH 4/5] common/rc: use common helper in _require_fanotify_ioerrors for f2fs Zorro Lang
2026-09-14 17:25 ` [PATCH 5/5] fstests: replace btrfs specific helpers with common sysfs helpers Zorro Lang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.