From: David Woodhouse <dwmw2@infradead.org>
To: simon@baydel.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: oops line 231 of latest readinode.c
Date: Sat, 20 Nov 2004 18:04:28 +0000 [thread overview]
Message-ID: <1100973868.7949.32.camel@localhost.localdomain> (raw)
In-Reply-To: <6BEF91EC1C3A@baydel.com>
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
On Wed, 2004-11-17 at 15:56 +0000, Simon Haynes wrote:
> In my case all arguments appear to be valid kernel addresses. The call to
> jffs2_lookup_node_frag returns a 0. So the 'if (this)' takes the else route
> and lastend is set to 0. We then execute the code in if (lastend <=
> newfrag->ofs)' and then in the next if as newfrag->ofs contains -1. The oops
> is produced by the line 'if(this->node)' because this is 0. I have checked
> this against the latest CVS code and it would seem that this could still
> happen.
>
> I don't really know the flow of the code here but could I just put
> 'if(this)' in front of 'if(this->node)' or is there some other more serious
> problem here.
Looks like a correct diagnosis and cure; thanks.
This can only happen
if ((lastend-1) >> PAGE_CACHE_SHIFT == newfrag->ofs >> PAGE_CACHE_SHIFT)
That's if you have no previous nodes in the fragtree, and the _first_
node it finds is in the range 0xFFFFF000-0xFFFFFFFF (the last possible
page of the file).
Do you have a file with data in that range? This will trigger only if
garbage collection has happened such that a node in that range is the
one with the lowest version number.
Actually I'm not going to make it also depend on (this) but on (lastend)
since it keeps the logic in the above statement consistent, and has much
the same effect.
--
dwmw2
[-- Attachment #2: Attached message - mtd/fs/jffs2 readinode.c,1.116,1.117 --]
[-- Type: message/rfc822, Size: 3441 bytes --]
From: David Woodhouse <dwmw2@infradead.org>
To: linux-mtd-cvs@lists.infradead.org
Subject: mtd/fs/jffs2 readinode.c,1.116,1.117
Date: Sat, 20 Nov 2004 18:06:57 +0000
Message-ID: <E1CVZdR-0005FE-0x@phoenix.infradead.org>
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv20158
Modified Files:
readinode.c
Log Message:
Fix oops if we happen to have a node in the range 0xfffff000 onwards as the
lowest versioned node in the inode.
Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- readinode.c 16 Nov 2004 20:36:12 -0000 1.116
+++ readinode.c 20 Nov 2004 18:06:54 -0000 1.117
@@ -227,7 +227,7 @@
If so, both 'this' and the new node get marked REF_NORMAL so
the GC can take a look.
*/
- if ((lastend-1) >> PAGE_CACHE_SHIFT == newfrag->ofs >> PAGE_CACHE_SHIFT) {
+ if (lastend && (lastend-1) >> PAGE_CACHE_SHIFT == newfrag->ofs >> PAGE_CACHE_SHIFT) {
if (this->node)
mark_ref_normal(this->node->raw);
mark_ref_normal(newfrag->node->raw);
__________________________________________________________
Linux-MTD CVS commit list
http://lists.infradead.org/mailman/listinfo/linux-mtd-cvs/
prev parent reply other threads:[~2004-11-20 18:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-17 15:56 oops line 231 of latest readinode.c Simon Haynes
2004-11-17 17:33 ` Artem B. Bityuckiy
2004-11-17 17:48 ` Estelle HAMMACHE
2004-11-17 18:02 ` Simon Haynes
2004-11-20 18:04 ` David Woodhouse [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=1100973868.7949.32.camel@localhost.localdomain \
--to=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=simon@baydel.com \
/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