[PATCH] LBD fix for 2.6.3

From: Eric Sandeen
Date: Thu Mar 04 2004 - 01:12:12 EST


A couple xfs users stumbled upon this problem while trying to
use 2.6 + CONFIG_LBD on ia32 boxes - mkfs.xfs followed by
xfs_repair was failing. At first we thought it was
a raid/md problem, but it's more generic than that. There's
a problem in __block_write_full_page():

--- linux-2.6.3/fs/buffer.c.orig 2004-03-04 00:01:42.000000000 -0600
+++ linux-2.6.3/fs/buffer.c 2004-03-03 23:46:56.000000000 -0600
@@ -1738,8 +1738,8 @@
get_block_t *get_block, struct writeback_control *wbc)
{
int err;
- unsigned long block;
- unsigned long last_block;
+ sector_t block;
+ sector_t last_block;
struct buffer_head *bh, *head;
int nr_underway = 0;

later in the function we do:
last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;
and
block = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits);

... these overflow 32 bits for large devices.

The sophisticated mkfs/repair test works with that patch in place. ;)

-Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/