Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()

Anand Suveer Jain <[email protected]> Wed, 8 Jul 2026 14:03:50 +0800
Newsgroups org.kernel.vger.fstests,net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>

> How about this?
> 
> f2fs)
>     local feat_file="/sys/fs/f2fs/features/fserror"
>     if [ -f "$feat_file" ] && [ "$(cat "$feat_file")" = "supported" ]; then
>         return 0
>     fi
>     ;;


This is a check we will use often.
Why not add a helper like the untested code below [1]?
Furthermore, I can clean up _require_btrfs_fs_feature()
to use [1] as well.


[1]
common/rc:

_require_fs_feature_attr()
{
	local feat="$1"
	local attr="$2"

	modprobe $FSTYP > /dev/null 2>&1

	[ -e /sys/fs/$FSTYP/features/$feat ] || \
		_notrun "Feature $feat not supported on $FSTYP"

	if [ -n "$attr" ]; then
		if ! grep -qw "$attr" /sys/fs/$FSTYP/features/$feat; then
			_notrun "Feature $feat attribute $attr missing"
		fi
	fi
}