* [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-06 6:43 ` Chao Yu via Linux-f2fs-devel
0 siblings, 0 replies; 14+ messages in thread
From: Chao Yu @ 2026-07-06 6:43 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Chao Yu, Darrick J. Wong
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 <djwong@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
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
esac
_notrun "$FSTYP does not support fanotify ioerrors"
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-06 6:43 ` Chao Yu via Linux-f2fs-devel
0 siblings, 0 replies; 14+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-07-06 6:43 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: jaegeuk, Darrick J. Wong, linux-f2fs-devel
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 <djwong@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
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
esac
_notrun "$FSTYP does not support fanotify ioerrors"
--
2.49.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-06 6:43 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
@ 2026-07-07 10:13 ` Anand Suveer Jain
-1 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain via Linux-f2fs-devel @ 2026-07-07 10:13 UTC (permalink / raw)
To: Chao Yu, Zorro Lang, fstests; +Cc: jaegeuk, Darrick J. Wong, linux-f2fs-devel
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 <djwong@kernel.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> 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)
before reading it?
> esac
>
> _notrun "$FSTYP does not support fanotify ioerrors"
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-07 10:13 ` Anand Suveer Jain
0 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain @ 2026-07-07 10:13 UTC (permalink / raw)
To: Chao Yu, Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Darrick J. Wong
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 <djwong@kernel.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> 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)
before reading it?
> esac
>
> _notrun "$FSTYP does not support fanotify ioerrors"
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-07 10:13 ` Anand Suveer Jain
@ 2026-07-08 3:25 ` Chao Yu
-1 siblings, 0 replies; 14+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-07-08 3:25 UTC (permalink / raw)
To: Anand Suveer Jain, Zorro Lang, fstests
Cc: jaegeuk, Darrick J. Wong, linux-f2fs-devel
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 <djwong@kernel.org>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> 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"
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-08 3:25 ` Chao Yu
0 siblings, 0 replies; 14+ messages in thread
From: Chao Yu @ 2026-07-08 3:25 UTC (permalink / raw)
To: Anand Suveer Jain, Zorro Lang, fstests
Cc: chao, jaegeuk, linux-f2fs-devel, Darrick J. Wong
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 <djwong@kernel.org>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> 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"
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-08 3:25 ` Chao Yu
@ 2026-07-08 6:03 ` Anand Suveer Jain
-1 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain via Linux-f2fs-devel @ 2026-07-08 6:03 UTC (permalink / raw)
To: Chao Yu, Zorro Lang, fstests; +Cc: jaegeuk, Darrick J. Wong, linux-f2fs-devel
> 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
}
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-08 6:03 ` Anand Suveer Jain
0 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain @ 2026-07-08 6:03 UTC (permalink / raw)
To: Chao Yu, Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Darrick J. Wong
> 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
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-08 3:25 ` Chao Yu
@ 2026-07-17 10:47 ` Zorro Lang
-1 siblings, 0 replies; 14+ messages in thread
From: Zorro Lang via Linux-f2fs-devel @ 2026-07-17 10:47 UTC (permalink / raw)
To: Chao Yu
Cc: jaegeuk, linux-f2fs-devel, Darrick J. Wong, fstests,
Anand Suveer Jain
On Wed, Jul 08, 2026 at 11:25:37AM +0800, Chao Yu wrote:
> 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 <djwong@kernel.org>
> >> Signed-off-by: Chao Yu <chao@kernel.org>
> >> ---
> >> 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
Hi Chao and Anand,
The *_fs_sysfs related helpers were brought in by me in:
commit 2a7b77abcd1dde735186b363da24540706c43b73
Author: Zorro Lang <zlang@redhat.com>
Date: Tue Jul 5 17:30:24 2016 +0800
xfs: configurable behavior on errors at unmount time
At that time, I didn't think about the "features/" directory.
Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
family of functions shouldn't be restricted to the $dev directory,
we should remove this restriction.
Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
helpers which call *_fs_sysfs(). Also change the test cases who call these
functions.
Finally, we can introduce the *_fs_sysfs_features functions (or simply use
*_fs_sysfs directly).
Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
them is somewhat confusing and easy to mix up.
I need to write a series of patches to clean up these logic. For this current
patch, we can start with a small-scale change first. What do you think?
Thanks,
Zorro
>
>
> > 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"
> >
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-17 10:47 ` Zorro Lang
0 siblings, 0 replies; 14+ messages in thread
From: Zorro Lang @ 2026-07-17 10:47 UTC (permalink / raw)
To: Chao Yu
Cc: Anand Suveer Jain, fstests, jaegeuk, linux-f2fs-devel,
Darrick J. Wong
On Wed, Jul 08, 2026 at 11:25:37AM +0800, Chao Yu wrote:
> 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 <djwong@kernel.org>
> >> Signed-off-by: Chao Yu <chao@kernel.org>
> >> ---
> >> 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
Hi Chao and Anand,
The *_fs_sysfs related helpers were brought in by me in:
commit 2a7b77abcd1dde735186b363da24540706c43b73
Author: Zorro Lang <zlang@redhat.com>
Date: Tue Jul 5 17:30:24 2016 +0800
xfs: configurable behavior on errors at unmount time
At that time, I didn't think about the "features/" directory.
Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
family of functions shouldn't be restricted to the $dev directory,
we should remove this restriction.
Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
helpers which call *_fs_sysfs(). Also change the test cases who call these
functions.
Finally, we can introduce the *_fs_sysfs_features functions (or simply use
*_fs_sysfs directly).
Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
them is somewhat confusing and easy to mix up.
I need to write a series of patches to clean up these logic. For this current
patch, we can start with a small-scale change first. What do you think?
Thanks,
Zorro
>
>
> > 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"
> >
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-17 10:47 ` Zorro Lang
@ 2026-07-21 23:56 ` Anand Suveer Jain via Linux-f2fs-devel
-1 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain @ 2026-07-21 23:56 UTC (permalink / raw)
To: Zorro Lang; +Cc: Chao Yu, fstests, jaegeuk, Darrick J. Wong, linux-f2fs-devel
> Hi Chao and Anand,
>
> The *_fs_sysfs related helpers were brought in by me in:
> commit 2a7b77abcd1dde735186b363da24540706c43b73
> Author: Zorro Lang <zlang@redhat.com>
> Date: Tue Jul 5 17:30:24 2016 +0800
>
> xfs: configurable behavior on errors at unmount time
>
> At that time, I didn't think about the "features/" directory.
>
> Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
> family of functions shouldn't be restricted to the $dev directory,
> we should remove this restriction.
>
> Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
> helpers which call *_fs_sysfs(). Also change the test cases who call these
> functions.
>
> Finally, we can introduce the *_fs_sysfs_features functions (or simply use
> *_fs_sysfs directly).
>
> Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
> them is somewhat confusing and easy to mix up.
>
> I need to write a series of patches to clean up these logic. For this current
> patch, we can start with a small-scale change first. What do you think?
>
I noticed some duplicate code that needs cleanup.
Essentially, I think we can maintain two sysfs check helpers:
one that involves mounting the device, and
another for module-level feature checks.
Thanks for the help, Zorro.
Anand
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-21 23:56 ` Anand Suveer Jain via Linux-f2fs-devel
0 siblings, 0 replies; 14+ messages in thread
From: Anand Suveer Jain via Linux-f2fs-devel @ 2026-07-21 23:56 UTC (permalink / raw)
To: Zorro Lang; +Cc: jaegeuk, linux-f2fs-devel, fstests, Darrick J. Wong
> Hi Chao and Anand,
>
> The *_fs_sysfs related helpers were brought in by me in:
> commit 2a7b77abcd1dde735186b363da24540706c43b73
> Author: Zorro Lang <zlang@redhat.com>
> Date: Tue Jul 5 17:30:24 2016 +0800
>
> xfs: configurable behavior on errors at unmount time
>
> At that time, I didn't think about the "features/" directory.
>
> Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
> family of functions shouldn't be restricted to the $dev directory,
> we should remove this restriction.
>
> Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
> helpers which call *_fs_sysfs(). Also change the test cases who call these
> functions.
>
> Finally, we can introduce the *_fs_sysfs_features functions (or simply use
> *_fs_sysfs directly).
>
> Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
> them is somewhat confusing and easy to mix up.
>
> I need to write a series of patches to clean up these logic. For this current
> patch, we can start with a small-scale change first. What do you think?
>
I noticed some duplicate code that needs cleanup.
Essentially, I think we can maintain two sysfs check helpers:
one that involves mounting the device, and
another for module-level feature checks.
Thanks for the help, Zorro.
Anand
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
2026-07-17 10:47 ` Zorro Lang
@ 2026-07-23 9:09 ` Chao Yu
-1 siblings, 0 replies; 14+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-07-23 9:09 UTC (permalink / raw)
To: Zorro Lang
Cc: Darrick J. Wong, fstests, linux-f2fs-devel, Anand Suveer Jain,
jaegeuk
On 7/17/26 18:47, Zorro Lang wrote:
> On Wed, Jul 08, 2026 at 11:25:37AM +0800, Chao Yu wrote:
>> 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 <djwong@kernel.org>
>>>> Signed-off-by: Chao Yu <chao@kernel.org>
>>>> ---
>>>> 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
>
> Hi Chao and Anand,
>
> The *_fs_sysfs related helpers were brought in by me in:
> commit 2a7b77abcd1dde735186b363da24540706c43b73
> Author: Zorro Lang <zlang@redhat.com>
> Date: Tue Jul 5 17:30:24 2016 +0800
>
> xfs: configurable behavior on errors at unmount time
>
> At that time, I didn't think about the "features/" directory.
>
> Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
> family of functions shouldn't be restricted to the $dev directory,
> we should remove this restriction.
>
> Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
> helpers which call *_fs_sysfs(). Also change the test cases who call these
> functions.
>
> Finally, we can introduce the *_fs_sysfs_features functions (or simply use
> *_fs_sysfs directly).
>
> Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
> them is somewhat confusing and easy to mix up.
Zorro,
It makes sense, and good news to their user. Thanks for the proposal.
>
> I need to write a series of patches to clean up these logic. For this current
> patch, we can start with a small-scale change first. What do you think?
So I will use this first:
f2fs)
local feat_file="/sys/fs/f2fs/features/fserror"
if [ -f "$feat_file" ] && [ "$(cat "$feat_file")" = "supported" ]; then
return 0
fi
;;
And then waiting for your cleanup? or if you want to clean up this, please do it
directly while merging.
Thanks,
>
> Thanks,
> Zorro
>
>>
>>
>>> 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"
>>>
>>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()
@ 2026-07-23 9:09 ` Chao Yu
0 siblings, 0 replies; 14+ messages in thread
From: Chao Yu @ 2026-07-23 9:09 UTC (permalink / raw)
To: Zorro Lang
Cc: chao, Anand Suveer Jain, fstests, jaegeuk, linux-f2fs-devel,
Darrick J. Wong
On 7/17/26 18:47, Zorro Lang wrote:
> On Wed, Jul 08, 2026 at 11:25:37AM +0800, Chao Yu wrote:
>> 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 <djwong@kernel.org>
>>>> Signed-off-by: Chao Yu <chao@kernel.org>
>>>> ---
>>>> 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
>
> Hi Chao and Anand,
>
> The *_fs_sysfs related helpers were brought in by me in:
> commit 2a7b77abcd1dde735186b363da24540706c43b73
> Author: Zorro Lang <zlang@redhat.com>
> Date: Tue Jul 5 17:30:24 2016 +0800
>
> xfs: configurable behavior on errors at unmount time
>
> At that time, I didn't think about the "features/" directory.
>
> Now, let me rethink this set of helpers. I feel that the *_fs_sysfs
> family of functions shouldn't be restricted to the $dev directory,
> we should remove this restriction.
>
> Following that, we bring in *_fs_sysfs_device (appending the _device suffix)
> helpers which call *_fs_sysfs(). Also change the test cases who call these
> functions.
>
> Finally, we can introduce the *_fs_sysfs_features functions (or simply use
> *_fs_sysfs directly).
>
> Also, we have both *_fs_sysfs_attr and *_fs_sysfs, and the logic between
> them is somewhat confusing and easy to mix up.
Zorro,
It makes sense, and good news to their user. Thanks for the proposal.
>
> I need to write a series of patches to clean up these logic. For this current
> patch, we can start with a small-scale change first. What do you think?
So I will use this first:
f2fs)
local feat_file="/sys/fs/f2fs/features/fserror"
if [ -f "$feat_file" ] && [ "$(cat "$feat_file")" = "supported" ]; then
return 0
fi
;;
And then waiting for your cleanup? or if you want to clean up this, please do it
directly while merging.
Thanks,
>
> Thanks,
> Zorro
>
>>
>>
>>> 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"
>>>
>>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-07-23 9:09 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 6:43 [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors() Chao Yu
2026-07-06 6:43 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-07-07 10:13 ` Anand Suveer Jain via Linux-f2fs-devel
2026-07-07 10:13 ` Anand Suveer Jain
2026-07-08 3:25 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-07-08 3:25 ` Chao Yu
2026-07-08 6:03 ` [f2fs-dev] " Anand Suveer Jain via Linux-f2fs-devel
2026-07-08 6:03 ` Anand Suveer Jain
2026-07-17 10:47 ` [f2fs-dev] " Zorro Lang via Linux-f2fs-devel
2026-07-17 10:47 ` Zorro Lang
2026-07-21 23:56 ` Anand Suveer Jain
2026-07-21 23:56 ` [f2fs-dev] " Anand Suveer Jain via Linux-f2fs-devel
2026-07-23 9:09 ` Chao Yu via Linux-f2fs-devel
2026-07-23 9:09 ` Chao Yu
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.