[PATCH] i_blkbits inconsistency

From: Hugh Dickins (hugh@veritas.com)
Date: Fri Oct 25 2002 - 16:01:30 EST


Fix premature -EIO from blkdev_get_block: bdget initialize bd_block_size
consistent with bd_inode->i_blkbits (assigned by new_inode). Otherwise,
subsequent set_blocksize can find bd_block_size doesn't need updating,
and skip updating i_blkbits, leaving them inconsistent.

--- 2.5.44/fs/block_dev.c Sat Oct 19 07:14:45 2002
+++ linux/fs/block_dev.c Fri Oct 25 21:30:41 2002
@@ -310,6 +310,7 @@
                         new_bdev->bd_queue = NULL;
                         new_bdev->bd_contains = NULL;
                         new_bdev->bd_inode = inode;
+ new_bdev->bd_block_size = (1 << inode->i_blkbits);
                         new_bdev->bd_part_count = 0;
                         new_bdev->bd_invalidated = 0;
                         inode->i_mode = S_IFBLK;

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



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:29 EST