Skip to content

Commit

Permalink
pstore: Actually give up during locking failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Pengcheng authored and Kees Cook committed Nov 9, 2016
1 parent 07d9a38 commit 959217c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 959217c

Please sign in to comment.