From: "Stephen C. Tweedie" <sct@redhat.com>
To: Mark Hazell <nutts@penguinmail.com>
Cc: sct@redhat.com, akpm@zip.com.au, adilger@clusterfs.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [patch/2.4] ll_rw_blk stomping on bh state [Re: kernel BUG at journal.c:1732! (2.4.19)]
Date: Tue, 12 Nov 2002 15:07:11 +0000 [thread overview]
Message-ID: <20021112150711.F2837@redhat.com> (raw)
In-Reply-To: <20021028111357.78197071.nutts@penguinmail.com>; from nutts@penguinmail.com on Mon, Oct 28, 2002 at 11:13:57AM +0000
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
Hi,
On Mon, Oct 28, 2002 at 11:13:57AM +0000, Mark Hazell wrote:
> I got your addresses from the MAINTAINERS file in the kernel source
> tree, so apologies if i should have sent this somewhere else first.
>
> Summary: I was copying 700mb of data to my ext3 RAID-1 39gig filesystem
> (2.4gig free according to 'df') yesterday, when the kernel spewed out
> the lines at the bottom of this email.
The start of this is just anonymous disk corruption -- there's no way
I can tell how it happened, but this:
> Oct 28 02:44:14 recondo kernel: attempt to access beyond end of device
> Oct 28 02:44:14 recondo kernel: 09:00: rw=1, want=38708548,
> limit=38708544
looks like you've got a corrupt indirect block on disk somewhere which
is pointing to illegal data blocks off the end of the disk.
That said, ext3 should survive such corruption. It fails to do so
because of the core block IO code, which in generic_make_request(),
does:
if (maxsector < count || maxsector - count < sector) {
/* Yecch */
bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
and this has the unfortunate side effect of zapping key ext3 metadata
in the buffer state bits, leading up to
> Oct 28 02:44:15 recondo kernel: Assertion failure in
> __journal_remove_journal_he ad() at journal.c:1732: "buffer_jbd(bh)"
> Oct 28 02:44:15 recondo kernel: kernel BUG at journal.c:1732!
when ext3 next comes across the buffer that it knows it owns, but
which has been cleared of ext3 metadata.
The patch below fixes it for me (it's easy to reproduce --- just set
up an ext3 filesystem on an LVM device and then lvreduce it while live
to force half of the filesystem off the end of the device.)
Folks, just which buffer flags do we want to preserve in this case?
--Stephen
[-- Attachment #2: 000-buffer_clearbits.patch --]
[-- Type: text/plain, Size: 554 bytes --]
--- linux-uml-jbddebug/drivers/block/ll_rw_blk.c.=K0001=.orig Tue Nov 12 14:35:45 2002
+++ linux-uml-jbddebug/drivers/block/ll_rw_blk.c Tue Nov 12 14:35:45 2002
@@ -1129,7 +1129,9 @@
if (maxsector < count || maxsector - count < sector) {
/* Yecch */
- bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
+ bh->b_state &= ~((1 << BH_Uptodate) | (1 << BH_Dirty) |
+ (1 << BH_New) | (1 << BH_Wait_IO) |
+ (1 << BH_Launder));
/* This may well happen - the kernel calls bread()
without checking the size of the device, e.g.,
next parent reply other threads:[~2002-11-12 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20021028111357.78197071.nutts@penguinmail.com>
2002-11-12 15:07 ` Stephen C. Tweedie [this message]
2002-11-12 17:57 ` Andrew Morton
2002-11-12 18:53 ` Stephen C. Tweedie
2002-11-15 17:38 ` Stephen C. Tweedie
2002-11-15 18:05 ` Andrew Morton
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=20021112150711.F2837@redhat.com \
--to=sct@redhat.com \
--cc=adilger@clusterfs.com \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nutts@penguinmail.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