Skip to contentSkip to conversation

fstests: fix _repair_scratch_fs error reporting

PATCH In review Amir Goldstein 2 participants 2 messages May 28, 2019 – May 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fstests: fix _repair_scratch_fs error reporting

_dump_err2() helper was introduced over two years ago and it broke the error reporting from _repair_scratch_fs.

Every test that runs:
_repair_scratch_fs >> $seqres.full

and expect to fail if anything is written to stderr is not working as intended.

---

Eryu,

This bug was found by zhangyi while working on fsck.overlay patches, but it affects all filesystems. I just re-found zhangyi's fix while going through some old notes.

Amir.

 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 17b89d5d..e78e0920 100644
@@ -98,7 +98,7 @@ _dump_err_cont()
 _dump_err2()
 {
     _err_msg="$*"
-    >2& echo "$_err_msg"
+    >&2 echo "$_err_msg"
 }
 
 _log_err()
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

On 2019/5/28 20:08, Amir Goldstein Wrote:

Quoted 11 lines

_dump_err2() helper was introduced over two years ago and it broke the error reporting from _repair_scratch_fs.

Every test that runs:
_repair_scratch_fs >> $seqres.full

and expect to fail if anything is written to stderr is not working as intended.

Thanks for re-post it.

Thanks
Yi.

Quoted 27 lines

---

Eryu,

This bug was found by zhangyi while working on fsck.overlay patches, but it affects all filesystems. I just re-found zhangyi's fix while going through some old notes.

Amir.

 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 17b89d5d..e78e0920 100644
@@ -98,7 +98,7 @@ _dump_err_cont()
 _dump_err2()
 {
     _err_msg="$*"
-    >2& echo "$_err_msg"
+    >&2 echo "$_err_msg"
 }
 
 _log_err()