From: Zirong Lang <zlang@redhat.com>
To: XiaoLi Feng <xifeng@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v3] common/rc: add filter in _test_inode_flag
Date: Thu, 18 Feb 2021 08:41:48 -0500 (EST) [thread overview]
Message-ID: <1113713488.55294765.1613655708457.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20210218134134.GM14354@localhost.localdomain>
----- 原始邮件 -----
> 发件人: "Zorro Lang" <zlang@redhat.com>
> 收件人: "XiaoLi Feng" <xifeng@redhat.com>
> 抄送: fstests@vger.kernel.org
> 发送时间: 星期四, 2021年 2 月 18日 下午 9:41:34
> 主题: Re: [PATCH v3] common/rc: add filter in _test_inode_flag
>
> On Thu, Feb 18, 2021 at 04:57:52PM +0800, XiaoLi Feng wrote:
> > From: Xiaoli Feng <xifeng@redhat.com>
> >
> > Add _filter_testdir_and_scratch to avoid _test_inode_flag failed when
> > mount point contains flag string.
> >
> > Signed-off-by: Xiaoli Feng <xifeng@redhat.com>
> > ---
> > common/rc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/common/rc b/common/rc
> > index 649b1cfd..473188c1 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_testdir_and_scratch |
> > grep -q "$flag" ; then
>
> I can't understand that. Could you give us an example about why we need this
> filter before "quiet grep"? I think this line doesn't have any output
> (except xfs_io fails), so why a filter is needed?
Oh, I just saw your reply for V1 patch review:
"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."
The _check_xflag() function as below:
_check_xflag()
{
local target=$1
local exp_xflag=$2
if [ $exp_xflag -eq 0 ]; then
_test_inode_flag dax $target && echo "$target has unexpected FS_XFLAG_DAX flag"
else
_test_inode_flag dax $target || echo "$target doesn't have expected FS_XFLAG_DAX flag"
fi
}
Sure, if the $1 is something likes "/mnt/scratch/file", later echo "$target ...." will print "/mnt/scratch".
If you're trying to fix this issue, I think you should filter the "$target" in or behind _check_xflag(),
not in _test_inode_flag() which has no output.
Thanks,
Zorro
>
> Thanks,
> Zorro
>
> > return 0
> > fi
> > return 1
> > --
> > 2.18.1
> >
>
next prev parent reply other threads:[~2021-02-18 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 8:57 [PATCH v3] common/rc: add filter in _test_inode_flag XiaoLi Feng
2021-02-18 13:41 ` Zorro Lang
2021-02-18 13:41 ` Zirong Lang [this message]
2021-02-19 16:00 ` Xiaoli Feng
2021-02-19 16:54 ` Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1113713488.55294765.1613655708457.JavaMail.zimbra@redhat.com \
--to=zlang@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=xifeng@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox