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

Chao Yu <[email protected]> Wed, 8 Jul 2026 11:25:37 +0800
Newsgroups org.kernel.vger.fstests,net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>
On 7/7/26 18:13, Anand Suveer Jain wrote:
> On 6/7/26 14:43, Chao Yu wrote:
>> f2fs has supported to report fserror, this patch adds support for f2fs
>> in _require_fanotify_ioerrors(), so that we can run generic/791 on f2fs.
>>
>> Cc: Darrick J. Wong <[email protected]>
>> Signed-off-by: Chao Yu <[email protected]>
>> ---
>>  common/rc | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/common/rc b/common/rc
>> index 494725547..f51ad59f3 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
>>  		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
>>  		test -n "$x" && return 0
>>  		;;
> 
> 
>> +	f2fs)
>> +		x="$(cat /sys/fs/f2fs/features/fserror)"
>> +		test -n "$x" && return 0
> 
> Don't we need to check if /sys/fs/f2fs/features/fserror
> is present in the running kernel (there are helpers)

Hi Anand,

You mean _has_fs_sysfs_attr()? however, it forces to check first parameter $dev
w/ block device type:

	if [ ! -b "$dev" -o -z "$attr" ];then
		_fail "Usage: _has_fs_sysfs_attr <mounted_device> <attr>"
	fi


> before reading it?

How about this?

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

> 
> 
> 
>>  	esac
>>  
>>  	_notrun "$FSTYP does not support fanotify ioerrors"
>