summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorLi Pengcheng <lipengcheng8@huawei.com>2016-11-05 10:15:59 +0800
committerKees Cook <keescook@chromium.org>2016-11-08 16:44:33 -0800
commit959217c84c2765434cd2cbf3d7ffdc09e90834f9 (patch)
tree21a2ac73eabb5a19694a617440a51e2cdd650a5c /fs/pstore
parent07d9a380680d1c0eb51ef87ff2eab5c994949e69 (diff)
pstore: Actually give up during locking failure
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>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 14984d902a99..60e6db6f5da2 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -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);