Skip to contentSkip to conversation

common/rc: add filter in _test_inode_flag

PATCH Superseded XiaoLi Feng 2 participants 3 messages Feb 10, 2021 – Feb 18, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 common/rc: add filter in _test_inode_flag

From: Xiaoli Feng <[email protected]>

Add _filter_scratch and _filter_test_dir to avoid _test_inode_flag failed when mount point contains flag string.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 649b1cfd..f3bb665e 100644
@@ -3112,7 +3112,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 | _filter_test_dir | grep -q "$flag" ; then
 		return 0
 	fi
 	return 1
Signature · 1 line
2.18.1
#1 lore raw
Quoted 13 lines · XiaoLi Feng

From: Xiaoli Feng <[email protected]>

Add _filter_scratch and _filter_test_dir to avoid _test_inode_flag failed when mount point contains flag string.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +0 -0
index 649b1cfd..f3bb665e 100644

common/rc _test_inode_flag() · line 3115

Quoted 5 lines
common/rc +1 -1
@@ -3112,7 +3112,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 | _filter_test_dir | grep -q "$flag" ; then

Hi XiaoLi,

Is it ok to use _filter_testdir_and_scratch directly?

Best Regards,
Xiao Yang

Quoted 3 lines
common/rc +0 -0
 		return 0
 	fi
 	return 1
#2 lore raw

Hi,

----- Original Message -----

Quoted 24 lines

From: "Xiao Yang" <[email protected]>
To: "XiaoLi Feng" <[email protected]>
Cc: [email protected]
Sent: Thursday, February 18, 2021 2:30:38 PM
Subject: Re: [PATCH v2] common/rc: add filter in _test_inode_flag

Quoted 17 lines · XiaoLi Feng

From: Xiaoli Feng <[email protected]>

Add _filter_scratch and _filter_test_dir to avoid _test_inode_flag failed when
mount point contains flag string.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +0 -0
index 649b1cfd..f3bb665e 100644
@@ -3112,7 +3112,7 @@ _test_inode_flag()
 	local flag=$1
 	local file=$2
 
Quoted 6 lines
Quoted 3 lines
common/rc +1 -1
-	if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then
+	if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | _filter_scratch |

_filter_test_dir | grep -q "$flag" ; then

Hi XiaoLi,

Is it ok to use _filter_testdir_and_scratch directly?

Yes, it's. _filter_testdir_and_scratch is better. Thanks for your reviewing.

Quoted 10 lines

Best Regards,
Xiao Yang

Quoted 3 lines
common/rc +0 -0
 		return 0
 	fi
 	return 1