generic/310: make ext[2-4] error patterns more specific
PATCH 1/1 generic/310: make ext[2-4] error patterns more specific
This test watches for ext[2-4] filesystem errors in kernel messages but it incorrectly identifies unrelated messages that contain string "error" as a failure condition.
Make grep pattern more specific to catch only relevant messages.
--- tests/generic/310 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/310 +2 -2
@@ -62,7 +62,7 @@ _require_test dmesg -c > /dev/null nr_bug=`dmesg | grep -c "kernel BUG"` -nr_error=`dmesg | grep -c "error"` +nr_error=`dmesg | grep -c "EXT[234]-fs .*error"` nr_null=`dmesg | grep -c "kernel NULL pointer dereference"` nr_warning=`dmesg | grep -c "^WARNING"` nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
@@ -71,7 +71,7 @@ nr_lockdep=`dmesg | grep -c "possible recursive locking detected"` check_kernel_bug() { new_bug=`dmesg | grep -c "kernel BUG"` - new_error=`dmesg | grep -c "error"` + new_error=`dmesg | grep -c "EXT[234]-fs .*error"` new_null=`dmesg | grep -c "kernel NULL pointer dereference"` new_warning=`dmesg | grep -c "^WARNING"` new_lockdep=`dmesg | grep -c "possible recursive locking detected"`
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
Quoted 7 lines · Tahsin Erdogan
This test watches for ext[2-4] filesystem errors in kernel messages but it incorrectly identifies unrelated messages that contain string "error" as a failure condition.
Make grep pattern more specific to catch only relevant messages.
Signed-off-by Tahsin Erdogan <[email protected]>
The problem is this is a "generic" test, so it will be run on file systems other than just ext[234]. So making the regexp's specific to just ext[234] is probably going to be something acceptable for xfstests upstream.
(For context, the problem was that there were some kernel messages coming fom an i2c device driver that happened to be spit out while generic/310 was running, this was causing a false test failure.)
Alternate possible fixes:
(1) we could make an ext4 version of this test, and then make generic/310 not run for ext4. In that case we can use the EXT[234]-fs specific error.
(2) we can fiter out the i2c error in generic/310
(3) we can figure out why the i2c device driver is randomly spitting out errors and ask the team responsible for that driver to fix _that_ bug
(4) we can try to enumerate the file system specific error messages instead of assuming that any random kernel message that happens to contain the string "error" automatically means that there is a file system problem.
We should probably do (3) no matter what, and arguably generic/310 is a badly written test and if there is some way we can do (4), that would be desirable. As a fall back, we could do (2), and see if that is acceptable for xfstests upstream.
Cheers,
- Ted
Quoted 30 lines · Theodore Ts'o
Quoted 7 lines · Tahsin Erdogan
This test watches for ext[2-4] filesystem errors in kernel messages but it incorrectly identifies unrelated messages that contain string "error" as a failure condition.
Make grep pattern more specific to catch only relevant messages.
Signed-off-by Tahsin Erdogan <[email protected]>The problem is this is a "generic" test, so it will be run on file systems other than just ext[234]. So making the regexp's specific to just ext[234] is probably going to be something acceptable for xfstests upstream.
(For context, the problem was that there were some kernel messages coming fom an i2c device driver that happened to be spit out while generic/310 was running, this was causing a false test failure.)
Alternate possible fixes:
(1) we could make an ext4 version of this test, and then make generic/310 not run for ext4. In that case we can use the EXT[234]-fs specific error.
(2) we can fiter out the i2c error in generic/310
(3) we can figure out why the i2c device driver is randomly spitting out errors and ask the team responsible for that driver to fix _that_ bug
Quoted 6 lines
(4) we can try to enumerate the file system specific error messages instead of assuming that any random kernel message that happens to contain the string "error" automatically means that there is a file system problem.
We should probably do (3) no matter what,
Yes.
Quoted 3 lines
and arguably generic/310 is
a badly written test and if there is some way we can do (4), that would be desirable.
Well, it should really just use the test harness' dmesg checking. i.e. all that explicit reading and checking for error types can just go away completely, as the test harness with capture errors/warnings/bugs that are emitted to dmesg during the test run and fail the test.
Quoted 2 lines
As a fall back, we could do (2), and see if that
is acceptable for xfstests upstream.
No. filtering dmesg errors from random drivers/subsystems on random kernels is a path we are not going to walk down.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]