diff mbox series

[4/4] generic/60[78]: ensure the initial DAX file flag state before test

Message ID 161472737624.3478298.18322455058303982173.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: various fixes | expand

Commit Message

Darrick J. Wong March 2, 2021, 11:22 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Since this test checks the behaviors of both the in-core S_DAX flag and
the ondisk FS_XFLAG_DAX inode flags, it must be careful about the
initial state of the filesystem w.r.t. the inode flag.

Make sure that the root directory does /not/ have the inode flag set
before we begin testing, so that the initial state doesn't throw off
inheritance testing.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/607 |    4 ++++
 tests/generic/608 |    3 +++
 2 files changed, 7 insertions(+)

Comments

Chandan Babu R March 5, 2021, 8:35 a.m. UTC | #1
On 03 Mar 2021 at 04:52, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Since this test checks the behaviors of both the in-core S_DAX flag and
> the ondisk FS_XFLAG_DAX inode flags, it must be careful about the
> initial state of the filesystem w.r.t. the inode flag.
>
> Make sure that the root directory does /not/ have the inode flag set
> before we begin testing, so that the initial state doesn't throw off
> inheritance testing.

If $MKFS_OPTIONS has daxinherit=1 option then this will cause all the inodes
created in the new filesystem to have the corresponding flag set. Hence the
patch is correct.

Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>

>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/generic/607 |    4 ++++
>  tests/generic/608 |    3 +++
>  2 files changed, 7 insertions(+)
>
>
> diff --git a/tests/generic/607 b/tests/generic/607
> index dd6dbd65..ba7da11b 100755
> --- a/tests/generic/607
> +++ b/tests/generic/607
> @@ -156,6 +156,10 @@ do_xflag_tests()
>  	local option=$1
>
>  	_scratch_mount "$option"
> +
> +	# Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
> +	chattr -x $SCRATCH_MNT &>> $seqres.full
> +
>  	cd $SCRATCH_MNT
>
>  	for i in $(seq 1 5); do
> diff --git a/tests/generic/608 b/tests/generic/608
> index dd89d91c..13a751d7 100755
> --- a/tests/generic/608
> +++ b/tests/generic/608
> @@ -98,6 +98,9 @@ do_tests()
>
>  	_scratch_mount "$mount_option"
>
> +	# Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
> +	chattr -x $SCRATCH_MNT &>> $seqres.full
> +
>  	test_drop_caches
>
>  	test_cycle_mount "$cycle_mount_option"


--
chandan
diff mbox series

Patch

diff --git a/tests/generic/607 b/tests/generic/607
index dd6dbd65..ba7da11b 100755
--- a/tests/generic/607
+++ b/tests/generic/607
@@ -156,6 +156,10 @@  do_xflag_tests()
 	local option=$1
 
 	_scratch_mount "$option"
+
+	# Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
+	chattr -x $SCRATCH_MNT &>> $seqres.full
+
 	cd $SCRATCH_MNT
 
 	for i in $(seq 1 5); do
diff --git a/tests/generic/608 b/tests/generic/608
index dd89d91c..13a751d7 100755
--- a/tests/generic/608
+++ b/tests/generic/608
@@ -98,6 +98,9 @@  do_tests()
 
 	_scratch_mount "$mount_option"
 
+	# Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
+	chattr -x $SCRATCH_MNT &>> $seqres.full
+
 	test_drop_caches
 
 	test_cycle_mount "$cycle_mount_option"