Skip to contentSkip to conversation

common/rc: support f2fs in _require_fanotify_ioerrors()

PATCH Superseded Chao Yu 3 participants 12 messages Jul 6 – Jul 29

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH v2 1/1 common/rc: support f2fs in _require_fanotify_ioerrors()

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 494725547..f51ad59f3 100644
@@ -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"
Signature · 1 line
2.49.0
#1 lore raw
Quoted 14 lines · Chao Yu

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644

common/rc _require_fanotify_ioerrors() · line 6264

Quoted 8 lines
common/rc +3 -0
@@ -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?

Quoted 3 lines
common/rc +0 -0
 	esac

_notrun "$FSTYP does not support fanotify ioerrors"

author
#2 lore raw
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
 		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
 		test -n "$x" && return 0
 		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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
Quoted 1 line

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
    ;;
Quoted 7 lines
Quoted 6 lines
common/rc +0 -0
 	esac
 
 	_notrun "$FSTYP does not support fanotify ioerrors"
#3 lore raw
Quoted 10 lines

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
}
#4 lore raw
In reply to Chao Yu
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
 		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
 		test -n "$x" && return 0
 		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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

Quoted 21 lines
Quoted 3 lines

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
    ;;
Quoted 7 lines
Quoted 6 lines
common/rc +0 -0
 	esac
 
 	_notrun "$FSTYP does not support fanotify ioerrors"
#5 lore raw
Quoted 20 lines

Hi Chao and Anand,

The *_fs_sysfs related helpers were brought in by me in:
commit 2a7b77abcd1dde735186b363da24540706c43b73
Author: Zorro Lang <[email protected]>
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.

Quoted 9 lines

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

#6 lore raw
Quoted 26 lines · Anand Suveer Jain
Quoted 26 lines

Hi Chao and Anand,

The *_fs_sysfs related helpers were brought in by me in:
commit 2a7b77abcd1dde735186b363da24540706c43b73
Author: Zorro Lang <[email protected]>
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.

Quoted 7 lines
Quoted 3 lines

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.

How about:

- *_fs_sysfs()
|

+--> *_fs_sysfs_device()
|

`--> *_fs_sysfs_feature()

I also need to clean up and unify _fs_sysfs() and _fs_sysfs_attr() .

Thanks,
Zorro

Quoted 4 lines

Thanks for the help, Zorro.

Anand

author
#7 lore raw
In reply to Zorro Lang
Quoted 57 lines · Zorro Lang
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
 		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
 		test -n "$x" && return 0
 		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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.

Quoted 5 lines

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.

Quoted 3 lines

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,

Quoted 25 lines

Thanks,
Zorro

Quoted 21 lines
Quoted 3 lines

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
    ;;
Quoted 7 lines
Quoted 6 lines
common/rc +0 -0
 	esac
 
 	_notrun "$FSTYP does not support fanotify ioerrors"
#8 lore raw
Quoted 75 lines · Chao Yu
Quoted 57 lines · Zorro Lang
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
 		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
 		test -n "$x" && return 0
 		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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.

Quoted 5 lines

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.

Quoted 3 lines

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)

Quoted 8 lines
    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.

If f2fs wants to test this feature right away, I can merge your patch now and clean it up later. If it's not urgent, I'll take care of it all together.

Thanks,
Zorro

Quoted 30 lines

Thanks,

Quoted 25 lines

Thanks,
Zorro

Quoted 21 lines
Quoted 3 lines

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
    ;;
Quoted 7 lines
Quoted 6 lines
common/rc +0 -0
 	esac
 
 	_notrun "$FSTYP does not support fanotify ioerrors"
author
#9 lore raw
Quoted 82 lines · Zorro Lang
Quoted 81 lines · Chao Yu
Quoted 57 lines · Zorro Lang
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
  common/rc | 3 +++
  1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
  		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
  		test -n "$x" && return 0
  		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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.

Quoted 5 lines

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.

Quoted 3 lines

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
     ;;
Quoted 5 lines
Quoted 2 lines

And then waiting for your cleanup? or if you want to clean up this, please do it directly while merging.

If f2fs wants to test this feature right away, I can merge your patch now and clean it up later. If it's not urgent, I'll take care of it all together.

Zorro,

Could you please help to merge it first? so that we can test 791 w/ last upstream code, and also in case we missed to track its status to lose it. :P

Thanks,

Quoted 34 lines

Thanks,
Zorro

Quoted 30 lines

Thanks,

Quoted 25 lines

Thanks,
Zorro

Quoted 21 lines
Quoted 3 lines

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
     ;;
Quoted 7 lines
Quoted 6 lines
common/rc +0 -0
  	esac
 
  	_notrun "$FSTYP does not support fanotify ioerrors"
#10 lore raw
Quoted 86 lines · Chao Yu
Quoted 85 lines · Zorro Lang
Quoted 83 lines · Chao Yu
Quoted 57 lines · Zorro Lang
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
  common/rc | 3 +++
  1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
  		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
  		test -n "$x" && return 0
  		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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.

Quoted 5 lines

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.

Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

If f2fs wants to test this feature right away, I can merge your patch now and clean it up later. If it's not urgent, I'll take care of it all together.

Zorro,

Could you please help to merge it first? so that we can test 791 w/ last upstream code, and also in case we missed to track its status to lose it. :P

Sure, I'm good to have this first. Could you send a new patch version, if you'd like to change it?

Thanks,
Zorro

Quoted 37 lines

Thanks,

Quoted 33 lines

Thanks,
Zorro

Quoted 29 lines

Thanks,

Quoted 24 lines

Thanks,
Zorro

Quoted 20 lines
Quoted 3 lines

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
     ;;
Quoted 6 lines
Quoted 5 lines
common/rc +0 -0
  	esac
  	_notrun "$FSTYP does not support fanotify ioerrors"
author
#11 lore raw
Quoted 90 lines · Zorro Lang
Quoted 89 lines · Chao Yu
Quoted 87 lines · Zorro Lang
Quoted 75 lines · Chao Yu
Quoted 57 lines · Zorro Lang
Quoted 28 lines · Chao Yu
Quoted 20 lines · Anand Suveer Jain
Quoted 17 lines · Chao Yu

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]>
---
  common/rc | 3 +++
  1 file changed, 3 insertions(+)
common/rc +0 -0
index 494725547..f51ad59f3 100644
@@ -6257,6 +6257,9 @@ _require_fanotify_ioerrors()
  		x="$(_get_fs_sysfs_attr $TEST_DEV err_report_sec)"
  		test -n "$x" && return 0
  		;;
Quoted 6 lines

common/rc _require_fanotify_ioerrors() · line 6262

Quoted 3 lines
common/rc +3 -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)

Quoted 8 lines

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 <[email protected]>
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.

Quoted 5 lines

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.

Quoted 3 lines

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)

Quoted 8 lines
     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.

If f2fs wants to test this feature right away, I can merge your patch now and clean it up later. If it's not urgent, I'll take care of it all together.

Quoted 7 lines
Quoted 4 lines

Zorro,

Could you please help to merge it first? so that we can test 791 w/ last upstream code, and also in case we missed to track its status to lose it. :P

Sure, I'm good to have this first. Could you send a new patch version, if you'd like to change it?

Have sent v3, please take a look. :)

Thanks,

Quoted 41 lines

Thanks,
Zorro

Quoted 37 lines

Thanks,

Quoted 33 lines

Thanks,
Zorro

Quoted 29 lines

Thanks,

Quoted 24 lines

Thanks,
Zorro

Quoted 20 lines
Quoted 3 lines

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
     ;;
Quoted 6 lines
Quoted 5 lines
common/rc +0 -0
  	esac
  	_notrun "$FSTYP does not support fanotify ioerrors"