diff mbox series

common/rc: filter uncertain stat error output

Message ID 20201209140738.1057460-1-zlang@redhat.com (mailing list archive)
State New, archived
Headers show
Series common/rc: filter uncertain stat error output | expand

Commit Message

Zorro Lang Dec. 9, 2020, 2:07 p.m. UTC
The xfs/348 start to fail with latest coreutils' stat command, the
mismatched part likes below:

  -stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
  +stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning

So filter 'statx' to 'stat' to prevent the golden image broken.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Aurélien Aptel Dec. 9, 2020, 2:27 p.m. UTC | #1
> +stat()
> +{
> +	# filter uncertain "statx/stat" error output
> +	command stat $@ 2> >(sed -e 's/statx/stat/' >&2)
> +}
> +

I think $@ be quoted like so "$@" so as to handle

    stat "a a" "b b"

properly

Cheers,
Darrick J. Wong Dec. 9, 2020, 7:28 p.m. UTC | #2
On Wed, Dec 09, 2020 at 10:07:38PM +0800, Zorro Lang wrote:
> The xfs/348 start to fail with latest coreutils' stat command, the
> mismatched part likes below:
> 
>   -stat: cannot stat 'SCRATCH_MNT/test/DIR': Structure needs cleaning
>   +stat: cannot statx 'SCRATCH_MNT/test/DIR': Structure needs cleaning
> 
> So filter 'statx' to 'stat' to prevent the golden image broken.
> 
> Signed-off-by: Zorro Lang <zlang@redhat.com>

Murphy Zhou already sent a patch to filter this.

--D

> ---
>  common/rc | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index b5a504e0..95def920 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4345,6 +4345,12 @@ _getcap()
>  	return ${PIPESTATUS[0]}
>  }
>  
> +stat()
> +{
> +	# filter uncertain "statx/stat" error output
> +	command stat $@ 2> >(sed -e 's/statx/stat/' >&2)
> +}
> +
>  init_rc
>  
>  ################################################################################
> -- 
> 2.25.4
>
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index b5a504e0..95def920 100644
--- a/common/rc
+++ b/common/rc
@@ -4345,6 +4345,12 @@  _getcap()
 	return ${PIPESTATUS[0]}
 }
 
+stat()
+{
+	# filter uncertain "statx/stat" error output
+	command stat $@ 2> >(sed -e 's/statx/stat/' >&2)
+}
+
 init_rc
 
 ################################################################################