All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anders Grafström" <grfstrm@users.sourceforge.net>
To: David Woodhouse <dwmw2@infradead.org>,
	Linux-MTD Mailing List <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] [JFFS2] Fix return value from jffs2_do_readpage_nolock()
Date: Tue, 04 Aug 2009 13:11:47 +0200	[thread overview]
Message-ID: <4A781773.6030200@users.sourceforge.net> (raw)
In-Reply-To: <4A76FAFE.6050906@users.sourceforge.net>

[JFFS2] Fix return value from jffs2_do_readpage_nolock()

This fixes "kernel BUG at fs/jffs2/file.c:251!".
This pseudocode hopefully illustrates the scenario that triggers it:

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

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

Signed-off-by: Anders Grafström <grfstrm@users.sourceforge.net>
---

Looks like the previous post got mangled so here's another try.

 fs/jffs2/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 5edc2bf..23c9475 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)

      reply	other threads:[~2009-08-04 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 14:58 [PATCH] [JFFS2] Fix return value from jffs2_do_readpage_nolock() Anders Grafström
2009-08-04 11:11 ` 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=4A781773.6030200@users.sourceforge.net \
    --to=grfstrm@users.sourceforge.net \
    --cc=dwmw2@infradead.org \
    --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.