kdb: Switch to nolock variants of kmsg_dump functions
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Sat, 21 Jul 2012 00:28:25 +0000 (17:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Jul 2012 17:34:00 +0000 (10:34 -0700)
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>
kernel/debug/kdb/kdb_main.c

index df17c935d3c6f5dec94b9e8f349cf9b895fd75d5..1f91413edb87d0c9b77efc4e84c9b2f9729e9b8c 100644 (file)
@@ -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) {
@@ -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;