* [PATCH] common/rc: check 'chattr +/-x' on dax device.
@ 2019-07-30 8:40 ` Shiyang Ruan
0 siblings, 0 replies; 5+ messages in thread
From: Shiyang Ruan @ 2019-07-30 8:40 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 mounted with dax option.
Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
---
common/rc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/common/rc b/common/rc
index e0b087c1..73ee5563 100644
--- a/common/rc
+++ b/common/rc
@@ -2094,11 +2094,22 @@ _require_xfs_io_command()
if [ -z "$param" ]; then
param=s
fi
+
+ # Attribute "x" should be tested on a dax device
+ if [ "$param" == "x" ]; then
+ _scratch_mount "-o dax"
+ 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] 5+ messages in thread
* [PATCH] common/rc: check 'chattr +/-x' on dax device.
@ 2019-07-30 8:40 ` Shiyang Ruan
0 siblings, 0 replies; 5+ messages in thread
From: Shiyang Ruan @ 2019-07-30 8:40 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 mounted with dax option.
Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
---
common/rc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/common/rc b/common/rc
index e0b087c1..73ee5563 100644
--- a/common/rc
+++ b/common/rc
@@ -2094,11 +2094,22 @@ _require_xfs_io_command()
if [ -z "$param" ]; then
param=s
fi
+
+ # Attribute "x" should be tested on a dax device
+ if [ "$param" == "x" ]; then
+ _scratch_mount "-o dax"
+ 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] 5+ messages in thread
* Re: [PATCH] common/rc: check 'chattr +/-x' on dax device.
2019-07-30 8:40 ` Shiyang Ruan
(?)
@ 2019-07-30 14:47 ` Darrick J. Wong
2019-07-31 2:08 ` Shiyang Ruan
-1 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2019-07-30 14:47 UTC (permalink / raw)
To: Shiyang Ruan; +Cc: guaneryu, fstests, linux-xfs
On Tue, Jul 30, 2019 at 04:40:09PM +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 mounted with dax option.
>
> Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
> ---
> common/rc | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index e0b087c1..73ee5563 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2094,11 +2094,22 @@ _require_xfs_io_command()
> if [ -z "$param" ]; then
> param=s
> fi
> +
> + # Attribute "x" should be tested on a dax device
> + if [ "$param" == "x" ]; then
> + _scratch_mount "-o dax"
> + testfile=$SCRATCH_MNT/$$.xfs_io
NAK, the dax mount option is not intended to remain as a long-term
interface.
Also, "==" is a bashism (which probably is fine for fstests)
Also, there's no _require_scratch which means this can totally blow up
if the user doesn't specify a scratch device.
--D
> + 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] 5+ messages in thread
* Re: [PATCH] common/rc: check 'chattr +/-x' on dax device.
@ 2019-07-31 2:08 ` Shiyang Ruan
0 siblings, 0 replies; 5+ messages in thread
From: Shiyang Ruan @ 2019-07-31 2:08 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: guaneryu, fstests, linux-xfs
On 7/30/19 10:47 PM, Darrick J. Wong wrote:
> On Tue, Jul 30, 2019 at 04:40:09PM +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 mounted with dax option.
>>
>> Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
>> ---
>> common/rc | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/common/rc b/common/rc
>> index e0b087c1..73ee5563 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -2094,11 +2094,22 @@ _require_xfs_io_command()
>> if [ -z "$param" ]; then
>> param=s
>> fi
>> +
>> + # Attribute "x" should be tested on a dax device
>> + if [ "$param" == "x" ]; then
>> + _scratch_mount "-o dax"
>> + testfile=$SCRATCH_MNT/$$.xfs_io
>
> NAK, the dax mount option is not intended to remain as a long-term
> interface.
>
> Also, "==" is a bashism (which probably is fine for fstests)
>
> Also, there's no _require_scratch which means this can totally blow up
> if the user doesn't specify a scratch device.
Yes, and _require_scratch_dax seems to be a better choice.
And I found that the "chattr +/-x" check could also pass on a dax device
mounted without "-o dax".
--
Thanks,
Shiyang Ruan.
>
> --D
>
>> + 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] 5+ messages in thread
* Re: [PATCH] common/rc: check 'chattr +/-x' on dax device.
@ 2019-07-31 2:08 ` Shiyang Ruan
0 siblings, 0 replies; 5+ messages in thread
From: Shiyang Ruan @ 2019-07-31 2:08 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: guaneryu, fstests, linux-xfs
On 7/30/19 10:47 PM, Darrick J. Wong wrote:
> On Tue, Jul 30, 2019 at 04:40:09PM +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 mounted with dax option.
>>
>> Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
>> ---
>> common/rc | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/common/rc b/common/rc
>> index e0b087c1..73ee5563 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -2094,11 +2094,22 @@ _require_xfs_io_command()
>> if [ -z "$param" ]; then
>> param=s
>> fi
>> +
>> + # Attribute "x" should be tested on a dax device
>> + if [ "$param" == "x" ]; then
>> + _scratch_mount "-o dax"
>> + testfile=$SCRATCH_MNT/$$.xfs_io
>
> NAK, the dax mount option is not intended to remain as a long-term
> interface.
>
> Also, "==" is a bashism (which probably is fine for fstests)
>
> Also, there's no _require_scratch which means this can totally blow up
> if the user doesn't specify a scratch device.
Yes, and _require_scratch_dax seems to be a better choice.
And I found that the "chattr +/-x" check could also pass on a dax device
mounted without "-o dax".
--
Thanks,
Shiyang Ruan.
>
> --D
>
>> + 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] 5+ messages in thread
end of thread, other threads:[~2019-07-31 2:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 8:40 [PATCH] common/rc: check 'chattr +/-x' on dax device Shiyang Ruan
2019-07-30 8:40 ` Shiyang Ruan
2019-07-30 14:47 ` Darrick J. Wong
2019-07-31 2:08 ` Shiyang Ruan
2019-07-31 2:08 ` Shiyang Ruan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.