Skip to contentSkip to conversation

common/rc: filter uncertain stat error output

PATCH In review Zorro Lang 3 participants 3 messages Dec 9, 2020

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 common/rc: filter uncertain stat error output

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.

---
 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)
common/rc +6 -0
index b5a504e0..95def920 100644
@@ -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
 
 ################################################################################
Signature · 1 line
2.25.4
#1 lore raw

common/rc _getcap() · line 4353

Quoted 6 lines
common/rc +6 -0
+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,

Signature · 4 lines
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
#2 lore raw
In reply to Zorro Lang
Quoted 9 lines · Zorro Lang

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.

Murphy Zhou already sent a patch to filter this.

--D

Quoted 24 lines
---
 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)
common/rc +6 -0
index b5a504e0..95def920 100644
@@ -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
 
 ################################################################################
Signature · 1 line
2.25.4