Skip to contentSkip to conversation

common/rc: add _filter_scratch in _test_inode_flag

PATCH Superseded XiaoLi Feng 2 participants 3 messages Nov 23, 2020 – Dec 1, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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
index b5a504e0..04080331 100644
@@ -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
#1 lore raw
Quoted 5 lines · Xiaoli Feng

From: Xiaoli Feng <[email protected]>

Avoid the invalid failure when the path of file include test flag.

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
index b5a504e0..04080331 100644
@@ -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
#2 lore raw

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_scratch in _test_inode_flag

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

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?

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,
Eryu

Quoted 20 lines
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index b5a504e0..04080331 100644
@@ -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 -1
 		return 0
 	fi
 	return 1
--

2.18.1