Commit f596aeef authored by Andrew Morton's avatar Andrew Morton Committed by Jens Axboe

[PATCH] blkdev_get_block fix

Patch from Hugh Dickins <hugh@veritas.com>

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.
parent ba3d6419
......@@ -308,6 +308,7 @@ struct block_device *bdget(dev_t dev)
new_bdev->bd_dev = dev;
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment