From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCE88C4361B for ; Sun, 20 Dec 2020 14:41:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EEA62229C for ; Sun, 20 Dec 2020 14:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727628AbgLTOla (ORCPT ); Sun, 20 Dec 2020 09:41:30 -0500 Received: from out20-97.mail.aliyun.com ([115.124.20.97]:33899 "EHLO out20-97.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgLTOla (ORCPT ); Sun, 20 Dec 2020 09:41:30 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1220281|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0397697-0.00175583-0.958474;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047209;MF=guan@eryu.me;NM=1;PH=DS;RN=2;RT=2;SR=0;TI=SMTPD_---.J9NV6Xm_1608475241; Received: from localhost(mailfrom:guan@eryu.me fp:SMTPD_---.J9NV6Xm_1608475241) by smtp.aliyun-inc.com(10.147.42.241); Sun, 20 Dec 2020 22:40:41 +0800 Date: Sun, 20 Dec 2020 22:40:41 +0800 From: Eryu Guan To: Murphy Zhou Cc: fstests@vger.kernel.org Subject: Re: [PATCH] common/filter: add _filter_stat Message-ID: <20201220144041.GZ3853@desktop> References: <20201208020442.16307-1-jencce.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201208020442.16307-1-jencce.kernel@gmail.com> Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org On Tue, Dec 08, 2020 at 10:04:42AM +0800, Murphy Zhou wrote: > New stat(2) starts to use statx(7) call. Then if file does not > exist, it breaks golden output like this: > > -stat: cannot stat 'SCRATCH_MNT/xxx': No such file or directory > +stat: cannot statx 'SCRATCH_MNT/xxx': No such file or directory > > Add this filter to fix it, and add this filter to testcases that > need it. > > Signed-off-by: Murphy Zhou > --- > common/filter | 6 ++++++ > tests/generic/397 | 6 +++--- > tests/generic/435 | 2 +- > tests/generic/440 | 2 +- > tests/xfs/348 | 2 +- > 5 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/common/filter b/common/filter > index a8b3882f..6fbf70c2 100644 > --- a/common/filter > +++ b/common/filter > @@ -510,6 +510,12 @@ _filter_mv() > sed -e "s/^renamed //" > } > > +# New stat(2) uses statx(7) > +_filter_stat() > +{ > + sed -e "s/cannot statx/cannot stat/" > +} > + Thanks for the fix! But I think maybe it's better to filter 'stat' to 'statx' (and update the affected .out files accordingly), so that when all distros pick up the new behavior we may eventually remove this filter, or at least we won't see failures if new tests forget to use _filter_stat, as no-one is testing with old distros. Thanks, Eryu > _filter_lostfound() > { > sed -e '/^lost+found$/d' > diff --git a/tests/generic/397 b/tests/generic/397 > index 97111555..bb4de31c 100755 > --- a/tests/generic/397 > +++ b/tests/generic/397 > @@ -83,8 +83,8 @@ _unlink_session_encryption_key $keydesc > _scratch_cycle_mount > > # Check that unencrypted names aren't there > -stat $SCRATCH_MNT/edir/empty |& _filter_scratch > -stat $SCRATCH_MNT/edir/symlink |& _filter_scratch > +stat $SCRATCH_MNT/edir/empty |& _filter_stat |& _filter_scratch > +stat $SCRATCH_MNT/edir/symlink |& _filter_stat |& _filter_scratch > > # Check that the correct numbers of files and subdirectories are there > ls $SCRATCH_MNT/edir | wc -l > @@ -106,7 +106,7 @@ ln -s foo $SCRATCH_MNT/edir/0123456789abcdef |& _filter_scratch > > # Delete the encrypted directory (should succeed) > rm -r $SCRATCH_MNT/edir > -stat $SCRATCH_MNT/edir |& _filter_scratch > +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch > > # success, all done > status=0 > diff --git a/tests/generic/435 b/tests/generic/435 > index 9f54c6c4..71c5a3f0 100755 > --- a/tests/generic/435 > +++ b/tests/generic/435 > @@ -73,7 +73,7 @@ _scratch_cycle_mount > # and ext4 reported a "Structure needs cleaning" error when removing files. > find $SCRATCH_MNT/edir/ -type f | xargs stat -c %i | sort | uniq | wc -l > rm -rf $SCRATCH_MNT/edir |& head -n 10 > -stat $SCRATCH_MNT/edir |& _filter_scratch > +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch > > # success, all done > status=0 > diff --git a/tests/generic/440 b/tests/generic/440 > index d775f1e0..8a81d60a 100755 > --- a/tests/generic/440 > +++ b/tests/generic/440 > @@ -87,7 +87,7 @@ _scratch_cycle_mount > cat $SCRATCH_MNT/edir2/link > exec 3< $SCRATCH_MNT/edir2/link # pin inode with cached key in memory > _unlink_session_encryption_key $keydesc > -stat $SCRATCH_MNT/edir/file |& _filter_scratch > +stat $SCRATCH_MNT/edir/file |& _filter_stat |& _filter_scratch > cat "$(find $SCRATCH_MNT/edir/ -type f)" > exec 3>&- > > diff --git a/tests/xfs/348 b/tests/xfs/348 > index 194d9f99..208382fb 100755 > --- a/tests/xfs/348 > +++ b/tests/xfs/348 > @@ -112,7 +112,7 @@ for dt in $dtypes; do > rm -f $tmp.stat.err > ftype=$(stat --printf=%F $testdir/$file 2>$tmp.stat.err) > if [ -s $tmp.stat.err ]; then > - cat $tmp.stat.err > + cat $tmp.stat.err | _filter_stat > else > echo "stat: '$testdir/$file' is a $ftype" > # Verify that readlink of a file posing as a symlink > -- > 2.20.1