FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/6] Make fstests support new behavior of DAX
@ 2020-06-17  9:31 Xiao Yang
  2020-06-17  9:31 ` [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Xiao Yang
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:31 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

The new behavior of DAX on xfs/ext4 has been merged into main kernel
tree/ext4-dax branch so it is time for fstests to support new behavior
of DAX.

References:
https://lkml.org/lkml/2019/10/20/96
https://lkml.org/lkml/2020/5/28/949

Xiao Yang (6):
  common/rc: Introduce new helpers for DAX mount options and
    FS_XFLAG_DAX
  fstests: Use _require_scratch_dax_mountopt() and
    _require_scratch_dax_iflag()
  common/rc: Remove unused _require_scratch_dax()
  generic/223: Don't clear all mkfs options for _scratch_mkfs_geom()
    roughly
  generic/413, xfs/260: Improve format operation for PMD fault testing
  xfs/260: Move xfs/260 to generic

 common/rc                      | 57 +++++++++++++++++++++++++++++-----
 tests/ext4/030                 |  2 +-
 tests/ext4/031                 |  4 +--
 tests/generic/223              |  1 -
 tests/generic/413              | 12 ++-----
 tests/generic/462              |  2 +-
 tests/{xfs/260 => generic/602} | 12 +++----
 tests/generic/602.out          |  2 ++
 tests/generic/group            |  1 +
 tests/xfs/260.out              |  2 --
 tests/xfs/group                |  1 -
 11 files changed, 65 insertions(+), 31 deletions(-)
 rename tests/{xfs/260 => generic/602} (93%)
 create mode 100644 tests/generic/602.out
 delete mode 100644 tests/xfs/260.out

-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
@ 2020-06-17  9:31 ` Xiao Yang
  2020-06-17 20:58   ` Ira Weiny
  2020-06-17  9:32 ` [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag() Xiao Yang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:31 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

1) _require_scratch_dax_mountopt() checks both old and new DAX mount option
2) _require_scratch_dax_iflag() checks FS_XFLAG_DAX

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/common/rc b/common/rc
index a6967831..ec7c19e4 100644
--- a/common/rc
+++ b/common/rc
@@ -3188,6 +3188,41 @@ _require_scratch_dax()
 	_scratch_unmount
 }
 
+_require_scratch_dax_mountopt()
+{
+	local mountopt=$1
+	local output
+
+	_require_scratch
+	_scratch_mkfs > /dev/null 2>&1
+	_try_scratch_mount -o "$mountopt" || \
+		_notrun "mount $SCRATCH_DEV with $mountopt failed"
+
+	output=$(_fs_options $SCRATCH_DEV)
+
+	# For new dax mount option, /proc/mounts shows different outputs if we
+	# mount with -o dax=inode on ext4 and xfs so skip checking it.
+	# /proc/mounts shows 'dax=inode' on ext4 but shows nothing on xfs.
+	if [ "$mountopt" != "dax=inode" ]; then
+		echo $output | grep -qw "$mountopt" || \
+			_notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt"
+	fi
+
+	# For new dax mount option, /proc/mounts shows "dax=never" if we
+	# mount with -o dax on xfs and underlying device doesn't support dax.
+	if [ "$mountopt" = "dax" ]; then
+		echo $output | grep -qw "dax=never" && \
+			_notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt"
+	fi
+
+	_scratch_unmount
+}
+
+_require_scratch_dax_iflag()
+{
+	_require_xfs_io_command "chattr" "x"
+}
+
 # Does norecovery support by this fs?
 _require_norecovery()
 {
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag()
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
  2020-06-17  9:31 ` [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Xiao Yang
@ 2020-06-17  9:32 ` Xiao Yang
  2020-06-17 20:58   ` Ira Weiny
  2020-06-17  9:32 ` [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax() Xiao Yang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:32 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

Make related tests use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag()

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/ext4/030    | 2 +-
 tests/ext4/031    | 4 ++--
 tests/generic/413 | 2 +-
 tests/generic/462 | 2 +-
 tests/xfs/260     | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/ext4/030 b/tests/ext4/030
index 93bbca86..fb5cf451 100755
--- a/tests/ext4/030
+++ b/tests/ext4/030
@@ -33,7 +33,7 @@ rm -f $seqres.full
 # Modify as appropriate.
 _supported_os Linux
 _supported_fs ext4
-_require_scratch_dax
+_require_scratch_dax_mountopt "dax"
 _require_test_program "t_ext4_dax_journal_corruption"
 _require_command "$CHATTR_PROG" chattr
 
diff --git a/tests/ext4/031 b/tests/ext4/031
index dc58214e..20e2fab7 100755
--- a/tests/ext4/031
+++ b/tests/ext4/031
@@ -37,7 +37,7 @@ MOUNT_OPTIONS=""
 # Modify as appropriate.
 _supported_os Linux
 _supported_fs ext4
-_require_scratch_dax
+_require_scratch_dax_mountopt "dax"
 _require_test_program "t_ext4_dax_inline_corruption"
 _require_scratch_ext4_feature "inline_data"
 
@@ -56,7 +56,7 @@ _scratch_unmount >> $seqres.full 2>&1
 _try_scratch_mount "-o dax" >> $seqres.full 2>&1
 
 if [[ $? != 0 ]]; then
-	# _require_scratch_dax already verified that we could mount with DAX.
+	# _require_scratch_dax_mountopt already verified that we could mount with DAX.
 	# Failure here is expected because we have inline data.
 	echo "Silence is golden"
 	status=0
diff --git a/tests/generic/413 b/tests/generic/413
index 1ce89aff..19e1b926 100755
--- a/tests/generic/413
+++ b/tests/generic/413
@@ -31,7 +31,7 @@ rm -f $seqres.full
 _supported_fs generic
 _supported_os Linux
 _require_test
-_require_scratch_dax
+_require_scratch_dax_mountopt "dax"
 _require_test_program "feature"
 _require_test_program "t_mmap_dio"
 _require_xfs_io_command "falloc"
diff --git a/tests/generic/462 b/tests/generic/462
index 1ab6cadc..4a940239 100755
--- a/tests/generic/462
+++ b/tests/generic/462
@@ -37,7 +37,7 @@ rm -f $seqres.full
 _supported_fs generic
 _supported_os Linux
 _require_test
-_require_scratch_dax
+_require_scratch_dax_mountopt "dax"
 _require_test_program "t_mmap_write_ro"
 # running by unpriviliged user is not necessary to reproduce
 # this bug, just trying to test more.
diff --git a/tests/xfs/260 b/tests/xfs/260
index 3464ffef..fbdc4cd8 100755
--- a/tests/xfs/260
+++ b/tests/xfs/260
@@ -30,10 +30,10 @@ rm -f $seqres.full
 
 _supported_fs xfs
 _supported_os Linux
-_require_scratch_dax
+_require_scratch_dax_mountopt "dax"
 _require_test_program "feature"
 _require_test_program "t_mmap_dio"
-_require_xfs_io_command "chattr" "x"
+_require_scratch_dax_iflag
 _require_xfs_io_command "falloc"
 
 prep_files()
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax()
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
  2020-06-17  9:31 ` [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Xiao Yang
  2020-06-17  9:32 ` [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag() Xiao Yang
@ 2020-06-17  9:32 ` Xiao Yang
  2020-06-17 20:59   ` Ira Weiny
  2020-06-17  9:32 ` [PATCH v2 4/6] generic/223: Don't clear all mkfs options for _scratch_mkfs_geom() roughly Xiao Yang
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:32 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/common/rc b/common/rc
index ec7c19e4..dba52002 100644
--- a/common/rc
+++ b/common/rc
@@ -3175,19 +3175,6 @@ _require_scratch_shutdown()
 }
 
 # Does dax mount option work on this dev/fs?
-_require_scratch_dax()
-{
-	_require_scratch
-	_scratch_mkfs > /dev/null 2>&1
-	_try_scratch_mount -o dax || \
-		_notrun "mount $SCRATCH_DEV with dax failed"
-	# Check options to be sure. XFS ignores dax option
-	# and goes on if dev underneath does not support dax.
-	_fs_options $SCRATCH_DEV | grep -qw "dax" || \
-		_notrun "$SCRATCH_DEV $FSTYP does not support -o dax"
-	_scratch_unmount
-}
-
 _require_scratch_dax_mountopt()
 {
 	local mountopt=$1
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 4/6] generic/223: Don't clear all mkfs options for _scratch_mkfs_geom() roughly
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
                   ` (2 preceding siblings ...)
  2020-06-17  9:32 ` [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax() Xiao Yang
@ 2020-06-17  9:32 ` Xiao Yang
  2020-06-17  9:32 ` [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing Xiao Yang
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:32 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

ext4 can accept the last one if the same mkfs options are passed but xfs cannot
accept the same mkfs options and reports "xxx option is respecified" error.  I
prefer to override the same mkfs option which is defined in MKFS_OPTION so that
we can have a chance to pass other mkfs options to _scratch_mkfs_geom().

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc         | 14 +++++++++++++-
 tests/generic/223 |  1 -
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index dba52002..bde26010 100644
--- a/common/rc
+++ b/common/rc
@@ -1051,7 +1051,19 @@ _scratch_mkfs_geom()
 
     case $FSTYP in
     xfs)
-	MKFS_OPTIONS+=" -b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
+	if echo "$MKFS_OPTIONS" | egrep -q "b?size="; then
+		MKFS_OPTIONS=$(echo "$MKFS_OPTIONS" | sed -r "s/(b?size=)[0-9]+/\1$blocksize/")
+	else
+		MKFS_OPTIONS+=" -b size=$blocksize"
+	fi
+
+	if echo "$MKFS_OPTIONS" | egrep -q "(su|sunit|sw|swidth)="; then
+		MKFS_OPTIONS=$(echo "$MKFS_OPTIONS" | sed -r \
+			-e "s/(su|sunit)=[0-9kmg]+/su=$sunit_bytes/" \
+			-e "s/(sw|swidth)=[0-9kmg]+/sw=$swidth_mult/")
+	else
+		MKFS_OPTIONS+=" -d su=$sunit_bytes,sw=$swidth_mult"
+	fi
 	;;
     ext4|ext4dev)
 	MKFS_OPTIONS+=" -b $blocksize -E stride=$sunit_blocks,stripe_width=$swidth_blocks"
diff --git a/tests/generic/223 b/tests/generic/223
index 6cfd00dd..ba7c9a44 100755
--- a/tests/generic/223
+++ b/tests/generic/223
@@ -41,7 +41,6 @@ for SUNIT_K in 8 16 32 64 128; do
 	let SUNIT_BLOCKS=$SUNIT_BYTES/$BLOCKSIZE
 
 	echo "=== mkfs with su $SUNIT_BLOCKS blocks x 4 ==="
-	export MKFS_OPTIONS=""
 	_scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
 	_scratch_mount
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
                   ` (3 preceding siblings ...)
  2020-06-17  9:32 ` [PATCH v2 4/6] generic/223: Don't clear all mkfs options for _scratch_mkfs_geom() roughly Xiao Yang
@ 2020-06-17  9:32 ` Xiao Yang
  2020-06-23  6:00   ` Xiao Yang
  2020-06-23 15:28   ` Darrick J. Wong
  2020-06-17  9:32 ` [PATCH v2 6/6] xfs/260: Move xfs/260 to generic Xiao Yang
  2020-06-18  0:21 ` [PATCH v2 0/6] Make fstests support new behavior of DAX Ira Weiny
  6 siblings, 2 replies; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:32 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

1) Simple code and fix the wrong value of stripe_width by _scratch_mkfs_geom().
2) Get hugepage size by _get_hugepagesize() and replace fixed 2M with
   hugepage size because hugepage size/PMD_SIZE is not 2M on some
   arches.(e.g. hugepage size/PMD_SIZE is 512M on arm64)
3) For debugging, redirect the output of mkfs to $seqres.full.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc         |  7 +++++++
 tests/generic/413 | 10 ++--------
 tests/xfs/260     |  4 ++--
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/common/rc b/common/rc
index bde26010..4852b21b 100644
--- a/common/rc
+++ b/common/rc
@@ -170,6 +170,13 @@ _get_filesize()
     stat -c %s "$1"
 }
 
+# get hugepagesize in bytes
+_get_hugepagesize()
+{
+	local hugepgsz=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)
+	echo $((hugepgsz * 1024))
+}
+
 _mount()
 {
     $MOUNT_PROG `_mount_ops_filter $*`
diff --git a/tests/generic/413 b/tests/generic/413
index 19e1b926..dfe2912b 100755
--- a/tests/generic/413
+++ b/tests/generic/413
@@ -111,14 +111,8 @@ do_tests()
 	t_mmap_dio_dax $((64 * 1024 * 1024))
 }
 
-# make fs 2Mb aligned for PMD fault testing
-mkfs_opts=""
-if [ "$FSTYP" == "ext4" ]; then
-	mkfs_opts="-E stride=512,stripe_width=1"
-elif [ "$FSTYP" == "xfs" ]; then
-	mkfs_opts="-d su=2m,sw=1"
-fi
-_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
+# make fs aligned for PMD fault testing
+_scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
 
 # mount SCRATCH_DEV with dax option, TEST_DEV not
 export MOUNT_OPTIONS=""
diff --git a/tests/xfs/260 b/tests/xfs/260
index fbdc4cd8..7afc20f1 100755
--- a/tests/xfs/260
+++ b/tests/xfs/260
@@ -121,8 +121,8 @@ do_tests()
 	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
 }
 
-# make xfs 2Mb aligned for PMD fault testing
-_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1
+# 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"
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
                   ` (4 preceding siblings ...)
  2020-06-17  9:32 ` [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing Xiao Yang
@ 2020-06-17  9:32 ` Xiao Yang
  2020-06-17 21:48   ` Ira Weiny
  2020-06-18  0:21 ` [PATCH v2 0/6] Make fstests support new behavior of DAX Ira Weiny
  6 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-17  9:32 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, ira.weiny, ross.zwisler, Xiao Yang

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

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
-- 
2.21.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX
  2020-06-17  9:31 ` [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Xiao Yang
@ 2020-06-17 20:58   ` Ira Weiny
  0 siblings, 0 replies; 22+ messages in thread
From: Ira Weiny @ 2020-06-17 20:58 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

On Wed, Jun 17, 2020 at 05:31:59PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> 
> 1) _require_scratch_dax_mountopt() checks both old and new DAX mount option
> 2) _require_scratch_dax_iflag() checks FS_XFLAG_DAX
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Thanks for moving this along.  I've been trying to get my tests modified and
integrated better into the mainline.

Thanks!

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  common/rc | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index a6967831..ec7c19e4 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3188,6 +3188,41 @@ _require_scratch_dax()
>  	_scratch_unmount
>  }
>  
> +_require_scratch_dax_mountopt()
> +{
> +	local mountopt=$1
> +	local output
> +
> +	_require_scratch
> +	_scratch_mkfs > /dev/null 2>&1
> +	_try_scratch_mount -o "$mountopt" || \
> +		_notrun "mount $SCRATCH_DEV with $mountopt failed"
> +
> +	output=$(_fs_options $SCRATCH_DEV)
> +
> +	# For new dax mount option, /proc/mounts shows different outputs if we
> +	# mount with -o dax=inode on ext4 and xfs so skip checking it.
> +	# /proc/mounts shows 'dax=inode' on ext4 but shows nothing on xfs.
> +	if [ "$mountopt" != "dax=inode" ]; then
> +		echo $output | grep -qw "$mountopt" || \
> +			_notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt"
> +	fi
> +
> +	# For new dax mount option, /proc/mounts shows "dax=never" if we
> +	# mount with -o dax on xfs and underlying device doesn't support dax.
> +	if [ "$mountopt" = "dax" ]; then
> +		echo $output | grep -qw "dax=never" && \
> +			_notrun "$SCRATCH_DEV $FSTYP does not support -o $mountopt"
> +	fi
> +
> +	_scratch_unmount
> +}
> +
> +_require_scratch_dax_iflag()
> +{
> +	_require_xfs_io_command "chattr" "x"
> +}
> +
>  # Does norecovery support by this fs?
>  _require_norecovery()
>  {
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag()
  2020-06-17  9:32 ` [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag() Xiao Yang
@ 2020-06-17 20:58   ` Ira Weiny
  0 siblings, 0 replies; 22+ messages in thread
From: Ira Weiny @ 2020-06-17 20:58 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

On Wed, Jun 17, 2020 at 05:32:00PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> 
> Make related tests use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag()
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  tests/ext4/030    | 2 +-
>  tests/ext4/031    | 4 ++--
>  tests/generic/413 | 2 +-
>  tests/generic/462 | 2 +-
>  tests/xfs/260     | 4 ++--
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/ext4/030 b/tests/ext4/030
> index 93bbca86..fb5cf451 100755
> --- a/tests/ext4/030
> +++ b/tests/ext4/030
> @@ -33,7 +33,7 @@ rm -f $seqres.full
>  # Modify as appropriate.
>  _supported_os Linux
>  _supported_fs ext4
> -_require_scratch_dax
> +_require_scratch_dax_mountopt "dax"
>  _require_test_program "t_ext4_dax_journal_corruption"
>  _require_command "$CHATTR_PROG" chattr
>  
> diff --git a/tests/ext4/031 b/tests/ext4/031
> index dc58214e..20e2fab7 100755
> --- a/tests/ext4/031
> +++ b/tests/ext4/031
> @@ -37,7 +37,7 @@ MOUNT_OPTIONS=""
>  # Modify as appropriate.
>  _supported_os Linux
>  _supported_fs ext4
> -_require_scratch_dax
> +_require_scratch_dax_mountopt "dax"
>  _require_test_program "t_ext4_dax_inline_corruption"
>  _require_scratch_ext4_feature "inline_data"
>  
> @@ -56,7 +56,7 @@ _scratch_unmount >> $seqres.full 2>&1
>  _try_scratch_mount "-o dax" >> $seqres.full 2>&1
>  
>  if [[ $? != 0 ]]; then
> -	# _require_scratch_dax already verified that we could mount with DAX.
> +	# _require_scratch_dax_mountopt already verified that we could mount with DAX.
>  	# Failure here is expected because we have inline data.
>  	echo "Silence is golden"
>  	status=0
> diff --git a/tests/generic/413 b/tests/generic/413
> index 1ce89aff..19e1b926 100755
> --- a/tests/generic/413
> +++ b/tests/generic/413
> @@ -31,7 +31,7 @@ rm -f $seqres.full
>  _supported_fs generic
>  _supported_os Linux
>  _require_test
> -_require_scratch_dax
> +_require_scratch_dax_mountopt "dax"
>  _require_test_program "feature"
>  _require_test_program "t_mmap_dio"
>  _require_xfs_io_command "falloc"
> diff --git a/tests/generic/462 b/tests/generic/462
> index 1ab6cadc..4a940239 100755
> --- a/tests/generic/462
> +++ b/tests/generic/462
> @@ -37,7 +37,7 @@ rm -f $seqres.full
>  _supported_fs generic
>  _supported_os Linux
>  _require_test
> -_require_scratch_dax
> +_require_scratch_dax_mountopt "dax"
>  _require_test_program "t_mmap_write_ro"
>  # running by unpriviliged user is not necessary to reproduce
>  # this bug, just trying to test more.
> diff --git a/tests/xfs/260 b/tests/xfs/260
> index 3464ffef..fbdc4cd8 100755
> --- a/tests/xfs/260
> +++ b/tests/xfs/260
> @@ -30,10 +30,10 @@ rm -f $seqres.full
>  
>  _supported_fs xfs
>  _supported_os Linux
> -_require_scratch_dax
> +_require_scratch_dax_mountopt "dax"
>  _require_test_program "feature"
>  _require_test_program "t_mmap_dio"
> -_require_xfs_io_command "chattr" "x"
> +_require_scratch_dax_iflag
>  _require_xfs_io_command "falloc"
>  
>  prep_files()
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax()
  2020-06-17  9:32 ` [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax() Xiao Yang
@ 2020-06-17 20:59   ` Ira Weiny
  0 siblings, 0 replies; 22+ messages in thread
From: Ira Weiny @ 2020-06-17 20:59 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

On Wed, Jun 17, 2020 at 05:32:01PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  common/rc | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index ec7c19e4..dba52002 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3175,19 +3175,6 @@ _require_scratch_shutdown()
>  }
>  
>  # Does dax mount option work on this dev/fs?
> -_require_scratch_dax()
> -{
> -	_require_scratch
> -	_scratch_mkfs > /dev/null 2>&1
> -	_try_scratch_mount -o dax || \
> -		_notrun "mount $SCRATCH_DEV with dax failed"
> -	# Check options to be sure. XFS ignores dax option
> -	# and goes on if dev underneath does not support dax.
> -	_fs_options $SCRATCH_DEV | grep -qw "dax" || \
> -		_notrun "$SCRATCH_DEV $FSTYP does not support -o dax"
> -	_scratch_unmount
> -}
> -
>  _require_scratch_dax_mountopt()
>  {
>  	local mountopt=$1
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-17  9:32 ` [PATCH v2 6/6] xfs/260: Move xfs/260 to generic Xiao Yang
@ 2020-06-17 21:48   ` Ira Weiny
  2020-06-18 15:35     ` Xiao Yang
  0 siblings, 1 reply; 22+ messages in thread
From: Ira Weiny @ 2020-06-17 21:48 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

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
-- 
2.25.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 0/6] Make fstests support new behavior of DAX
  2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
                   ` (5 preceding siblings ...)
  2020-06-17  9:32 ` [PATCH v2 6/6] xfs/260: Move xfs/260 to generic Xiao Yang
@ 2020-06-18  0:21 ` Ira Weiny
  2020-06-18 15:04   ` Xiao Yang
  6 siblings, 1 reply; 22+ messages in thread
From: Ira Weiny @ 2020-06-18  0:21 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, Xiao Yang

On Wed, Jun 17, 2020 at 05:31:58PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>

Also this email for Ross is no longer valid.  I don't believe he is with Intel
any longer.

	ross.zwisler@linux.intel.com

Ira

> 
> The new behavior of DAX on xfs/ext4 has been merged into main kernel
> tree/ext4-dax branch so it is time for fstests to support new behavior
> of DAX.
> 
> References:
> https://lkml.org/lkml/2019/10/20/96
> https://lkml.org/lkml/2020/5/28/949
> 
> Xiao Yang (6):
>   common/rc: Introduce new helpers for DAX mount options and
>     FS_XFLAG_DAX
>   fstests: Use _require_scratch_dax_mountopt() and
>     _require_scratch_dax_iflag()
>   common/rc: Remove unused _require_scratch_dax()
>   generic/223: Don't clear all mkfs options for _scratch_mkfs_geom()
>     roughly
>   generic/413, xfs/260: Improve format operation for PMD fault testing
>   xfs/260: Move xfs/260 to generic
> 
>  common/rc                      | 57 +++++++++++++++++++++++++++++-----
>  tests/ext4/030                 |  2 +-
>  tests/ext4/031                 |  4 +--
>  tests/generic/223              |  1 -
>  tests/generic/413              | 12 ++-----
>  tests/generic/462              |  2 +-
>  tests/{xfs/260 => generic/602} | 12 +++----
>  tests/generic/602.out          |  2 ++
>  tests/generic/group            |  1 +
>  tests/xfs/260.out              |  2 --
>  tests/xfs/group                |  1 -
>  11 files changed, 65 insertions(+), 31 deletions(-)
>  rename tests/{xfs/260 => generic/602} (93%)
>  create mode 100644 tests/generic/602.out
>  delete mode 100644 tests/xfs/260.out
> 
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 0/6] Make fstests support new behavior of DAX
  2020-06-18  0:21 ` [PATCH v2 0/6] Make fstests support new behavior of DAX Ira Weiny
@ 2020-06-18 15:04   ` Xiao Yang
  0 siblings, 0 replies; 22+ messages in thread
From: Xiao Yang @ 2020-06-18 15:04 UTC (permalink / raw)
  To: Ira Weiny; +Cc: fstests, darrick.wong, Xiao Yang

On 6/18/20 8:21 AM, Ira Weiny wrote:
> On Wed, Jun 17, 2020 at 05:31:58PM +0800, Xiao Yang wrote:
>> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Also this email for Ross is no longer valid.  I don't believe he is with Intel
> any longer.
>
> 	ross.zwisler@linux.intel.com

Hi Ira,

Thanks for your reminder.

IIRC, some code which is related to PMD fault testing comes from Ross, 
and the last two patches

update these code so that generic/413 and generic/602 can run PMD fault 
testing on different arches.

I wanted Ross to do some review before. :-)

Best Regards,

Xiao Yang

>
> Ira
>
>> The new behavior of DAX on xfs/ext4 has been merged into main kernel
>> tree/ext4-dax branch so it is time for fstests to support new behavior
>> of DAX.
>>
>> References:
>> https://lkml.org/lkml/2019/10/20/96
>> https://lkml.org/lkml/2020/5/28/949
>>
>> Xiao Yang (6):
>>    common/rc: Introduce new helpers for DAX mount options and
>>      FS_XFLAG_DAX
>>    fstests: Use _require_scratch_dax_mountopt() and
>>      _require_scratch_dax_iflag()
>>    common/rc: Remove unused _require_scratch_dax()
>>    generic/223: Don't clear all mkfs options for _scratch_mkfs_geom()
>>      roughly
>>    generic/413, xfs/260: Improve format operation for PMD fault testing
>>    xfs/260: Move xfs/260 to generic
>>
>>   common/rc                      | 57 +++++++++++++++++++++++++++++-----
>>   tests/ext4/030                 |  2 +-
>>   tests/ext4/031                 |  4 +--
>>   tests/generic/223              |  1 -
>>   tests/generic/413              | 12 ++-----
>>   tests/generic/462              |  2 +-
>>   tests/{xfs/260 => generic/602} | 12 +++----
>>   tests/generic/602.out          |  2 ++
>>   tests/generic/group            |  1 +
>>   tests/xfs/260.out              |  2 --
>>   tests/xfs/group                |  1 -
>>   11 files changed, 65 insertions(+), 31 deletions(-)
>>   rename tests/{xfs/260 => generic/602} (93%)
>>   create mode 100644 tests/generic/602.out
>>   delete mode 100644 tests/xfs/260.out
>>
>> -- 
>> 2.21.0
>>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-17 21:48   ` Ira Weiny
@ 2020-06-18 15:35     ` Xiao Yang
  2020-06-19 15:15       ` Ira Weiny
  0 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-18 15:35 UTC (permalink / raw)
  To: Ira Weiny; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-18 15:35     ` Xiao Yang
@ 2020-06-19 15:15       ` Ira Weiny
  2020-06-23  8:51         ` Xiao Yang
  0 siblings, 1 reply; 22+ messages in thread
From: Ira Weiny @ 2020-06-19 15:15 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, darrick.wong, ross.zwisler, Xiao Yang

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
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing
  2020-06-17  9:32 ` [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing Xiao Yang
@ 2020-06-23  6:00   ` Xiao Yang
  2020-06-23 15:28   ` Darrick J. Wong
  1 sibling, 0 replies; 22+ messages in thread
From: Xiao Yang @ 2020-06-23  6:00 UTC (permalink / raw)
  To: darrick.wong; +Cc: Xiao Yang, fstests, ira.weiny, ross.zwisler

Hi Darrick,

Sorry to bother you.
Do you have any comment on this patch? :-)

Thanks,
Xiao Yang
On 2020/6/17 17:32, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
>
> 1) Simple code and fix the wrong value of stripe_width by _scratch_mkfs_geom().
> 2) Get hugepage size by _get_hugepagesize() and replace fixed 2M with
>    hugepage size because hugepage size/PMD_SIZE is not 2M on some
>    arches.(e.g. hugepage size/PMD_SIZE is 512M on arm64)
> 3) For debugging, redirect the output of mkfs to $seqres.full.
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  common/rc         |  7 +++++++
>  tests/generic/413 | 10 ++--------
>  tests/xfs/260     |  4 ++--
>  3 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index bde26010..4852b21b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -170,6 +170,13 @@ _get_filesize()
>      stat -c %s "$1"
>  }
>  
> +# get hugepagesize in bytes
> +_get_hugepagesize()
> +{
> +	local hugepgsz=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)
> +	echo $((hugepgsz * 1024))
> +}
> +
>  _mount()
>  {
>      $MOUNT_PROG `_mount_ops_filter $*`
> diff --git a/tests/generic/413 b/tests/generic/413
> index 19e1b926..dfe2912b 100755
> --- a/tests/generic/413
> +++ b/tests/generic/413
> @@ -111,14 +111,8 @@ do_tests()
>  	t_mmap_dio_dax $((64 * 1024 * 1024))
>  }
>  
> -# make fs 2Mb aligned for PMD fault testing
> -mkfs_opts=""
> -if [ "$FSTYP" == "ext4" ]; then
> -	mkfs_opts="-E stride=512,stripe_width=1"
> -elif [ "$FSTYP" == "xfs" ]; then
> -	mkfs_opts="-d su=2m,sw=1"
> -fi
> -_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
> +# make fs aligned for PMD fault testing
> +_scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
>  
>  # mount SCRATCH_DEV with dax option, TEST_DEV not
>  export MOUNT_OPTIONS=""
> diff --git a/tests/xfs/260 b/tests/xfs/260
> index fbdc4cd8..7afc20f1 100755
> --- a/tests/xfs/260
> +++ b/tests/xfs/260
> @@ -121,8 +121,8 @@ do_tests()
>  	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>  }
>  
> -# make xfs 2Mb aligned for PMD fault testing
> -_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1
> +# 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"




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-19 15:15       ` Ira Weiny
@ 2020-06-23  8:51         ` Xiao Yang
  2020-06-23 18:08           ` Ira Weiny
  0 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-23  8:51 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Xiao Yang, fstests, darrick.wong, ross.zwisler

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
>
> .
>




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing
  2020-06-17  9:32 ` [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing Xiao Yang
  2020-06-23  6:00   ` Xiao Yang
@ 2020-06-23 15:28   ` Darrick J. Wong
  1 sibling, 0 replies; 22+ messages in thread
From: Darrick J. Wong @ 2020-06-23 15:28 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests, ira.weiny, ross.zwisler, Xiao Yang

On Wed, Jun 17, 2020 at 05:32:03PM +0800, Xiao Yang wrote:
> From: Xiao Yang <yangx.jy@cn.fujitsu.com>
> 
> 1) Simple code and fix the wrong value of stripe_width by _scratch_mkfs_geom().
> 2) Get hugepage size by _get_hugepagesize() and replace fixed 2M with
>    hugepage size because hugepage size/PMD_SIZE is not 2M on some
>    arches.(e.g. hugepage size/PMD_SIZE is 512M on arm64)
> 3) For debugging, redirect the output of mkfs to $seqres.full.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  common/rc         |  7 +++++++
>  tests/generic/413 | 10 ++--------
>  tests/xfs/260     |  4 ++--
>  3 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index bde26010..4852b21b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -170,6 +170,13 @@ _get_filesize()
>      stat -c %s "$1"
>  }
>  
> +# get hugepagesize in bytes
> +_get_hugepagesize()
> +{
> +	local hugepgsz=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)
> +	echo $((hugepgsz * 1024))
> +}
> +
>  _mount()
>  {
>      $MOUNT_PROG `_mount_ops_filter $*`
> diff --git a/tests/generic/413 b/tests/generic/413
> index 19e1b926..dfe2912b 100755
> --- a/tests/generic/413
> +++ b/tests/generic/413
> @@ -111,14 +111,8 @@ do_tests()
>  	t_mmap_dio_dax $((64 * 1024 * 1024))
>  }
>  
> -# make fs 2Mb aligned for PMD fault testing
> -mkfs_opts=""
> -if [ "$FSTYP" == "ext4" ]; then
> -	mkfs_opts="-E stride=512,stripe_width=1"
> -elif [ "$FSTYP" == "xfs" ]; then
> -	mkfs_opts="-d su=2m,sw=1"
> -fi
> -_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
> +# make fs aligned for PMD fault testing
> +_scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1

These _get_hugepagesize callsites ought to _notrun the test or something
if the relevant data cannot be extracted from /proc/meminfo.

Other than that, I like the way this looks. :)

--D

>  
>  # mount SCRATCH_DEV with dax option, TEST_DEV not
>  export MOUNT_OPTIONS=""
> diff --git a/tests/xfs/260 b/tests/xfs/260
> index fbdc4cd8..7afc20f1 100755
> --- a/tests/xfs/260
> +++ b/tests/xfs/260
> @@ -121,8 +121,8 @@ do_tests()
>  	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>  }
>  
> -# make xfs 2Mb aligned for PMD fault testing
> -_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1
> +# 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"
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-23  8:51         ` Xiao Yang
@ 2020-06-23 18:08           ` Ira Weiny
  2020-06-30  7:08             ` Xiao Yang
  0 siblings, 1 reply; 22+ messages in thread
From: Ira Weiny @ 2020-06-23 18:08 UTC (permalink / raw)
  To: Xiao Yang; +Cc: Xiao Yang, fstests, darrick.wong

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
> > 
> > .
> > 
> 
> 
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-23 18:08           ` Ira Weiny
@ 2020-06-30  7:08             ` Xiao Yang
  2020-06-30 15:50               ` Ira Weiny
  0 siblings, 1 reply; 22+ messages in thread
From: Xiao Yang @ 2020-06-30  7:08 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Xiao Yang, fstests, darrick.wong

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
>>> .
>>>
>>
> .
>




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-30  7:08             ` Xiao Yang
@ 2020-06-30 15:50               ` Ira Weiny
  2020-07-01  1:07                 ` Xiao Yang
  0 siblings, 1 reply; 22+ messages in thread
From: Ira Weiny @ 2020-06-30 15:50 UTC (permalink / raw)
  To: Xiao Yang; +Cc: Xiao Yang, fstests, darrick.wong

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
> > > > .
> > > > 
> > > 
> > .
> > 
> 
> 
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/6] xfs/260: Move xfs/260 to generic
  2020-06-30 15:50               ` Ira Weiny
@ 2020-07-01  1:07                 ` Xiao Yang
  0 siblings, 0 replies; 22+ messages in thread
From: Xiao Yang @ 2020-07-01  1:07 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Xiao Yang, fstests, darrick.wong

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
>>>>> .
>>>>>
>>> .
>>>
>>
>>
>
> .
>




^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, back to index

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17  9:31 [PATCH v2 0/6] Make fstests support new behavior of DAX Xiao Yang
2020-06-17  9:31 ` [PATCH v2 1/6] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX Xiao Yang
2020-06-17 20:58   ` Ira Weiny
2020-06-17  9:32 ` [PATCH v2 2/6] fstests: Use _require_scratch_dax_mountopt() and _require_scratch_dax_iflag() Xiao Yang
2020-06-17 20:58   ` Ira Weiny
2020-06-17  9:32 ` [PATCH v2 3/6] common/rc: Remove unused _require_scratch_dax() Xiao Yang
2020-06-17 20:59   ` Ira Weiny
2020-06-17  9:32 ` [PATCH v2 4/6] generic/223: Don't clear all mkfs options for _scratch_mkfs_geom() roughly Xiao Yang
2020-06-17  9:32 ` [PATCH v2 5/6] generic/413, xfs/260: Improve format operation for PMD fault testing Xiao Yang
2020-06-23  6:00   ` Xiao Yang
2020-06-23 15:28   ` Darrick J. Wong
2020-06-17  9:32 ` [PATCH v2 6/6] xfs/260: Move xfs/260 to generic Xiao Yang
2020-06-17 21:48   ` Ira Weiny
2020-06-18 15:35     ` Xiao Yang
2020-06-19 15:15       ` Ira Weiny
2020-06-23  8:51         ` Xiao Yang
2020-06-23 18:08           ` Ira Weiny
2020-06-30  7:08             ` Xiao Yang
2020-06-30 15:50               ` Ira Weiny
2020-07-01  1:07                 ` Xiao Yang
2020-06-18  0:21 ` [PATCH v2 0/6] Make fstests support new behavior of DAX Ira Weiny
2020-06-18 15:04   ` Xiao Yang

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git