Re: 2.6.0test9 Reiserfs boot time "buffer layer error at fs/buffer.c:431"
From: Herbert Xu
Date: Sun Nov 02 2003 - 04:55:56 EST
On Sun, Nov 02, 2003 at 01:40:11AM -0800, Andrew Morton wrote:
>
> Where are the separated patches?
There are no separate patches. You can check the README.Debian file
for the details of the changes.
> That's 170k of stuff you're sitting on. Is there any plan to get it synced
> up?
I submit them as they come in. The bulk of the size comes from the
making IDE modules work which isn't right yet.
The rest of them which are suitable for general consumption have
been submitted previously. I will resend them later.
> No, because _something_ has to rub out the wrong-sized buffer_heads. One
> could add some new function which walks the pagecache and removes the
> buffer_heads from the pages, leaving the pages there. There doesn't seem a
> lot of point in it though?
Actually grow_dev_page will free the wrong-sized ones.
It seems that the only problem is that we don't check the size in
__find_get_block_slow(). So what about this patch?
The point of all this is to avoid unnecessary reads, and more importantly
preserve the contents of RAM disks when someone calls set_blocksize().
Cheers,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-source-2.5/fs/buffer.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/fs/buffer.c,v
retrieving revision 1.1.1.15
diff -u -r1.1.1.15 buffer.c
--- kernel-source-2.5/fs/buffer.c 8 Oct 2003 19:24:14 -0000 1.1.1.15
+++ kernel-source-2.5/fs/buffer.c 2 Nov 2003 09:54:07 -0000
@@ -400,7 +400,7 @@
* private_lock is contended then so is mapping->page_lock).
*/
static struct buffer_head *
-__find_get_block_slow(struct block_device *bdev, sector_t block, int unused)
+__find_get_block_slow(struct block_device *bdev, sector_t block, int size)
{
struct inode *bd_inode = bdev->bd_inode;
struct address_space *bd_mapping = bd_inode->i_mapping;
@@ -419,6 +419,8 @@
if (!page_has_buffers(page))
goto out_unlock;
head = page_buffers(page);
+ if (head->b_size != size)
+ goto out_unlock;
bh = head;
do {
if (bh->b_blocknr == block) {
Index: kernel-source-2.5/fs/block_dev.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/fs/block_dev.c,v
retrieving revision 1.1.1.15
retrieving revision 1.15
diff -u -r1.1.1.15 -r1.15
--- kernel-source-2.5/fs/block_dev.c 8 Oct 2003 19:24:53 -0000 1.1.1.15
+++ kernel-source-2.5/fs/block_dev.c 11 Oct 2003 06:29:24 -0000 1.15
@@ -66,7 +66,7 @@
sync_blockdev(bdev);
bdev->bd_block_size = size;
bdev->bd_inode->i_blkbits = blksize_bits(size);
- kill_bdev(bdev);
+ invalidate_bdev(bdev, 1);
return 0;
}