{"id":299,"url":"http://patchwork.ozlabs.org/api/1.0/patches/299/?format=json","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.0/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20080916081013.GD29650@edgar.se.axis.com>","date":"2008-09-16T08:10:13","name":"mtdoops at panic","commit_ref":null,"pull_url":null,"state":"new","archived":true,"hash":"fe5b9a21916f5856807e4f1124a856907a1af02f","submitter":{"id":155,"url":"http://patchwork.ozlabs.org/api/1.0/people/155/?format=json","name":"Edgar E. Iglesias","email":"edgar.iglesias@axis.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20080916081013.GD29650@edgar.se.axis.com/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/299/checks/","tags":{},"headers":{"Return-Path":"<linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org>","X-Original-To":"patchwork@ozlabs.org","Delivered-To":"patchwork@ozlabs.org","Received":["from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id EB406DDF37\n\tfor <patchwork@ozlabs.org>; Tue, 16 Sep 2008 19:05:04 +1000 (EST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfWUB-0000l5-Mr; Tue, 16 Sep 2008 09:04:39 +0000","from bart.se.axis.com ([195.60.68.10])\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfVda-0004c2-3I\n\tfor linux-mtd@lists.infradead.org; Tue, 16 Sep 2008 08:10:18 +0000","from bart.se.axis.com (bart.se.axis.com [127.0.0.1])\n\tby bart.se.axis.com (Postfix) with ESMTP id 8B1396407C\n\tfor <linux-mtd@lists.infradead.org>;\n\tTue, 16 Sep 2008 10:10:13 +0200 (CEST)","from axis.com (edgar.se.axis.com [10.93.151.1])\n\tby bart.se.axis.com (Postfix) with ESMTP id 750AD63F20\n\tfor <linux-mtd@lists.infradead.org>;\n\tTue, 16 Sep 2008 10:10:13 +0200 (CEST)","(qmail 4125 invoked by uid 400); 16 Sep 2008 08:10:13 -0000"],"Date":"Tue, 16 Sep 2008 10:10:13 +0200","From":"\"Edgar E. Iglesias\" <edgar.iglesias@axis.com>","To":"linux-mtd@lists.infradead.org","Subject":"[PATCH] mtdoops at panic","Message-ID":"<20080916081013.GD29650@edgar.se.axis.com>","MIME-Version":"1.0","Content-Disposition":"inline","User-Agent":"Mutt/1.5.16 (2007-06-09)","X-Spam-Score":"0.0 (/)","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.9","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linux-mtd-bounces@lists.infradead.org","Errors-To":"linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org"},"content":"Hello,\n\nWhile trying out the mtdoops module I ran into trouble when logging at panic.\nTurns out that the mtdoops_inc_counter can sleep while preparing for the next\nentry.\n\nThis small patch works fine for me.\n\nSigned-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>","diff":"diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c\nindex 5a680e1..de6d151 100644\n--- a/drivers/mtd/mtdoops.c\n+++ b/drivers/mtd/mtdoops.c\n@@ -208,7 +208,12 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)\n \t\tprintk(KERN_ERR \"mtdoops: Write failure at %d (%td of %d written), err %d.\\n\",\n \t\t\tcxt->nextpage * OOPS_PAGE_SIZE, retlen,\tOOPS_PAGE_SIZE, ret);\n \n-\tmtdoops_inc_counter(cxt);\n+\t/*\n+\t * Prepare for next log-entry. If we are in panic we'll defer this\n+\t * step to after reboot because mtdoops_inc_counter might sleep.\n+\t */\n+\tif (!panic)\n+\t\tmtdoops_inc_counter(cxt);\n }\n \n\n","prefixes":[]}