* [PATCH] common/filter: add _filter_stat
@ 2020-12-08 2:04 Murphy Zhou
2020-12-20 14:40 ` Eryu Guan
0 siblings, 1 reply; 6+ messages in thread
From: Murphy Zhou @ 2020-12-08 2:04 UTC (permalink / raw)
To: fstests; +Cc: Murphy Zhou
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 <jencce.kernel@gmail.com>
---
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/"
+}
+
_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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] common/filter: add _filter_stat
2020-12-08 2:04 [PATCH] common/filter: add _filter_stat Murphy Zhou
@ 2020-12-20 14:40 ` Eryu Guan
2020-12-22 7:05 ` Murphy Zhou
0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2020-12-20 14:40 UTC (permalink / raw)
To: Murphy Zhou; +Cc: fstests
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 <jencce.kernel@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] common/filter: add _filter_stat
2020-12-20 14:40 ` Eryu Guan
@ 2020-12-22 7:05 ` Murphy Zhou
2020-12-23 1:58 ` [PATCH v2] " Murphy Zhou
0 siblings, 1 reply; 6+ messages in thread
From: Murphy Zhou @ 2020-12-22 7:05 UTC (permalink / raw)
To: Eryu Guan; +Cc: Murphy Zhou, fstests
On Sun, Dec 20, 2020 at 10:40:41PM +0800, Eryu Guan wrote:
> 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 <jencce.kernel@gmail.com>
> > ---
> > 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.
Agree and Okay, this makes sense.
Thanks very much for the reviewing!
>
> 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
--
Murphy
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] common/filter: add _filter_stat
2020-12-22 7:05 ` Murphy Zhou
@ 2020-12-23 1:58 ` Murphy Zhou
0 siblings, 0 replies; 6+ messages in thread
From: Murphy Zhou @ 2020-12-23 1:58 UTC (permalink / raw)
To: fstests; +Cc: Eryu Guan, Murphy Zhou
New stat(1) starts to use statx(2) call. 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 <jencce.kernel@gmail.com>
---
v2:
filter "stat" to "statx"
common/filter | 6 ++
tests/generic/397 | 6 +-
tests/generic/397.out | 6 +-
tests/generic/435 | 2 +-
tests/generic/435.out | 2 +-
tests/generic/440 | 2 +-
tests/generic/440.out | 2 +-
tests/xfs/348 | 2 +-
tests/xfs/348.out | 188 +++++++++++++++++++++---------------------
9 files changed, 111 insertions(+), 105 deletions(-)
diff --git a/common/filter b/common/filter
index a8b3882f..2f3277f7 100644
--- a/common/filter
+++ b/common/filter
@@ -510,6 +510,12 @@ _filter_mv()
sed -e "s/^renamed //"
}
+# New stat(1) uses statx(2)
+_filter_stat()
+{
+ sed -e "s/\<cannot stat\>/cannot statx/"
+}
+
_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/397.out b/tests/generic/397.out
index 2f55c5d6..6804c7ab 100644
--- a/tests/generic/397.out
+++ b/tests/generic/397.out
@@ -1,6 +1,6 @@
QA output created by 397
-stat: cannot stat 'SCRATCH_MNT/edir/empty': No such file or directory
-stat: cannot stat 'SCRATCH_MNT/edir/symlink': No such file or directory
+stat: cannot statx 'SCRATCH_MNT/edir/empty': No such file or directory
+stat: cannot statx 'SCRATCH_MNT/edir/symlink': No such file or directory
8
1
Required key not available
@@ -10,4 +10,4 @@ mkdir: cannot create directory 'SCRATCH_MNT/edir/newdir': Required key not avail
mkdir: cannot create directory 'SCRATCH_MNT/edir/0123456789abcdef': Required key not available
ln: failed to create symbolic link 'SCRATCH_MNT/edir/newlink': Required key not available
ln: failed to create symbolic link 'SCRATCH_MNT/edir/0123456789abcdef': Required key not available
-stat: cannot stat 'SCRATCH_MNT/edir': No such file or directory
+stat: cannot statx 'SCRATCH_MNT/edir': No such file or directory
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/435.out b/tests/generic/435.out
index 9ed547dd..3628b8f9 100644
--- a/tests/generic/435.out
+++ b/tests/generic/435.out
@@ -1,4 +1,4 @@
QA output created by 435
100000
100000
-stat: cannot stat 'SCRATCH_MNT/edir': No such file or directory
+stat: cannot statx 'SCRATCH_MNT/edir': No such file or directory
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/generic/440.out b/tests/generic/440.out
index 372b7975..82b89b83 100644
--- a/tests/generic/440.out
+++ b/tests/generic/440.out
@@ -9,5 +9,5 @@ cat: SCRATCH_MNT/edir/symlink: No such file or directory
***** Child has key, but parent doesn't *****
contents
-stat: cannot stat 'SCRATCH_MNT/edir/file': No such file or directory
+stat: cannot statx 'SCRATCH_MNT/edir/file': No such file or directory
contents
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
diff --git a/tests/xfs/348.out b/tests/xfs/348.out
index 17d9be23..0d407718 100644
--- a/tests/xfs/348.out
+++ b/tests/xfs/348.out
@@ -23,13 +23,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=1 to all files:
core.mode = 010644
@@ -43,10 +43,10 @@ would have junked entry "DATA" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
stat: 'SCRATCH_MNT/test/CHRDEV' is a fifo
stat: 'SCRATCH_MNT/test/BLKDEV' is a fifo
stat: 'SCRATCH_MNT/test/FIFO' is a fifo
@@ -63,10 +63,10 @@ would have junked entry "DATA" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
stat: 'SCRATCH_MNT/test/CHRDEV' is a character special file
stat: 'SCRATCH_MNT/test/BLKDEV' is a character special file
stat: 'SCRATCH_MNT/test/FIFO' is a character special file
@@ -86,13 +86,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=4 to all files:
core.mode = 040644
@@ -109,11 +109,11 @@ would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
stat: 'SCRATCH_MNT/test/DIR' is a directory
stat: 'SCRATCH_MNT/test/DATA' is a directory
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=5 to all files:
core.mode = 050644
@@ -130,13 +130,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=6 to all files:
core.mode = 060644
@@ -150,10 +150,10 @@ would have junked entry "DATA" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
stat: 'SCRATCH_MNT/test/CHRDEV' is a block special file
stat: 'SCRATCH_MNT/test/BLKDEV' is a block special file
stat: 'SCRATCH_MNT/test/FIFO' is a block special file
@@ -173,13 +173,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=10 to all files:
core.mode = 0100644
@@ -194,13 +194,13 @@ would have junked entry "CHRDEV" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
stat: 'SCRATCH_MNT/test/DATA' is a regular file
stat: 'SCRATCH_MNT/test/EMPTY' is a regular empty file
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=11 to all files:
core.mode = 0110644
@@ -217,13 +217,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=12 to all files:
core.mode = 0120644
@@ -239,13 +239,13 @@ would have junked entry "DATA" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
stat: 'SCRATCH_MNT/test/DATA' is a symbolic link
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
stat: 'SCRATCH_MNT/test/SYMLINK' is a symbolic link
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=13 to all files:
core.mode = 0130644
@@ -262,13 +262,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=14 to all files:
core.mode = 0140644
@@ -282,10 +282,10 @@ would have junked entry "DATA" in directory PARENT_INO
would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
stat: 'SCRATCH_MNT/test/CHRDEV' is a socket
stat: 'SCRATCH_MNT/test/BLKDEV' is a socket
stat: 'SCRATCH_MNT/test/FIFO' is a socket
@@ -305,13 +305,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=16 to all files:
core.mode = 0160644
@@ -328,13 +328,13 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
===== Setting dt=17 to all files:
core.mode = 0170644
@@ -351,10 +351,10 @@ would have junked entry "DIR" in directory PARENT_INO
would have junked entry "EMPTY" in directory PARENT_INO
would have junked entry "FIFO" in directory PARENT_INO
would have junked entry "SYMLINK" in directory PARENT_INO
-stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/DATA': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
-stat: cannot stat 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/DATA': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/EMPTY': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/SYMLINK': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/CHRDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/BLKDEV': Structure needs cleaning
+stat: cannot statx 'SCRATCH_MNT/test/FIFO': Structure needs cleaning
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] common/filter: add _filter_stat
2020-12-08 10:42 [PATCH] " Murphy Zhou
@ 2021-01-10 10:07 ` Eryu Guan
0 siblings, 0 replies; 6+ messages in thread
From: Eryu Guan @ 2021-01-10 10:07 UTC (permalink / raw)
To: Murphy Zhou; +Cc: fstests
On Tue, Dec 08, 2020 at 06:42:45PM +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:
It'd be great if you could describe this behavior change starts from
which version of coreutils in commit log and in comment as well, this
may help people debug if failure is related to this change.
Otherwise patch looks good to me.
Thanks,
Eryu
>
> -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 <jencce.kernel@gmail.com>
> ---
> 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/"
> +}
> +
> _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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] common/filter: add _filter_stat
@ 2020-12-08 10:42 Murphy Zhou
2021-01-10 10:07 ` Eryu Guan
0 siblings, 1 reply; 6+ messages in thread
From: Murphy Zhou @ 2020-12-08 10:42 UTC (permalink / raw)
To: fstests
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 <jencce.kernel@gmail.com>
---
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/"
+}
+
_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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-10 10:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 2:04 [PATCH] common/filter: add _filter_stat Murphy Zhou
2020-12-20 14:40 ` Eryu Guan
2020-12-22 7:05 ` Murphy Zhou
2020-12-23 1:58 ` [PATCH v2] " Murphy Zhou
2020-12-08 10:42 [PATCH] " Murphy Zhou
2021-01-10 10:07 ` Eryu Guan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.