Skip to contentSkip to conversation

generic/310: slightly improve check for dmesg error

PATCH In review Paulo Alcantara (SUSE) 3 participants 4 messages Mar 17, 2020 – Mar 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/310: slightly improve check for dmesg error

The 'grep -c "error"' check was causing false positive results for cifs.ko when running it with 'echo 1 > /proc/fs/cifs/cifsFYI'.

That is, the test would fail when cifs.ko prints out a non-error message like this:

  [ 2320.903987] fs/cifs/smb2maperror.c: Mapping SMB2 status code
  0x80000006 to POSIX err -61
---
 tests/generic/310 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/310 +2 -2
index 1fcd517e4e6f..504f7c44c177 100755
@@ -49,7 +49,7 @@ _require_command "$KILLALL_PROG" killall
 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"`
@@ -58,7 +58,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.25.1
#1 lore raw
Quoted 19 lines · Paulo Alcantara (SUSE)

The 'grep -c "error"' check was causing false positive results for cifs.ko when running it with 'echo 1 > /proc/fs/cifs/cifsFYI'.

That is, the test would fail when cifs.ko prints out a non-error message like this:

  [ 2320.903987] fs/cifs/smb2maperror.c: Mapping SMB2 status code
  0x80000006 to POSIX err -61
---
 tests/generic/310 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/310 +0 -0
index 1fcd517e4e6f..504f7c44c177 100755

tests/generic/310 _require_command "$KILLALL_PROG" killall · line 52

Quoted 5 lines
tests/generic/310 +1 -1
@@ -49,7 +49,7 @@ _require_command "$KILLALL_PROG" killall
 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"`

This's a generic test, which is not only for extN filesystem. If only for "fs/cifs/smb2maperror.c: Mapping SMB2 status ...", how about:
grep -wc "error"
or
grep -c "\berror"

or something better:)

I think it still works for "EXT3-fs error (device loop1): ext3_readdir:
bad entry in ....".

Thanks,
Zorro

Quoted 15 lines
tests/generic/310 +1 -1
 nr_null=`dmesg | grep -c "kernel NULL pointer dereference"`
 nr_warning=`dmesg | grep -c "^WARNING"`
 nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
@@ -58,7 +58,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.25.1
#2 lore raw
Quoted 32 lines · Zorro Lang
Quoted 19 lines · Paulo Alcantara (SUSE)

The 'grep -c "error"' check was causing false positive results for cifs.ko when running it with 'echo 1 > /proc/fs/cifs/cifsFYI'.

That is, the test would fail when cifs.ko prints out a non-error message like this:

  [ 2320.903987] fs/cifs/smb2maperror.c: Mapping SMB2 status code
  0x80000006 to POSIX err -61
---
 tests/generic/310 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/310 +0 -0
index 1fcd517e4e6f..504f7c44c177 100755

tests/generic/310 _require_command "$KILLALL_PROG" killall · line 52

Quoted 5 lines
tests/generic/310 +1 -1
@@ -49,7 +49,7 @@ _require_command "$KILLALL_PROG" killall
 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"`

This's a generic test, which is not only for extN filesystem. If only for "fs/cifs/smb2maperror.c: Mapping SMB2 status ...", how about:
grep -wc "error"
or
grep -c "\berror"

Quoted 4 lines

or something better:)

I think it still works for "EXT3-fs error (device loop1): ext3_readdir:
bad entry in ....".

Both look good to me. Thanks for pointing it out!

Eryu,

Do you want me to resend or you can just apply one of above suggestions?

#3 lore raw
Quoted 36 lines · Paulo Alcantara
Quoted 34 lines · Zorro Lang
Quoted 19 lines · Paulo Alcantara (SUSE)

The 'grep -c "error"' check was causing false positive results for cifs.ko when running it with 'echo 1 > /proc/fs/cifs/cifsFYI'.

That is, the test would fail when cifs.ko prints out a non-error message like this:

  [ 2320.903987] fs/cifs/smb2maperror.c: Mapping SMB2 status code
  0x80000006 to POSIX err -61
---
 tests/generic/310 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/310 +0 -0
index 1fcd517e4e6f..504f7c44c177 100755

tests/generic/310 _require_command "$KILLALL_PROG" killall · line 52

Quoted 5 lines
tests/generic/310 +1 -1
@@ -49,7 +49,7 @@ _require_command "$KILLALL_PROG" killall
 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"`

This's a generic test, which is not only for extN filesystem. If only for "fs/cifs/smb2maperror.c: Mapping SMB2 status ...", how about:
grep -wc "error"
or
grep -c "\berror"

or something better:)

Quoted 8 lines
Quoted 2 lines

I think it still works for "EXT3-fs error (device loop1): ext3_readdir:
bad entry in ....".

Both look good to me. Thanks for pointing it out!

Eryu,

Do you want me to resend or you can just apply one of above suggestions?

This change seems easy enough, I can fix it on commit. Thanks!

Eryu