diff mbox series

[v2,6/6] xfs/260: Move xfs/260 to generic

Message ID 20200617093204.20838-7-ice_yangxiao@163.com (mailing list archive)
State New, archived
Headers show
Series Make fstests support new behavior of DAX | expand

Commit Message

Xiao Yang June 17, 2020, 9:32 a.m. UTC
From: Xiao Yang <yangx.jy@cn.fujitsu.com>

Both ext4 and xfs support per-inode DAX flag now so move it to generic.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/{xfs/260 => generic/602} | 4 ++--
 tests/generic/602.out          | 2 ++
 tests/generic/group            | 1 +
 tests/xfs/260.out              | 2 --
 tests/xfs/group                | 1 -
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename tests/{xfs/260 => generic/602} (98%)
 create mode 100644 tests/generic/602.out
 delete mode 100644 tests/xfs/260.out

Comments

Ira Weiny June 17, 2020, 9:48 p.m. UTC | #1
On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> 
> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Unfortunately this test needs to be modified to work with the final agreed upon
method for switching DAX, patch below.  Feel free to squash it into this patch
for v3.

There are more checks I had queued up but I'm happy to wait for this series to
be applied.

Again, thanks for moving this along!
Ira

From 97b67a2773627cfe91b5f33a418ab646bb5fd0a8 Mon Sep 17 00:00:00 2001
From: Ira Weiny <ira.weiny@intel.com>
Date: Wed, 17 Jun 2020 14:34:45 -0700
Subject: [PATCH] generic/602: Modify to work with agreed inheritance of DAX flag

Modifying the DAX flag on flies does not take effect immediately.  The
easiest way to ensure the file state for this test is to use inheritance
of the parent directory DAX state.

Modify the test to use 2 directories which we can switch the DAX state on
and create the test files in those directories after setting the desired
state.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 tests/generic/602 | 81 +++++++++++++++++++++++++++++------------------
 1 file changed, 51 insertions(+), 30 deletions(-)

diff --git a/tests/generic/602 b/tests/generic/602
index 9137c5b9385f..20bf2c6bd246 100755
--- a/tests/generic/602
+++ b/tests/generic/602
@@ -36,68 +36,95 @@ _require_test_program "t_mmap_dio"
 _require_scratch_dax_iflag
 _require_xfs_io_command "falloc"
 
-prep_files()
+SRC_DIR=$SCRATCH_MNT/src
+SRC_FILE=$SRC_DIR/tf_s
+
+DST_DIR=$SCRATCH_MNT/dst
+DST_FILE=$DST_DIR/tf_d
+
+clean_files()
 {
-	rm -f $SCRATCH_MNT/tf_{s,d}
+	rm -f $SRC_FILE
+	rm -f $DST_FILE
 
+	mkdir -p $SRC_DIR
+	mkdir -p $DST_DIR
+}
+
+prep_files()
+{
+	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
+		$SRC_FILE >> $seqres.full 2>&1
 	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
-		$SCRATCH_MNT/tf_{s,d} >> $seqres.full 2>&1
+		$DST_FILE >> $seqres.full 2>&1
 }
 
 t_both_dax()
 {
+	clean_files
+	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr +x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
 	# with O_DIRECT first
-	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
+	$here/src/t_mmap_dio $SRC_FILE $DST_FILE $1 "dio both dax"
 
+	clean_files
+	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr +x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
 	# again with buffered IO
-	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
 		$1 "buffered both dax"
 }
 
 t_nondax_to_dax()
 {
+	clean_files
+	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr +x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
-	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
 		$1 "dio nondax to dax"
 
+	clean_files
+	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr +x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
-	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
 		$1 "buffered nondax to dax"
 }
 
 t_dax_to_nondax()
 {
+	clean_files
+	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr -x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
-	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
 		$1 "dio dax to nondax"
 
+	clean_files
+	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr -x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
-	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
 		$1 "buffered dax to nondax"
 }
 
 t_both_nondax()
 {
+	clean_files
+	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr -x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
-	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
 		$1 "dio both nondax"
 
+	clean_files
+	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
+	$XFS_IO_PROG -c "chattr -x" $DST_DIR
 	prep_files
-	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
-	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
+	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
 		$1 "buffered both nondax"
 }
 
@@ -124,17 +151,11 @@ do_tests()
 # make xfs aligned for PMD fault testing
 _scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
 
-# mount with dax option
-_scratch_mount "-o dax"
-
 tsize=$((128 * 1024 * 1024))
 
-do_tests
-_scratch_unmount
-
 # mount again without dax option
 export MOUNT_OPTIONS=""
-_scratch_mount
+_scratch_mount "-o dax=inode"
 do_tests
 
 # success, all done
Xiao Yang June 18, 2020, 3:35 p.m. UTC | #2
On 6/18/20 5:48 AM, Ira Weiny wrote:
> On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
>> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
>>
>> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
>>
>> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Unfortunately this test needs to be modified to work with the final agreed upon
> method for switching DAX, patch below.  Feel free to squash it into this patch
> for v3.
>
> There are more checks I had queued up but I'm happy to wait for this series to
> be applied.
>
> Again, thanks for moving this along!
> Ira
>
>  From 97b67a2773627cfe91b5f33a418ab646bb5fd0a8 Mon Sep 17 00:00:00 2001
> From: Ira Weiny <ira.weiny@intel.com>
> Date: Wed, 17 Jun 2020 14:34:45 -0700
> Subject: [PATCH] generic/602: Modify to work with agreed inheritance of DAX flag
>
> Modifying the DAX flag on flies does not take effect immediately.  The
> easiest way to ensure the file state for this test is to use inheritance
> of the parent directory DAX state.

Hi Ira,

Modifying the DAX flag on directories can take effect immediately, right?

>
> Modify the test to use 2 directories which we can switch the DAX state on
> and create the test files in those directories after setting the desired
> state.

Good addition, and I will squash it into this v3 patch. :-)

BTW:

I wait someone(Darrick, Eryu or others) to review the code about PMD 
fault testing in this patch set.

Best Regards,

Xiao Yang

>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
>   tests/generic/602 | 81 +++++++++++++++++++++++++++++------------------
>   1 file changed, 51 insertions(+), 30 deletions(-)
>
> diff --git a/tests/generic/602 b/tests/generic/602
> index 9137c5b9385f..20bf2c6bd246 100755
> --- a/tests/generic/602
> +++ b/tests/generic/602
> @@ -36,68 +36,95 @@ _require_test_program "t_mmap_dio"
>   _require_scratch_dax_iflag
>   _require_xfs_io_command "falloc"
>   
> -prep_files()
> +SRC_DIR=$SCRATCH_MNT/src
> +SRC_FILE=$SRC_DIR/tf_s
> +
> +DST_DIR=$SCRATCH_MNT/dst
> +DST_FILE=$DST_DIR/tf_d
> +
> +clean_files()
>   {
> -	rm -f $SCRATCH_MNT/tf_{s,d}
> +	rm -f $SRC_FILE
> +	rm -f $DST_FILE
>   
> +	mkdir -p $SRC_DIR
> +	mkdir -p $DST_DIR
> +}
> +
> +prep_files()
> +{
> +	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
> +		$SRC_FILE >> $seqres.full 2>&1
>   	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
> -		$SCRATCH_MNT/tf_{s,d} >> $seqres.full 2>&1
> +		$DST_FILE >> $seqres.full 2>&1
>   }
>   
>   t_both_dax()
>   {
> +	clean_files
> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
>   	# with O_DIRECT first
> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE $1 "dio both dax"
>   
> +	clean_files
> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
>   	# again with buffered IO
> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>   		$1 "buffered both dax"
>   }
>   
>   t_nondax_to_dax()
>   {
> +	clean_files
> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>   		$1 "dio nondax to dax"
>   
> +	clean_files
> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>   		$1 "buffered nondax to dax"
>   }
>   
>   t_dax_to_nondax()
>   {
> +	clean_files
> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>   		$1 "dio dax to nondax"
>   
> +	clean_files
> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>   		$1 "buffered dax to nondax"
>   }
>   
>   t_both_nondax()
>   {
> +	clean_files
> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>   		$1 "dio both nondax"
>   
> +	clean_files
> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>   	prep_files
> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>   		$1 "buffered both nondax"
>   }
>   
> @@ -124,17 +151,11 @@ do_tests()
>   # make xfs aligned for PMD fault testing
>   _scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
>   
> -# mount with dax option
> -_scratch_mount "-o dax"
> -
>   tsize=$((128 * 1024 * 1024))
>   
> -do_tests
> -_scratch_unmount
> -
>   # mount again without dax option
>   export MOUNT_OPTIONS=""
> -_scratch_mount
> +_scratch_mount "-o dax=inode"
>   do_tests
>   
>   # success, all done
Ira Weiny June 19, 2020, 3:15 p.m. UTC | #3
On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
> On 6/18/20 5:48 AM, Ira Weiny wrote:
> > On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
> > > From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> > > 
> > > Both ext4 and xfs support per-inode DAX flag now so move it to generic.
> > > 
> > > Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> > Unfortunately this test needs to be modified to work with the final agreed upon
> > method for switching DAX, patch below.  Feel free to squash it into this patch
> > for v3.
> > 
> > There are more checks I had queued up but I'm happy to wait for this series to
> > be applied.
> > 
> > Again, thanks for moving this along!
> > Ira
> > 
> >  From 97b67a2773627cfe91b5f33a418ab646bb5fd0a8 Mon Sep 17 00:00:00 2001
> > From: Ira Weiny <ira.weiny@intel.com>
> > Date: Wed, 17 Jun 2020 14:34:45 -0700
> > Subject: [PATCH] generic/602: Modify to work with agreed inheritance of DAX flag
> > 
> > Modifying the DAX flag on flies does not take effect immediately.  The
> > easiest way to ensure the file state for this test is to use inheritance
> > of the parent directory DAX state.
> 
> Hi Ira,
> 
> Modifying the DAX flag on directories can take effect immediately, right?

Yes and any file created under that directory will inherit the DAX flag
immediately.

> 
> > 
> > Modify the test to use 2 directories which we can switch the DAX state on
> > and create the test files in those directories after setting the desired
> > state.
> 
> Good addition, and I will squash it into this v3 patch. :-)
> 
> BTW:
> 
> I wait someone(Darrick, Eryu or others) to review the code about PMD fault
> testing in this patch set.

Yes, thanks.  I don't feel familiar enough with that code to review it.

Ira

> 
> Best Regards,
> 
> Xiao Yang
> 
> > 
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > ---
> >   tests/generic/602 | 81 +++++++++++++++++++++++++++++------------------
> >   1 file changed, 51 insertions(+), 30 deletions(-)
> > 
> > diff --git a/tests/generic/602 b/tests/generic/602
> > index 9137c5b9385f..20bf2c6bd246 100755
> > --- a/tests/generic/602
> > +++ b/tests/generic/602
> > @@ -36,68 +36,95 @@ _require_test_program "t_mmap_dio"
> >   _require_scratch_dax_iflag
> >   _require_xfs_io_command "falloc"
> > -prep_files()
> > +SRC_DIR=$SCRATCH_MNT/src
> > +SRC_FILE=$SRC_DIR/tf_s
> > +
> > +DST_DIR=$SCRATCH_MNT/dst
> > +DST_FILE=$DST_DIR/tf_d
> > +
> > +clean_files()
> >   {
> > -	rm -f $SCRATCH_MNT/tf_{s,d}
> > +	rm -f $SRC_FILE
> > +	rm -f $DST_FILE
> > +	mkdir -p $SRC_DIR
> > +	mkdir -p $DST_DIR
> > +}
> > +
> > +prep_files()
> > +{
> > +	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
> > +		$SRC_FILE >> $seqres.full 2>&1
> >   	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
> > -		$SCRATCH_MNT/tf_{s,d} >> $seqres.full 2>&1
> > +		$DST_FILE >> $seqres.full 2>&1
> >   }
> >   t_both_dax()
> >   {
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
> >   	# with O_DIRECT first
> > -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
> > +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE $1 "dio both dax"
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
> >   	# again with buffered IO
> > -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
> >   		$1 "buffered both dax"
> >   }
> >   t_nondax_to_dax()
> >   {
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
> > -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
> >   		$1 "dio nondax to dax"
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
> > -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
> >   		$1 "buffered nondax to dax"
> >   }
> >   t_dax_to_nondax()
> >   {
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
> > -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
> >   		$1 "dio dax to nondax"
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
> > -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
> >   		$1 "buffered dax to nondax"
> >   }
> >   t_both_nondax()
> >   {
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
> > -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
> >   		$1 "dio both nondax"
> > +	clean_files
> > +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
> > +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
> >   	prep_files
> > -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
> > -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
> > +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
> >   		$1 "buffered both nondax"
> >   }
> > @@ -124,17 +151,11 @@ do_tests()
> >   # make xfs aligned for PMD fault testing
> >   _scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
> > -# mount with dax option
> > -_scratch_mount "-o dax"
> > -
> >   tsize=$((128 * 1024 * 1024))
> > -do_tests
> > -_scratch_unmount
> > -
> >   # mount again without dax option
> >   export MOUNT_OPTIONS=""
> > -_scratch_mount
> > +_scratch_mount "-o dax=inode"
> >   do_tests
> >   # success, all done
>
Xiao Yang June 23, 2020, 8:51 a.m. UTC | #4
On 2020/6/19 23:15, Ira Weiny wrote:
> On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
>> On 6/18/20 5:48 AM, Ira Weiny wrote:
>>> On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
>>>> From: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>>>
>>>> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
>>>>
>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>> Unfortunately this test needs to be modified to work with the final agreed upon
>>> method for switching DAX, patch below.  Feel free to squash it into this patch
>>> for v3.
>>>
>>> There are more checks I had queued up but I'm happy to wait for this series to
>>> be applied.
>>>
>>> Again, thanks for moving this along!
>>> Ira
>>>
>>>   From 97b67a2773627cfe91b5f33a418ab646bb5fd0a8 Mon Sep 17 00:00:00 2001
>>> From: Ira Weiny<ira.weiny@intel.com>
>>> Date: Wed, 17 Jun 2020 14:34:45 -0700
>>> Subject: [PATCH] generic/602: Modify to work with agreed inheritance of DAX flag
>>>
>>> Modifying the DAX flag on flies does not take effect immediately.  The
>>> easiest way to ensure the file state for this test is to use inheritance
>>> of the parent directory DAX state.
>> Hi Ira,
>>
>> Modifying the DAX flag on directories can take effect immediately, right?
> Yes and any file created under that directory will inherit the DAX flag
> immediately.
>
>>> Modify the test to use 2 directories which we can switch the DAX state on
>>> and create the test files in those directories after setting the desired
>>> state.
>> Good addition, and I will squash it into this v3 patch. :-)
>>
>> BTW:
>>
>> I wait someone(Darrick, Eryu or others) to review the code about PMD fault
>> testing in this patch set.
> Yes, thanks.  I don't feel familiar enough with that code to review it.
>
> Ira
>
>> Best Regards,
>>
>> Xiao Yang
>>
>>> Signed-off-by: Ira Weiny<ira.weiny@intel.com>
>>> ---
>>>    tests/generic/602 | 81 +++++++++++++++++++++++++++++------------------
>>>    1 file changed, 51 insertions(+), 30 deletions(-)
>>>
>>> diff --git a/tests/generic/602 b/tests/generic/602
>>> index 9137c5b9385f..20bf2c6bd246 100755
>>> --- a/tests/generic/602
>>> +++ b/tests/generic/602
>>> @@ -36,68 +36,95 @@ _require_test_program "t_mmap_dio"
>>>    _require_scratch_dax_iflag
>>>    _require_xfs_io_command "falloc"
>>> -prep_files()
>>> +SRC_DIR=$SCRATCH_MNT/src
>>> +SRC_FILE=$SRC_DIR/tf_s
>>> +
>>> +DST_DIR=$SCRATCH_MNT/dst
>>> +DST_FILE=$DST_DIR/tf_d
>>> +
>>> +clean_files()
>>>    {
>>> -	rm -f $SCRATCH_MNT/tf_{s,d}
>>> +	rm -f $SRC_FILE
>>> +	rm -f $DST_FILE
>>> +	mkdir -p $SRC_DIR
>>> +	mkdir -p $DST_DIR
>>> +}
>>> +
>>> +prep_files()
>>> +{
>>> +	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
>>> +		$SRC_FILE>>  $seqres.full 2>&1
>>>    	$XFS_IO_PROG -f -c "falloc 0 $tsize" \
>>> -		$SCRATCH_MNT/tf_{s,d}>>  $seqres.full 2>&1
>>> +		$DST_FILE>>  $seqres.full 2>&1
>>>    }
>>>    t_both_dax()
>>>    {
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
>>>    	# with O_DIRECT first
>>> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
>>> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE $1 "dio both dax"
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_{s,d}
>>>    	# again with buffered IO
>>> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>>>    		$1 "buffered both dax"
>>>    }
>>>    t_nondax_to_dax()
>>>    {
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
>>> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>>>    		$1 "dio nondax to dax"
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr +x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_s
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_d
>>> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>>>    		$1 "buffered nondax to dax"
>>>    }
>>>    t_dax_to_nondax()
>>>    {
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
>>> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>>>    		$1 "dio dax to nondax"
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr +x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr +x" $SCRATCH_MNT/tf_s
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_d
>>> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>>>    		$1 "buffered dax to nondax"
>>>    }
>>>    t_both_nondax()
>>>    {
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
>>> -	$here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio $SRC_FILE $DST_FILE \
>>>    		$1 "dio both nondax"
>>> +	clean_files
>>> +	$XFS_IO_PROG -c "chattr -x" $SRC_DIR
>>> +	$XFS_IO_PROG -c "chattr -x" $DST_DIR
>>>    	prep_files
>>> -	$XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT/tf_{s,d}
>>> -	$here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
>>> +	$here/src/t_mmap_dio -b $SRC_FILE $DST_FILE \
>>>    		$1 "buffered both nondax"
>>>    }
>>> @@ -124,17 +151,11 @@ do_tests()
>>>    # make xfs aligned for PMD fault testing
>>>    _scratch_mkfs_geom $(_get_hugepagesize) 1>>  $seqres.full 2>&1
>>> -# mount with dax option
>>> -_scratch_mount "-o dax"
>>> -
Hi Ira,

Why do you want to remove this combination(i.e. test per-inode DAX flag 
under mounting with dax option) ?
Is it because mounting with dax option ignore FS_XFLAG_DAX flag?
I think it is a reasonable combination. :-)

>>>    tsize=$((128 * 1024 * 1024))
>>> -do_tests
>>> -_scratch_unmount
>>> -
>>>    # mount again without dax option
>>>    export MOUNT_OPTIONS=""
>>> -_scratch_mount
>>> +_scratch_mount "-o dax=inode"
>>>    do_tests
>>>    # success, all done

Could we keep _scratch_mount without dax so that this test can run on 
both old and new kernel?
See the following reasons:
1) FS_XFLAG_DAX was introduced by commit 58f88ca("xfs: introduce 
per-inode DAX enablement") since 2017.
2) _scratch_mount with dax=inode is equal to _scratch_mount without dax.

Best Regards,
Xiao Yang
>
> .
>
Ira Weiny June 23, 2020, 6:08 p.m. UTC | #5
On Tue, Jun 23, 2020 at 04:51:31PM +0800, Xiao Yang wrote:
> On 2020/6/19 23:15, Ira Weiny wrote:
> > On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
> > > On 6/18/20 5:48 AM, Ira Weiny wrote:
> > > > On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
> > > > > From: Xiao Yang<yangx.jy@cn.fujitsu.com>

[snip]

> > > >    }
> > > > @@ -124,17 +151,11 @@ do_tests()
> > > >    # make xfs aligned for PMD fault testing
> > > >    _scratch_mkfs_geom $(_get_hugepagesize) 1>>  $seqres.full 2>&1
> > > > -# mount with dax option
> > > > -_scratch_mount "-o dax"
> > > > -
> Hi Ira,
> 
> Why do you want to remove this combination(i.e. test per-inode DAX flag
> under mounting with dax option) ?
> Is it because mounting with dax option ignore FS_XFLAG_DAX flag?
> I think it is a reasonable combination. :-)

Yes running with the DAX mount option really does not test anything IMO.

> 
> > > >    tsize=$((128 * 1024 * 1024))
> > > > -do_tests
> > > > -_scratch_unmount
> > > > -
> > > >    # mount again without dax option
> > > >    export MOUNT_OPTIONS=""
> > > > -_scratch_mount
> > > > +_scratch_mount "-o dax=inode"
> > > >    do_tests
> > > >    # success, all done
> 
> Could we keep _scratch_mount without dax so that this test can run on both
> old and new kernel?
> See the following reasons:
> 1) FS_XFLAG_DAX was introduced by commit 58f88ca("xfs: introduce per-inode
> DAX enablement") since 2017.
> 2) _scratch_mount with dax=inode is equal to _scratch_mount without dax.

I suppose that would be ok.  But being generic what happens when this runs on
FS's which don't have the FS_XFLAG_DAX flag?  is it ignored?

FWIW I believe that any FS (which includes older kernels) which do not support
dax=inode have no need for this test to run.  The use of FS_XFLAG_DAX on older
xfs does not do anything and simply does not exist elsewhere.  Only FS's which
support dax=inode have behavior which needs to be tested IMO.

Ira

> 
> Best Regards,
> Xiao Yang
> > 
> > .
> > 
> 
> 
>
Xiao Yang June 30, 2020, 7:08 a.m. UTC | #6
On 2020/6/24 2:08, Ira Weiny wrote:
> On Tue, Jun 23, 2020 at 04:51:31PM +0800, Xiao Yang wrote:
>> On 2020/6/19 23:15, Ira Weiny wrote:
>>> On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
>>>> On 6/18/20 5:48 AM, Ira Weiny wrote:
>>>>> On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
>>>>>> From: Xiao Yang<yangx.jy@cn.fujitsu.com>
> [snip]
>
>>>>>     }
>>>>> @@ -124,17 +151,11 @@ do_tests()
>>>>>     # make xfs aligned for PMD fault testing
>>>>>     _scratch_mkfs_geom $(_get_hugepagesize) 1>>   $seqres.full 2>&1
>>>>> -# mount with dax option
>>>>> -_scratch_mount "-o dax"
>>>>> -
>> Hi Ira,
>>
>> Why do you want to remove this combination(i.e. test per-inode DAX flag
>> under mounting with dax option) ?
>> Is it because mounting with dax option ignore FS_XFLAG_DAX flag?
>> I think it is a reasonable combination. :-)
> Yes running with the DAX mount option really does not test anything IMO.
Hi Ira,

Sorry for the late reply because I was busy with other tasks last week. :-)

After reading related code, setting/clearing FS_XFLAG_DAX have no chance 
to change S_DAX
flag if mount with dax option, so I will remove this combination in v3 
patch.

>>>>>     tsize=$((128 * 1024 * 1024))
>>>>> -do_tests
>>>>> -_scratch_unmount
>>>>> -
>>>>>     # mount again without dax option
>>>>>     export MOUNT_OPTIONS=""
>>>>> -_scratch_mount
>>>>> +_scratch_mount "-o dax=inode"
>>>>>     do_tests
>>>>>     # success, all done
>> Could we keep _scratch_mount without dax so that this test can run on both
>> old and new kernel?
>> See the following reasons:
>> 1) FS_XFLAG_DAX was introduced by commit 58f88ca("xfs: introduce per-inode
>> DAX enablement") since 2017.
>> 2) _scratch_mount with dax=inode is equal to _scratch_mount without dax.
> I suppose that would be ok.  But being generic what happens when this runs on
> FS's which don't have the FS_XFLAG_DAX flag?  is it ignored?

Test will report notrun by _require_scratch_dax_iflag() If fs doesn't 
support FS_XFLAG_DAX flag.

> FWIW I believe that any FS (which includes older kernels) which do not support
> dax=inode have no need for this test to run.  The use of FS_XFLAG_DAX on older
> xfs does not do anything and simply does not exist elsewhere.  Only FS's which
> support dax=inode have behavior which needs to be tested IMO.

I just want to test FS_XFLAG_DAX on older xfs by keeping _scratch_mount 
without dax because
the original test(i.e. xfs/260) is designed to test this point. :-)

BTW:  It seems that older xfs can do dax mmap by setting/clearing  
FS_XFLAG_DAX, or do I miss something?

Best Regards,
Xiao Yang
> Ira
>
>> Best Regards,
>> Xiao Yang
>>> .
>>>
>>
> .
>
Ira Weiny June 30, 2020, 3:50 p.m. UTC | #7
On Tue, Jun 30, 2020 at 03:08:50PM +0800, Xiao Yang wrote:
> On 2020/6/24 2:08, Ira Weiny wrote:
> > On Tue, Jun 23, 2020 at 04:51:31PM +0800, Xiao Yang wrote:
> > > On 2020/6/19 23:15, Ira Weiny wrote:
> > > > On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
> > > > > On 6/18/20 5:48 AM, Ira Weiny wrote:
> > > > > > On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
> > > > > > > From: Xiao Yang<yangx.jy@cn.fujitsu.com>
> > [snip]
> > 
> > > > > >     }
> > > > > > @@ -124,17 +151,11 @@ do_tests()
> > > > > >     # make xfs aligned for PMD fault testing
> > > > > >     _scratch_mkfs_geom $(_get_hugepagesize) 1>>   $seqres.full 2>&1
> > > > > > -# mount with dax option
> > > > > > -_scratch_mount "-o dax"
> > > > > > -
> > > Hi Ira,
> > > 
> > > Why do you want to remove this combination(i.e. test per-inode DAX flag
> > > under mounting with dax option) ?
> > > Is it because mounting with dax option ignore FS_XFLAG_DAX flag?
> > > I think it is a reasonable combination. :-)
> > Yes running with the DAX mount option really does not test anything IMO.
> Hi Ira,
> 
> Sorry for the late reply because I was busy with other tasks last week. :-)
> 
> After reading related code, setting/clearing FS_XFLAG_DAX have no chance to
> change S_DAX
> flag if mount with dax option, so I will remove this combination in v3
> patch.
> 
> > > > > >     tsize=$((128 * 1024 * 1024))
> > > > > > -do_tests
> > > > > > -_scratch_unmount
> > > > > > -
> > > > > >     # mount again without dax option
> > > > > >     export MOUNT_OPTIONS=""
> > > > > > -_scratch_mount
> > > > > > +_scratch_mount "-o dax=inode"
> > > > > >     do_tests
> > > > > >     # success, all done
> > > Could we keep _scratch_mount without dax so that this test can run on both
> > > old and new kernel?
> > > See the following reasons:
> > > 1) FS_XFLAG_DAX was introduced by commit 58f88ca("xfs: introduce per-inode
> > > DAX enablement") since 2017.
> > > 2) _scratch_mount with dax=inode is equal to _scratch_mount without dax.
> > I suppose that would be ok.  But being generic what happens when this runs on
> > FS's which don't have the FS_XFLAG_DAX flag?  is it ignored?
> 
> Test will report notrun by _require_scratch_dax_iflag() If fs doesn't
> support FS_XFLAG_DAX flag.
> 
> > FWIW I believe that any FS (which includes older kernels) which do not support
> > dax=inode have no need for this test to run.  The use of FS_XFLAG_DAX on older
> > xfs does not do anything and simply does not exist elsewhere.  Only FS's which
> > support dax=inode have behavior which needs to be tested IMO.
> 
> I just want to test FS_XFLAG_DAX on older xfs by keeping _scratch_mount
> without dax because
> the original test(i.e. xfs/260) is designed to test this point. :-)

Sure you can test swapping the flag itself but it really does nothing.

> 
> BTW:  It seems that older xfs can do dax mmap by setting/clearing
> FS_XFLAG_DAX, or do I miss something?

No it can only use DAX with '-o dax' mount option.  Changing FS_XFLAG_DAX on
xfs prior to 5.8 is effectively a no-op as the S_DAX flag would not be set.

See "742d84290739 xfs: disable per-inode DAX flag"

Ira

> 
> Best Regards,
> Xiao Yang
> > Ira
> > 
> > > Best Regards,
> > > Xiao Yang
> > > > .
> > > > 
> > > 
> > .
> > 
> 
> 
>
Xiao Yang July 1, 2020, 1:07 a.m. UTC | #8
On 2020/6/30 23:50, Ira Weiny wrote:
> On Tue, Jun 30, 2020 at 03:08:50PM +0800, Xiao Yang wrote:
>> On 2020/6/24 2:08, Ira Weiny wrote:
>>> On Tue, Jun 23, 2020 at 04:51:31PM +0800, Xiao Yang wrote:
>>>> On 2020/6/19 23:15, Ira Weiny wrote:
>>>>> On Thu, Jun 18, 2020 at 11:35:56PM +0800, Xiao Yang wrote:
>>>>>> On 6/18/20 5:48 AM, Ira Weiny wrote:
>>>>>>> On Wed, Jun 17, 2020 at 05:32:04PM +0800, Xiao Yang wrote:
>>>>>>>> From: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>> [snip]
>>>
>>>>>>>      }
>>>>>>> @@ -124,17 +151,11 @@ do_tests()
>>>>>>>      # make xfs aligned for PMD fault testing
>>>>>>>      _scratch_mkfs_geom $(_get_hugepagesize) 1>>    $seqres.full 2>&1
>>>>>>> -# mount with dax option
>>>>>>> -_scratch_mount "-o dax"
>>>>>>> -
>>>> Hi Ira,
>>>>
>>>> Why do you want to remove this combination(i.e. test per-inode DAX flag
>>>> under mounting with dax option) ?
>>>> Is it because mounting with dax option ignore FS_XFLAG_DAX flag?
>>>> I think it is a reasonable combination. :-)
>>> Yes running with the DAX mount option really does not test anything IMO.
>> Hi Ira,
>>
>> Sorry for the late reply because I was busy with other tasks last week. :-)
>>
>> After reading related code, setting/clearing FS_XFLAG_DAX have no chance to
>> change S_DAX
>> flag if mount with dax option, so I will remove this combination in v3
>> patch.
>>
>>>>>>>      tsize=$((128 * 1024 * 1024))
>>>>>>> -do_tests
>>>>>>> -_scratch_unmount
>>>>>>> -
>>>>>>>      # mount again without dax option
>>>>>>>      export MOUNT_OPTIONS=""
>>>>>>> -_scratch_mount
>>>>>>> +_scratch_mount "-o dax=inode"
>>>>>>>      do_tests
>>>>>>>      # success, all done
>>>> Could we keep _scratch_mount without dax so that this test can run on both
>>>> old and new kernel?
>>>> See the following reasons:
>>>> 1) FS_XFLAG_DAX was introduced by commit 58f88ca("xfs: introduce per-inode
>>>> DAX enablement") since 2017.
>>>> 2) _scratch_mount with dax=inode is equal to _scratch_mount without dax.
>>> I suppose that would be ok.  But being generic what happens when this runs on
>>> FS's which don't have the FS_XFLAG_DAX flag?  is it ignored?
>> Test will report notrun by _require_scratch_dax_iflag() If fs doesn't
>> support FS_XFLAG_DAX flag.
>>
>>> FWIW I believe that any FS (which includes older kernels) which do not support
>>> dax=inode have no need for this test to run.  The use of FS_XFLAG_DAX on older
>>> xfs does not do anything and simply does not exist elsewhere.  Only FS's which
>>> support dax=inode have behavior which needs to be tested IMO.
>> I just want to test FS_XFLAG_DAX on older xfs by keeping _scratch_mount
>> without dax because
>> the original test(i.e. xfs/260) is designed to test this point. :-)
> Sure you can test swapping the flag itself but it really does nothing.
>
>> BTW:  It seems that older xfs can do dax mmap by setting/clearing
>> FS_XFLAG_DAX, or do I miss something?
> No it can only use DAX with '-o dax' mount option.  Changing FS_XFLAG_DAX on
> xfs prior to 5.8 is effectively a no-op as the S_DAX flag would not be set.
>
> See "742d84290739 xfs: disable per-inode DAX flag"
Hi Ira,

Ah, I actually missed the marco disabling per-inode DAX flag.
OK, I will use dax=inode directly in v4 patch.

Best Regards,
Xiao Yang
> Ira
>
>> Best Regards,
>> Xiao Yang
>>> Ira
>>>
>>>> Best Regards,
>>>> Xiao Yang
>>>>> .
>>>>>
>>> .
>>>
>>
>>
>
> .
>
diff mbox series

Patch

diff --git a/tests/xfs/260 b/tests/generic/602
similarity index 98%
rename from tests/xfs/260
rename to tests/generic/602
index 7afc20f1..9137c5b9 100755
--- a/tests/xfs/260
+++ b/tests/generic/602
@@ -2,7 +2,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
 #
-# FS QA Test 260
+# FS QA Test 602
 #
 # Test per-inode DAX flag by mmap direct/buffered IO.
 #
@@ -28,7 +28,7 @@  _cleanup()
 # remove previous $seqres.full before test
 rm -f $seqres.full
 
-_supported_fs xfs
+_supported_fs generic
 _supported_os Linux
 _require_scratch_dax_mountopt "dax"
 _require_test_program "feature"
diff --git a/tests/generic/602.out b/tests/generic/602.out
new file mode 100644
index 00000000..61976e5e
--- /dev/null
+++ b/tests/generic/602.out
@@ -0,0 +1,2 @@ 
+QA output created by 602
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index c6ce029c..4bda3772 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -604,3 +604,4 @@ 
 599 auto quick remount shutdown
 600 auto quick quota
 601 auto quick quota
+602 auto attr quick dax
diff --git a/tests/xfs/260.out b/tests/xfs/260.out
deleted file mode 100644
index 18ca517c..00000000
--- a/tests/xfs/260.out
+++ /dev/null
@@ -1,2 +0,0 @@ 
-QA output created by 260
-Silence is golden
diff --git a/tests/xfs/group b/tests/xfs/group
index daf54add..71c30898 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -257,7 +257,6 @@ 
 257 auto quick clone
 258 auto quick clone
 259 auto quick
-260 auto attr quick dax
 261 auto quick quota
 262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
 263 auto quick quota