aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pstore/platform.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 6c23eab7f76c..a40da07e93d6 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -164,7 +164,13 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
164 164
165 if (c > psinfo->bufsize) 165 if (c > psinfo->bufsize)
166 c = psinfo->bufsize; 166 c = psinfo->bufsize;
167 spin_lock_irqsave(&psinfo->buf_lock, flags); 167
168 if (oops_in_progress) {
169 if (!spin_trylock_irqsave(&psinfo->buf_lock, flags))
170 break;
171 } else {
172 spin_lock_irqsave(&psinfo->buf_lock, flags);
173 }
168 memcpy(psinfo->buf, s, c); 174 memcpy(psinfo->buf, s, c);
169 psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo); 175 psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo);
170 spin_unlock_irqrestore(&psinfo->buf_lock, flags); 176 spin_unlock_irqrestore(&psinfo->buf_lock, flags);