linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] common/rc: check 'chattr +/-x' on dax device.
@ 2019-07-31  2:29 Shiyang Ruan
  2019-07-31  2:29 ` Shiyang Ruan
  2019-08-04 15:26 ` Eryu Guan
  0 siblings, 2 replies; 3+ messages in thread
From: Shiyang Ruan @ 2019-07-31  2:29 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: ruansy.fnst, fstests, linux-xfs

'chattr +/-x' only works on a dax device.  When checking if the 'x'
attribute is supported by XFS_IO_PROG:
    _require_xfs_io_command "chattr" "x"    (called by xfs/260)
it's better to do the check on a dax device.

Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
---
 common/rc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/common/rc b/common/rc
index e0b087c1..91ab2900 100644
--- a/common/rc
+++ b/common/rc
@@ -2094,11 +2094,23 @@ _require_xfs_io_command()
 		if [ -z "$param" ]; then
 			param=s
 		fi
+
+		# Attribute "x" should be tested on a dax device
+		if [ "$param" = "x" ]; then
+			_require_scratch_dax
+			_scratch_mount
+			testfile=$SCRATCH_MNT/$$.xfs_io
+		fi
+
 		# Test xfs_io chattr support AND
 		# filesystem FS_IOC_FSSETXATTR support
 		testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
 		$XFS_IO_PROG -F -f -r -c "chattr -$param" $testfile 2>&1
 		param_checked="+$param"
+
+		if [ "$param" = "x" ]; then
+			_scratch_unmount
+		fi
 		;;
 	"chproj")
 		testio=`$XFS_IO_PROG -F -f -c "chproj 0" $testfile 2>&1`
-- 
2.17.0

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

* [PATCH v2] common/rc: check 'chattr +/-x' on dax device.
  2019-07-31  2:29 [PATCH v2] common/rc: check 'chattr +/-x' on dax device Shiyang Ruan
@ 2019-07-31  2:29 ` Shiyang Ruan
  2019-08-04 15:26 ` Eryu Guan
  1 sibling, 0 replies; 3+ messages in thread
From: Shiyang Ruan @ 2019-07-31  2:29 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: ruansy.fnst, fstests, linux-xfs

'chattr +/-x' only works on a dax device.  When checking if the 'x'
attribute is supported by XFS_IO_PROG:
    _require_xfs_io_command "chattr" "x"    (called by xfs/260)
it's better to do the check on a dax device.

Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
---
 common/rc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/common/rc b/common/rc
index e0b087c1..91ab2900 100644
--- a/common/rc
+++ b/common/rc
@@ -2094,11 +2094,23 @@ _require_xfs_io_command()
 		if [ -z "$param" ]; then
 			param=s
 		fi
+
+		# Attribute "x" should be tested on a dax device
+		if [ "$param" = "x" ]; then
+			_require_scratch_dax
+			_scratch_mount
+			testfile=$SCRATCH_MNT/$$.xfs_io
+		fi
+
 		# Test xfs_io chattr support AND
 		# filesystem FS_IOC_FSSETXATTR support
 		testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
 		$XFS_IO_PROG -F -f -r -c "chattr -$param" $testfile 2>&1
 		param_checked="+$param"
+
+		if [ "$param" = "x" ]; then
+			_scratch_unmount
+		fi
 		;;
 	"chproj")
 		testio=`$XFS_IO_PROG -F -f -c "chproj 0" $testfile 2>&1`
-- 
2.17.0




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

* Re: [PATCH v2] common/rc: check 'chattr +/-x' on dax device.
  2019-07-31  2:29 [PATCH v2] common/rc: check 'chattr +/-x' on dax device Shiyang Ruan
  2019-07-31  2:29 ` Shiyang Ruan
@ 2019-08-04 15:26 ` Eryu Guan
  1 sibling, 0 replies; 3+ messages in thread
From: Eryu Guan @ 2019-08-04 15:26 UTC (permalink / raw)
  To: Shiyang Ruan; +Cc: darrick.wong, fstests, linux-xfs

On Wed, Jul 31, 2019 at 10:29:49AM +0800, Shiyang Ruan wrote:
> 'chattr +/-x' only works on a dax device.  When checking if the 'x'
> attribute is supported by XFS_IO_PROG:
>     _require_xfs_io_command "chattr" "x"    (called by xfs/260)
> it's better to do the check on a dax device.

Hmm, I don't think it's necessary, test should _require_scratch_dax,
which should _notrun the test already, before checking chattr +/-x
support. Do you see any specific problem caused by this issue when
running xfs/260?

> 
> Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
> ---
>  common/rc | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index e0b087c1..91ab2900 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2094,11 +2094,23 @@ _require_xfs_io_command()
>  		if [ -z "$param" ]; then
>  			param=s
>  		fi
> +
> +		# Attribute "x" should be tested on a dax device
> +		if [ "$param" = "x" ]; then
> +			_require_scratch_dax
> +			_scratch_mount

$SCRATCH_DEV is wiped before every test, it's wrong to assume the device
is directly mountable. And checking chattr +/-x support doesn't require
scratch device, so it's better not to introduce this dependency
implicitly.

Thanks,
Eryu

> +			testfile=$SCRATCH_MNT/$$.xfs_io
> +		fi
> +
>  		# Test xfs_io chattr support AND
>  		# filesystem FS_IOC_FSSETXATTR support
>  		testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
>  		$XFS_IO_PROG -F -f -r -c "chattr -$param" $testfile 2>&1
>  		param_checked="+$param"
> +
> +		if [ "$param" = "x" ]; then
> +			_scratch_unmount
> +		fi
>  		;;
>  	"chproj")
>  		testio=`$XFS_IO_PROG -F -f -c "chproj 0" $testfile 2>&1`
> -- 
> 2.17.0
> 
> 
> 

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

end of thread, other threads:[~2019-08-04 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-31  2:29 [PATCH v2] common/rc: check 'chattr +/-x' on dax device Shiyang Ruan
2019-07-31  2:29 ` Shiyang Ruan
2019-08-04 15:26 ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).