[dm-devel] [PATCH] Fix __set_size for 32 bit sector_t

Christophe Saout christophe at saout.de
Sat Jan 10 15:06:01 UTC 2004


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.


--- linux.orig/drivers/md/dm.c	2004-01-10 15:21:10.000000000 +0100
+++ linux/drivers/md/dm.c	2004-01-10 20:42:04.677696216 +0100
@@ -716,7 +716,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);
 	}





More information about the dm-devel mailing list