All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@axis.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] mtdoops at panic
Date: Tue, 16 Sep 2008 10:10:13 +0200	[thread overview]
Message-ID: <20080916081013.GD29650@edgar.se.axis.com> (raw)

Hello,

While trying out the mtdoops module I ran into trouble when logging at panic.
Turns out that the mtdoops_inc_counter can sleep while preparing for the next
entry.

This small patch works fine for me.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 5a680e1..de6d151 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -208,7 +208,12 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)
 		printk(KERN_ERR "mtdoops: Write failure at %d (%td of %d written), err %d.\n",
 			cxt->nextpage * OOPS_PAGE_SIZE, retlen,	OOPS_PAGE_SIZE, ret);
 
-	mtdoops_inc_counter(cxt);
+	/*
+	 * Prepare for next log-entry. If we are in panic we'll defer this
+	 * step to after reboot because mtdoops_inc_counter might sleep.
+	 */
+	if (!panic)
+		mtdoops_inc_counter(cxt);
 }
 

                 reply	other threads:[~2008-09-16  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080916081013.GD29650@edgar.se.axis.com \
    --to=edgar.iglesias@axis.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.