summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorKees Cook2018-11-01 22:08:07 +0100
committerKees Cook2018-12-04 01:52:35 +0100
commitb77fa617a2ff4d6beccad3d3d4b3a1f2d10368aa (patch)
tree7c5c4003dc08ab456eb0a8fb05f05b6e5b320c74 /fs/pstore
parentpstore: Do not use crash buffer for decompression (diff)
downloadkernel-qcow2-linux-b77fa617a2ff4d6beccad3d3d4b3a1f2d10368aa.tar.gz
kernel-qcow2-linux-b77fa617a2ff4d6beccad3d3d4b3a1f2d10368aa.tar.xz
kernel-qcow2-linux-b77fa617a2ff4d6beccad3d3d4b3a1f2d10368aa.zip
pstore: Remove needless lock during console writes
Since the console writer does not use the preallocated crash dump buffer any more, there is no reason to perform locking around it. Fixes: 70ad35db3321 ("pstore: Convert console write to use ->write_buf") Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 8b6028948cf3..a75756c48e10 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -462,31 +462,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;
-
- if (c > psinfo->bufsize)
- c = psinfo->bufsize;
+ pstore_record_init(&record, psinfo);
+ record.type = PSTORE_TYPE_CONSOLE;
- 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 = {