Skip to content

Commit

Permalink
kdb: Switch to nolock variants of kmsg_dump functions
Browse files Browse the repository at this point in the history
The locked variants are prone to deadlocks (suppose we got to the
debugger w/ the logbuf lock held), so let's switch to nolock variants.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Anton Vorontsov authored and Linus Torvalds committed Jul 21, 2012
1 parent 533827c commit c064da4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/debug/kdb/kdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,8 +2072,8 @@ static int kdb_dmesg(int argc, const char **argv)
kdb_set(2, setargs);
}

kmsg_dump_rewind(&dumper);
while (kmsg_dump_get_line(&dumper, 1, NULL, 0, NULL))
kmsg_dump_rewind_nolock(&dumper);
while (kmsg_dump_get_line_nolock(&dumper, 1, NULL, 0, NULL))
n++;

if (lines < 0) {
Expand Down Expand Up @@ -2105,8 +2105,8 @@ static int kdb_dmesg(int argc, const char **argv)
if (skip >= n || skip < 0)
return 0;

kmsg_dump_rewind(&dumper);
while (kmsg_dump_get_line(&dumper, 1, buf, sizeof(buf), &len)) {
kmsg_dump_rewind_nolock(&dumper);
while (kmsg_dump_get_line_nolock(&dumper, 1, buf, sizeof(buf), &len)) {
if (skip) {
skip--;
continue;
Expand Down

0 comments on commit c064da4

Please sign in to comment.