common/rc: add _filter_scratch in _test_inode_flag
PATCH 1/1 common/rc: add _filter_scratch in _test_inode_flag
From: Xiaoli Feng <[email protected]>
Avoid the invalid failure when the path of file include test flag.
--- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
@@ -3069,7 +3069,7 @@ _test_inode_flag() local flag=$1 local file=$2 - if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then + if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | _filter_scratch | grep -q "$flag" ; then return 0 fi return 1
Signature · 1 line
2.18.1
Quoted 5 lines · Xiaoli Feng
From: Xiaoli Feng <[email protected]>
Avoid the invalid failure when the path of file include test flag.
Signed-off-by Xiaoli Feng <[email protected]>
Would you please elaborate this issue in more details? It seems your SCRATCH_MNT contains a string that matches $flag so _test_inode_flag returns a false positive. But that only fixes SCRATCH_MNT, what if TEST_DIR contains the string as well?
Thanks,
Eryu
Quoted 19 lines
--- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +1
-1@@ -3069,7 +3069,7 @@ _test_inode_flag() local flag=$1 local file=$2 - if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then + if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | _filter_scratch | grep -q "$flag" ; then return 0 fi return 1Signature · 1 line
2.18.1
Hi,
----- Original Message -----
Quoted 9 lines
From: "Eryu Guan" <[email protected]>
To: "XiaoLi Feng" <[email protected]>
Cc: [email protected]
Sent: Sunday, November 29, 2020 4:12:34 PM
Subject: Re: [PATCH] common/rc: add_filter_scratchin_test_inode_flagQuoted 2 lines · Xiaoli Feng
From: Xiaoli Feng <[email protected]>
Quoted 8 lines
Quoted 3 lines
Avoid the invalid failure when the path of file include test flag.
Signed-off-by Xiaoli Feng <[email protected]>Would you please elaborate this issue in more details? It seems your
SCRATCH_MNTcontains a string that matches $flag so_test_inode_flagreturns a false positive. But that only fixesSCRATCH_MNT, what ifTEST_DIRcontains the string as well?
When test generic/608 for dax on xfs, "_check_xflag $t_file 0" is always failed if the $f_file has dax string. Yes, here should also include filter for TEST_DIR.
Quoted 26 lines
Thanks,
EryuQuoted 20 lines
--- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +1
-1@@ -3069,7 +3069,7 @@ _test_inode_flag() local flag=$1 local file=$2 - if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then + if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | _filter_scratch | grep -q"$flag" ; then
common/rc +0
-1return 0 fi return 1 --2.18.1