在 2024/8/26 21:44, Filipe Manana 写道:
[...]
+ # Manually check the dmesg for "BUG", and do not call _check_dmesg()
+ # as it will clear 'check_dmesg' file and skips the final check after
+ # the test.
+ # For now just focus on the "BUG:" line from KASAN.
+ if _check_dmesg_for "BUG" ; then
+ _fail "Critical error(s) found in dmesg"
+ fi
Why do the check manually? The check script calls _check_dmesg when a
test finishes and if it finds 'BUG:' there, it will make the test
fail.
So there's no need to do the unmount and call _check_dmesg_for.
The main reasons are:
1. Fail the test as soon as possible
Mostly to let the dmesg to contain only the failed iteration.
I found it especially useful to stop immediately to inspect the
dmesg, during the verification of my fix.
This doesn't make too much difference for routine QA runs, but in the
future if some regression happened and one (maybe myself) is going to
investigate the failure, this early exit will make life much easier.
2. To avoid too small dmesg buffer
Since each iteration will trigger some error message due to the
corrupted tree blocks, combined with the 32 runs, I'm not that
confident all dmesg buffer size can save all the dmesg.
Hopes this explains the reasons well.
Thanks,
Qu
Thanks.
+done
+
+echo "Silence is golden"
+
+# success, all done
+status=0
+exit
diff --git a/tests/btrfs/319.out b/tests/btrfs/319.out
new file mode 100644
index 00000000..d40c929a
--- /dev/null
+++ b/tests/btrfs/319.out
@@ -0,0 +1,2 @@
+QA output created by 319
+Silence is golden
--
2.46.0