From: Mike Anderson <[email protected]>
Allow check_device_area to succeed if a device has an i_size of zero. This
addresses an issue seen on DASD devices setting up a multipath table for
paths in online and offline state.
Signed-off-by: Mike Anderson <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
---
drivers/md/dm-table.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: linux-2.6.21/drivers/md/dm-table.c
===================================================================
--- linux-2.6.21.orig/drivers/md/dm-table.c 2007-05-01 17:40:45.000000000 +0100
+++ linux-2.6.21/drivers/md/dm-table.c 2007-05-01 17:40:50.000000000 +0100
@@ -428,13 +428,15 @@ static void close_dev(struct dm_dev *d,
}
/*
- * If possible (ie. blk_size[major] is set), this checks an area
- * of a destination device is valid.
+ * If possible, this checks an area of a destination device is valid.
*/
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 >> SECTOR_SHIFT;
+ sector_t dev_size = dd->bdev->bd_inode->i_size >> SECTOR_SHIFT;
+
+ if (!dev_size)
+ return 1;
+
return ((start < dev_size) && (len <= (dev_size - start)));
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]