From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261757AbTJ1WNP (ORCPT ); Tue, 28 Oct 2003 17:13:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261762AbTJ1WNP (ORCPT ); Tue, 28 Oct 2003 17:13:15 -0500 Received: from fw.osdl.org ([65.172.181.6]:26800 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S261757AbTJ1WNJ (ORCPT ); Tue, 28 Oct 2003 17:13:09 -0500 Date: Tue, 28 Oct 2003 14:13:29 -0800 From: Andrew Morton To: lkml-031028@amos.mailshell.com Cc: linux-kernel@vger.kernel.org, vs@thebsh.namesys.com, Hans Reiser Subject: Re: 2.6.0test9 Reiserfs boot time "buffer layer error at fs/buffer.c:431" Message-Id: <20031028141329.13443875.akpm@osdl.org> In-Reply-To: <20031028154920.1905.qmail@mailshell.com> References: <20031028154920.1905.qmail@mailshell.com> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org lkml-031028@amos.mailshell.com wrote: > > [1.] One line summary of the problem: > > First time boot of 2.6.0test9 on a resierfs disk gives the error above. > (buffer layer error at fs/buffer.c:431) > > ... > > block=16, b_blocknr=64 > b_state=0x00000019, b_size=1024 > buffer layer error at fs/buffer.c:431 ah-hah. > Call Trace: > [] __find_get_block_slow+0x85/0x120 > [] kernel_thread_helper+0x5/0xc > [] dump_stack+0x1c/0x20 > [] __find_get_block+0x83/0xe0 > [] __getblk_slow+0x23/0xf0 > [] __getblk+0x4f/0x60 > [] __bread+0x1f/0x40 > [] read_super_block+0x82/0x210 > [] reiserfs_fill_super+0x555/0x5a0 > [] snprintf+0x27/0x30 > [] disk_name+0x62/0xb0 > [] sb_set_blocksize+0x25/0x60 > [] get_sb_bdev+0x124/0x160 > [] get_super_block+0x2f/0x60 > [] reiserfs_fill_super+0x0/0x5a0 > [] do_kern_mount+0x5f/0xe0 > [] do_add_mount+0x78/0x150 > [] do_mount+0x124/0x170 > [] copy_mount_options+0x80/0xf0 > [] sys_mount+0xbf/0x140 > [] do_mount_root+0x2f/0xa0 > [] mount_block_root+0x54/0x120 > [] mount_root+0x5e/0x70 > [] prepare_namespace+0x1d/0xe0 > [] init+0x32/0x160 > [] init+0x0/0x160 > [] kernel_thread_helper+0x5/0xc I've been waiting a year for someone who can reproduce this. The filesystem is trying to read the 4k block at offset 16*4k. But someone had previously read the 1k block at offset 64*1k. It is an alias of the 4k read. We _should_ have shot down the four 1k-sized buffer_heads which are attached to the offset=16 pagecache page before trying to read it with 4k blocksize. But for some reason, that page still has the 1k-sized buffer_heads. This means that somehow, somewhere, we failed to successfully run set_blocksize() against that disk. Are you using initrd? Could you please add this patch, and send the new dmesg output? 25-akpm/fs/block_dev.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff -puN fs/block_dev.c~a fs/block_dev.c --- 25/fs/block_dev.c~a Tue Oct 28 14:11:20 2003 +++ 25-akpm/fs/block_dev.c Tue Oct 28 14:11:24 2003 @@ -50,17 +50,26 @@ int set_blocksize(struct block_device *b { int oldsize; + printk("%s: size=%d\n", __FUNCTION__, size); + /* Size must be a power of two, and between 512 and PAGE_SIZE */ - if (size > PAGE_SIZE || size < 512 || (size & (size-1))) + if (size > PAGE_SIZE || size < 512 || (size & (size-1))) { + printk("%s: EINVAL 1\n", __FUNCTION__); return -EINVAL; + } /* Size cannot be smaller than the size supported by the device */ - if (size < bdev_hardsect_size(bdev)) + if (size < bdev_hardsect_size(bdev)) { + printk("%s: %d < %d\n", __FUNCTION__, size, + bdev_hardsect_size(bdev)); return -EINVAL; + } oldsize = bdev->bd_block_size; - if (oldsize == size) + if (oldsize == size) { + printk("%s: %d OK\n", __FUNCTION__, size); return 0; + } /* Ok, we're actually changing the blocksize.. */ sync_blockdev(bdev); _