public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Anders Grafström" <grfstrm@users.sourceforge.net>
To: David Woodhouse <dwmw2@infradead.org>
Cc: nickpiggin@yahoo.com.au, joern@logfs.org,
	linux-mtd@lists.infradead.org,
	Alexey Korolev <akorolev@infradead.org>,
	akpm@linux-foundation.org
Subject: Re: [BUG] JFFS2 usage of write_begin and write_end functions	causes kernel panic
Date: Mon, 28 Apr 2008 22:00:16 +0200	[thread overview]
Message-ID: <48162CD0.4070702@users.sourceforge.net> (raw)
In-Reply-To: <48120242.9020908@users.sourceforge.net>

Anders Grafström wrote:
> The panic occurs at fs/jffs2/file.c:251 which is
> BUG_ON(!PageUptodate(pg));
> 
> Data CRC 33c102e9 != calculated CRC 0ef77e7b for node at 005d42e4

I think this issue might be a sideeffect of (or related to) the erase suspend problems
I'm having. Sometimes there are data CRC errors.
The error is propagated upwards from jffs2_read_dnode to jffs2_do_readpage_nolock
which calls ClearPageUptodate and returns 0 then jffs2_write_end traps on !PageUptodate.

I hope this illustrates the scenario:

jffs2_write_begin {
     jffs2_do_readpage_nolock {
         jffs2_read_inode_range {
             jffs2_read_dnode -> Data CRC 33c102e9 != calculated CRC 0ef77e7b for node at 005d42e4
         }
         ClearPageUptodate(pg);
         return 0
     }
}

jffs2_write_end {
     BUG_ON(!PageUptodate(pg));
}

Should the error value perhaps be forwarded upwards?
Would that inadvertently prevent a broken node from being replaced by a new one?

diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 5e92034..a146bf4 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -99,7 +99,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
  	kunmap(pg);

  	D2(printk(KERN_DEBUG "readpage finished\n"));
-	return 0;
+	return ret;
  }

  int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg)

      parent reply	other threads:[~2008-04-28 20:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 16:53 [BUG] JFFS2 usage of write_begin and write_end functions causes kernel panic Alexey Korolev
2008-04-10 17:18 ` Jean Pihet
2008-04-10 18:35   ` Joakim Tjernlund
2008-04-10 18:51     ` Jean Pihet
2008-04-10 18:56       ` Joakim Tjernlund
2008-04-11 18:00   ` Alexey Korolev
2008-04-11 18:05     ` Artem Bityutskiy
2008-04-13 10:50       ` Jörn Engel
2008-04-13 12:42         ` David Woodhouse
2008-04-14  8:25         ` Alexander Belyakov
2008-04-12 13:31     ` Joakim Tjernlund
2008-04-12 14:48 ` David Woodhouse
2008-04-14 16:09   ` Alexey Korolev
2008-04-14 17:08     ` Alexey Korolev
2008-04-24 21:10       ` Anders Grafström
2008-04-24 22:15         ` David Woodhouse
2008-04-25 10:04           ` Alexey Korolev
2008-04-25 16:09           ` Anders Grafström
2008-04-26 14:52             ` David Woodhouse
2008-04-28 20:00             ` Anders Grafström [this message]

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=48162CD0.4070702@users.sourceforge.net \
    --to=grfstrm@users.sourceforge.net \
    --cc=akorolev@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=joern@logfs.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nickpiggin@yahoo.com.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox