pstore: Actually give up during locking failure
authorLi Pengcheng <lipengcheng8@huawei.com>
Sat, 5 Nov 2016 02:15:59 +0000 (10:15 +0800)
committerKees Cook <keescook@chromium.org>
Wed, 9 Nov 2016 00:44:33 +0000 (16:44 -0800)
Without a return after the pr_err(), dumps will collide when two threads
call pstore_dump() at the same time.

Signed-off-by: Liu Hailong <liuhailong5@huawei.com>
Signed-off-by: Li Pengcheng <lipengcheng8@huawei.com>
Signed-off-by: Li Zhong <lizhong11@hisilicon.com>
[kees: improved commit message]
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/platform.c

index 14984d902a99286ad19a27a906fa0ac2a7255613..60e6db6f5da2bfe7f8ea785504713442bedccf8e 100644 (file)
@@ -493,6 +493,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
                if (!is_locked) {
                        pr_err("pstore dump routine blocked in %s path, may corrupt error record\n"
                                       , in_nmi() ? "NMI" : why);
+                       return;
                }
        } else {
                spin_lock_irqsave(&psinfo->buf_lock, flags);