5/19

Joe Thornber
2002-12-16T10:01:41Z

check_device_area was comparing the bytes with sectors.
[Stefan Lauterbach]
--- diff/drivers/md/dm-table.c 2002-12-16 09:40:34.000000000 +0000
+++ source/drivers/md/dm-table.c 2002-12-16 09:40:44.000000000 +0000
@@ -388,7 +388,7 @@
static int check_device_area(struct dm_dev *dd, sector_t start, sector_t len)
{
sector_t dev_size;
- dev_size = dd->bdev->bd_inode->i_size;
+ dev_size = dd->bdev->bd_inode->i_size >> SECTOR_SHIFT;
return ((start < dev_size) && (len <= (dev_size - start)));
}

--- diff/drivers/md/dm.c 2002-11-28 11:30:39.000000000 +0000
+++ source/drivers/md/dm.c 2002-12-16 09:40:44.000000000 +0000
@@ -16,7 +16,6 @@

static const char *_name = DM_NAME;
#define MAX_DEVICES (1 << KDEV_MINOR_BITS)
-#define SECTOR_SHIFT 9

static int major = 0;
static int _major = 0;
--- diff/drivers/md/dm.h 2002-11-18 10:11:54.000000000 +0000
+++ source/drivers/md/dm.h 2002-12-16 09:40:44.000000000 +0000
@@ -29,6 +29,8 @@
#define SECTOR_FORMAT "%lu"
#endif

+#define SECTOR_SHIFT 9
+
extern struct block_device_operations dm_blk_dops;

/*