From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: Kernel oops (bug) in fs/buffers.c:create_empty_buffers
Date: Thu, 10 Jul 2008 00:46:37 +0200 [thread overview]
Message-ID: <20080709224637.GA30008@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20080706133100.8d8ed269.akpm@linux-foundation.org>
> On Sun, 6 Jul 2008 13:23:02 -0700 Arjan van de Ven <arjan@infradead.org> wrote:
> > Hi,
> >
> > caught this one on kerneloops.org:
> > http://www.kerneloops.org/searchweek.php?search=create_empty_buffers
> >
> > void create_empty_buffers(struct page *page,
> > unsigned long blocksize, unsigned long b_state)
> > {
> > struct buffer_head *bh, *head, *tail;
> >
> > head = alloc_page_buffers(page, blocksize, 1);
> > bh = head;
> > do {
> > bh->b_state |= b_state;
> > tail = bh;
> > bh = bh->b_this_page;
> > } while (bh);
> >
> >
> > turns out, alloc_page_buffers() can fail and return NULL (for AIO for
> > example)... yet this code blindly dereferences the result, getting a
> > predictable NULL pointer fault.
> >
> > It's not directly clear what to do about... make this function return
> > the failure to the caller?
>
> isofs has a habit of returning impossible block sizes and the
>
> while ((offset -= size) >= 0) {
>
> consequently loops zero times and alloc_page_buffers() returns null.
>
> Someone was having a look at it - maybe Jan?
Yes, I was looking at that. Actually, I've pinpointed the cause of
the Oopses I've seen to a bug in ide-cd driver. It happily sets blocksize
to whatever value the drive reported and some drives have a habit of
reporting bogus values when unreadable medium is inserted.
Jens has actually cooked up a fix for this bug
(http://thread.gmane.org/gmane.linux.kernel/696582) and it fixes the
problem at least for me.
> I assume that the kernloops.org records link back to the original
> report somewhere but I can't find it?
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
prev parent reply other threads:[~2008-07-09 22:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-06 20:23 Arjan van de Ven
2008-07-06 20:31 ` Andrew Morton
2008-07-06 21:27 ` Arjan van de Ven
2008-07-09 22:46 ` Jan Kara [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=20080709224637.GA30008@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®