2002-07-25 08:55:02

by David Luyer

[permalink] [raw]
Subject: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

I attempted to mkfs and use a whole disk rather than a partition
with reiserfs. It failed (not a major problem, I'll just make a
partition), but it failed with a "kernel BUG" message, so here 'tis.

A subsequent attempt to cfdisk the same disk hung and refused
to die even with a kill -9.

Here's the hung cfdisk (fdisk could touch the disk while this
is hung).

root@praxis8:~# ps lx | grep cfdisk
100 0 469 312 15 0 1852 692 rwsem_ D pts/0 0:00
cfdisk /dev/sdb
100 0 513 476 16 0 1336 428 pipe_w S pts/1 0:00
grep cfdisk

After reboot everything worked fine.

Original commands to cause failure:
mkfs -b 8192 /dev/sdb -f
mount /dev/sdb /cache

/dev/sdb is an IBM ServeRAID array, of 4x36Gb/2=72Gb.

Jul 25 18:48:03 praxis8 kernel: kernel BUG at buffer.c:2511!
Jul 25 18:48:03 praxis8 kernel: invalid operand: 0000
Jul 25 18:48:03 praxis8 kernel: CPU: 0
Jul 25 18:48:03 praxis8 kernel: EIP: 0010:[grow_buffers+86/276]
Not tainted
Jul 25 18:48:03 praxis8 kernel: EFLAGS: 00010206
Jul 25 18:48:03 praxis8 kernel: eax: 00001e00 ebx: 00000008 ecx:
00000200 edx: f7932800
Jul 25 18:48:03 praxis8 kernel: esi: 00000010 edi: 00000810 ebp:
00000008 esp: f503fdbc
Jul 25 18:48:03 praxis8 kernel: ds: 0018 es: 0018 ss: 0018
Jul 25 18:48:03 praxis8 kernel: Process mount (pid: 466,
stackpage=f503f000)
Jul 25 18:48:03 praxis8 kernel: Stack: 00000810 00002000 00000008
f644a000 0000d100 c01387db 00000810 00000008
Jul 25 18:48:03 praxis8 kernel: 00002000 f2473280 f7558400
f7558400 c01389ec 00000810 00000008 00002000
Jul 25 18:48:03 praxis8 kernel: f24732cc c018c94c 00000810
00000008 00002000 c018235b f7558400 00000008
Jul 25 18:48:03 praxis8 kernel: Call Trace: [getblk+39/64]
[bread+24/112] [reiserfs_bread+24/28] [read_super_block+383/856]
[reiserfs_read_super+165/1124]
Jul 25 18:48:03 praxis8 kernel: [get_sb_bdev+464/584]
[alloc_vfsmnt+118/160] [do_kern_mount+85/260] [do_add_mount+105/312]
[do_mount+326/352] [copy_mount_options+85/164]
Jul 25 18:48:03 praxis8 kernel: [sys_mount+175/272]
[system_call+51/56]
Jul 25 18:48:03 praxis8 kernel:
Jul 25 18:48:03 praxis8 kernel: Code: 0f 0b cf 09 36 68 23 c0 b9 ff ff
ff ff 89 fa b6 00 90 8d 74

David.
--
David Luyer Phone: +61 3 9674 7525
Network Development Manager P A C I F I C Fax: +61 3 9699 8693
Pacific Internet (Australia) I N T E R N E T Mobile: +61 4 1111 BYTE
http://www.pacific.net.au/ NASDAQ: PCNTF


2002-07-25 09:01:12

by David Luyer

[permalink] [raw]
Subject: RE: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

Followup to my own post:

> I attempted to mkfs and use a whole disk rather than a partition
> with reiserfs. It failed (not a major problem, I'll just make a
> partition), but it failed with a "kernel BUG" message, so here 'tis.

[...]

> Original commands to cause failure:
> mkfs -b 8192 /dev/sdb -f
> mount /dev/sdb /cache

Actually looks like the -b 8192 was the problem, the same happened
on /dev/sdb1. Had to reboot again after that as mount was hanging
in the same way as cfdisk had previously. Similar 'kernel BUG'
message resulted.

David.

2002-07-25 09:43:21

by Alan

[permalink] [raw]
Subject: Re: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

On Thu, 2002-07-25 at 09:58, David Luyer wrote:
> Original commands to cause failure:
> mkfs -b 8192 /dev/sdb -f
> mount /dev/sdb /cache

That isnt supported on x86 (it exceeds page size) but the crash is
something that should not have happened and points to a missing
validation check in the reiserfs code.

Alan

2002-07-26 05:29:45

by Daniel Phillips

[permalink] [raw]
Subject: Re: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

On Thursday 25 July 2002 11:03, David Luyer wrote:
> Followup to my own post:
> > I attempted to mkfs and use a whole disk rather than a partition
> > with reiserfs. It failed (not a major problem, I'll just make a
> > partition), but it failed with a "kernel BUG" message, so here 'tis.

It was this BUG no doubt (buffer.c):

2398 /* Size must be within 512 bytes and PAGE_SIZE */
2399 if (size < 512 || size > PAGE_SIZE)
2400 BUG();

> > Original commands to cause failure:
> > mkfs -b 8192 /dev/sdb -f
> > mount /dev/sdb /cache
>
> Actually looks like the -b 8192 was the problem, the same happened
> on /dev/sdb1. Had to reboot again after that as mount was hanging
> in the same way as cfdisk had previously. Similar 'kernel BUG'
> message resulted.

It's Reiserfs's fault all right, for not recognizing the fact that
the kernel can't handle blocksize larger than the hard PAGE_SIZE.
Good thing the BUG is there now, it used to fail silently.

There is no fundamental reason why we can't handled the larger
blocksizes. It just didn't make it to the top of the list of things
to do for this cycle. For now, all the mkfs's have to accomodate
this shortcoming.

--
Daniel

2002-07-26 08:27:15

by Daniel Phillips

[permalink] [raw]
Subject: Re: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

On Friday 26 July 2002 07:33, I wrote:
> There is no fundamental reason why we can't handle the larger
> blocksizes. It just didn't make it to the top of the list of things
> to do for this cycle. For now, all the mkfs's have to accomodate
> this shortcoming.

Whoops, correction, the correct behaviour is to refuse to mount a
filesystem that has oversize blocks. Mkfs can and should go ahead and
create such things if asked to.

--
Daniel

2002-07-26 09:44:47

by Oleg Drokin

[permalink] [raw]
Subject: Re: Linux-2.4.18-rc3-ac3: bug with using whole disks as filesystems

Hello!

On Thu, Jul 25, 2002 at 07:03:11PM +1000, David Luyer wrote:

> > Original commands to cause failure:
> > mkfs -b 8192 /dev/sdb -f
> > mount /dev/sdb /cache
> Actually looks like the -b 8192 was the problem, the same happened
> on /dev/sdb1. Had to reboot again after that as mount was hanging
> in the same way as cfdisk had previously. Similar 'kernel BUG'
> message resulted.

Linux kernel 2.4 reiserfs implementation lacks support for blocksizes
different from 4096 bytes, we plan to merge it in after 2.4.19 is out.
It have all the checks needed not to allow you to mount such volumes with
too big blocksizes.

Bye,
Oleg