mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christian Kujau <evil@g-house.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kernel BUG at fs/buffer.c:1270! [TAINTED]
Date: Fri, 21 May 2004 19:19:04 -0700	[thread overview]
Message-ID: <20040521191904.68544946.akpm@osdl.org> (raw)
In-Reply-To: <40AE4AAB.60008@g-house.de>

Christian Kujau <evil@g-house.de> wrote:
>
> kernel BUG at fs/buffer.c:1270!
>  invalid operand: 0000 [#1]
>  PREEMPT
>  Modules linked in: snd_pcm_oss snd_mixer_oss snd_ens1371 snd_rawmidi
>  snd_pcm snd_page_alloc snd_timer snd_ac97_codec snd soundcore ide_cd
>  cdrom isofs zlib_inflate nls_utf8 ntfs nls_iso8859_15 vfat fat nls_base
>  xfs agpgart autofs4 ipv6 8250 serial_core nvidia rtc
>  CPU:    0
>  EIP:    0060:[<c0151806>]    Tainted: P
>  EFLAGS: 00010286   (2.6.6)
>  EIP is at __getblk_slow+0x66/0xf0
>  eax: fffffe00   ebx: 00000000   ecx: 0000d200   edx: 0000d200
>  esi: 00000000   edi: dffe0740   ebp: 00008000   esp: c0d25dc8
>  ds: 007b   es: 007b   ss: 0068
>  Process mount (pid: 4585, threadinfo=c0d24000 task=dd3682b0)
>  Stack: dffe0740 00008000 00000000 00000000 00000000 00008000 dffe0740
>  00000000
>  ~       c0151bff dffe0740 00008000 00000000 00000010 00008000 df718eb8
>  c0151c8f
>  ~       dffe0740 00008000 00000000 e0ca3e79 dffe0740 00008000 00000000
>  00000000
>  Call Trace:
>  ~ [<c0151bff>] __getblk+0x4f/0x60
>  ~ [<c0151c8f>] __bread+0x1f/0x40
>  ~ [<e0ca3e79>] isofs_fill_super+0x159/0x700 [isofs]
>  ~ [<c0156235>] sb_set_blocksize+0x25/0x60
>  ~ [<c0155c3d>] get_sb_bdev+0x11d/0x150
>  ~ [<e0ca50ef>] isofs_get_sb+0x2f/0x40 [isofs]
>  ~ [<e0ca3d20>] isofs_fill_super+0x0/0x700 [isofs]
>  ~ [<c0155e8f>] do_kern_mount+0x5f/0xe0
>  ~ [<c016b0c8>] do_add_mount+0x78/0x170
>  ~ [<c016b3c4>] do_mount+0x144/0x190

This is isofs passing sinful block sizes to bread().  There's a patch in
Linus's current tree which should allow the system to survive this.  It
won't fix the root problem though, which is presumably related to those I/O
errors.


diff -puN fs/buffer.c~getblk-BUG-removal fs/buffer.c
--- 25/fs/buffer.c~getblk-BUG-removal	2004-05-21 00:50:13.353550904 -0700
+++ 25-akpm/fs/buffer.c	2004-05-21 00:50:13.359549992 -0700
@@ -1263,12 +1263,6 @@ grow_buffers(struct block_device *bdev, 
 	pgoff_t index;
 	int sizebits;
 
-	/* Size must be multiple of hard sectorsize */
-	if (size & (bdev_hardsect_size(bdev)-1))
-		BUG();
-	if (size < 512 || size > PAGE_SIZE)
-		BUG();
-
 	sizebits = -1;
 	do {
 		sizebits++;
@@ -1289,6 +1283,18 @@ grow_buffers(struct block_device *bdev, 
 struct buffer_head *
 __getblk_slow(struct block_device *bdev, sector_t block, int size)
 {
+	/* Size must be multiple of hard sectorsize */
+	if (unlikely(size & (bdev_hardsect_size(bdev)-1) ||
+			(size < 512 || size > PAGE_SIZE))) {
+		printk(KERN_ERR "getblk(): invalid block size %d requested\n",
+					size);
+		printk(KERN_ERR "hardsect size: %d\n",
+					bdev_hardsect_size(bdev));
+
+		dump_stack();
+		return NULL;
+	}
+
 	for (;;) {
 		struct buffer_head * bh;
 

_



  reply	other threads:[~2004-05-22  2:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-21 18:30 Christian Kujau
2004-05-22  2:19 ` Andrew Morton [this message]
2004-05-22 10:52   ` Christian Kujau
  -- strict thread matches above, loose matches on Subject: below --
2004-05-21 17:34 FabF
2004-05-22 10:47 ` Christian Kujau

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=20040521191904.68544946.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=evil@g-house.de \
    --cc=linux-kernel@vger.kernel.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 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®