diff mbox series

[v2] common/rc: add filter in _test_inode_flag

Message ID 20210210083407.19184-1-xifeng@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] common/rc: add filter in _test_inode_flag | expand

Commit Message

XiaoLi Feng Feb. 10, 2021, 8:34 a.m. UTC
From: Xiaoli Feng <xifeng@redhat.com>

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(-)

Comments

Xiao Yang Feb. 18, 2021, 6:30 a.m. UTC | #1
On 2021/2/10 16:34, XiaoLi Feng wrote:
> From: Xiaoli Feng <xifeng@redhat.com>
>
> 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(-)
>
> diff --git a/common/rc b/common/rc
> index 649b1cfd..f3bb665e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -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
>  		return 0
>  	fi
>  	return 1
XiaoLi Feng Feb. 18, 2021, 8:49 a.m. UTC | #2
Hi,

----- Original Message -----
> From: "Xiao Yang" <yangx.jy@cn.fujitsu.com>
> To: "XiaoLi Feng" <xifeng@redhat.com>
> Cc: fstests@vger.kernel.org
> Sent: Thursday, February 18, 2021 2:30:38 PM
> Subject: Re: [PATCH v2] common/rc: add filter in _test_inode_flag
> 
> On 2021/2/10 16:34, XiaoLi Feng wrote:
> > From: Xiaoli Feng <xifeng@redhat.com>
> >
> > 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(-)
> >
> > diff --git a/common/rc b/common/rc
> > index 649b1cfd..f3bb665e 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -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?

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

> 
> Best Regards,
> Xiao Yang
> >  		return 0
> >  	fi
> >  	return 1
> 
> 
> 
>
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 649b1cfd..f3bb665e 100644
--- a/common/rc
+++ b/common/rc
@@ -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