Re: [PATCH] i_blkbits inconsistency

Andrew Morton (akpm@digeo.com)
Fri, 25 Oct 2002 14:38:25 -0700


Hugh Dickins wrote:
>
> 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;

Thanks, sleuth. Wondering if we can we remove bd_block_size
and simply use (1 << bdev->bd_inode->i_blkbits) everywhere?
-
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/