mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
pstore: Remove needless lock during console writes
commitb77fa617a2upstream. Since the console writer does not use the preallocated crash dump buffer any more, there is no reason to perform locking around it. Fixes:70ad35db33("pstore: Convert console write to use ->write_buf") Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7a28b74256
commit
d80d6f65fb
@@ -597,31 +597,14 @@ static void pstore_unregister_kmsg(void)
|
||||
#ifdef CONFIG_PSTORE_CONSOLE
|
||||
static void pstore_console_write(struct console *con, const char *s, unsigned c)
|
||||
{
|
||||
const char *e = s + c;
|
||||
struct pstore_record record;
|
||||
|
||||
while (s < e) {
|
||||
struct pstore_record record;
|
||||
unsigned long flags;
|
||||
pstore_record_init(&record, psinfo);
|
||||
record.type = PSTORE_TYPE_CONSOLE;
|
||||
|
||||
pstore_record_init(&record, psinfo);
|
||||
record.type = PSTORE_TYPE_CONSOLE;
|
||||
|
||||
if (c > psinfo->bufsize)
|
||||
c = psinfo->bufsize;
|
||||
|
||||
if (oops_in_progress) {
|
||||
if (!spin_trylock_irqsave(&psinfo->buf_lock, flags))
|
||||
break;
|
||||
} else {
|
||||
spin_lock_irqsave(&psinfo->buf_lock, flags);
|
||||
}
|
||||
record.buf = (char *)s;
|
||||
record.size = c;
|
||||
psinfo->write(&record);
|
||||
spin_unlock_irqrestore(&psinfo->buf_lock, flags);
|
||||
s += c;
|
||||
c = e - s;
|
||||
}
|
||||
record.buf = (char *)s;
|
||||
record.size = c;
|
||||
psinfo->write(&record);
|
||||
}
|
||||
|
||||
static struct console pstore_console = {
|
||||
|
||||
Reference in New Issue
Block a user