[Patch 6/10] dm: block size bug with 64 bit devs

From: Joe Thornber
Date: Tue Feb 10 2004 - 12:15:41 EST


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]
--- diff/drivers/md/dm.c 2004-02-10 16:11:43.000000000 +0000
+++ source/drivers/md/dm.c 2004-02-10 16:11:50.000000000 +0000
@@ -639,7 +639,7 @@
bdev = bdget_disk(disk, 0);
if (bdev) {
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);
bdput(bdev);
}
-
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/