Commit 92155747 authored by Joe Thornber's avatar Joe Thornber Committed by Linus Torvalds

[PATCH] dm: block size bug with 64 bit devs

With 32 bit sector_t the block device size _in bytes_ is also cut to
32 bit in __set_size when the block device is mount (a filesystem
mounted). The argument should be cast to loff_t before expanding the
sector count to a byte count and calling i_size_write.

[Christophe Saout]
parent 122123c4
...@@ -674,7 +674,7 @@ static void __set_size(struct gendisk *disk, sector_t size) ...@@ -674,7 +674,7 @@ static void __set_size(struct gendisk *disk, sector_t size)
bdev = bdget_disk(disk, 0); bdev = bdget_disk(disk, 0);
if (bdev) { if (bdev) {
down(&bdev->bd_inode->i_sem); down(&bdev->bd_inode->i_sem);
i_size_write(bdev->bd_inode, size << SECTOR_SHIFT); i_size_write(bdev->bd_inode, (loff_t)size << SECTOR_SHIFT);
up(&bdev->bd_inode->i_sem); up(&bdev->bd_inode->i_sem);
bdput(bdev); bdput(bdev);
} }
......
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