[dm-devel] [PATCH] dm: Allow tables to have devices with zero size
Mike Anderson
andmike at us.ibm.com
Mon Jan 8 22:57:46 UTC 2007
From: Mike Anderson <andmike at us.ibm.com>
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 <andmike at us.ibm.com>
---
drivers/md/dm-table.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-2.6-patched/drivers/md/dm-table.c
===================================================================
--- linux-2.6-patched.orig/drivers/md/dm-table.c 2006-12-31 16:53:20.000000000 -0800
+++ linux-2.6-patched/drivers/md/dm-table.c 2007-01-08 08:15:33.000000000 -0800
@@ -432,7 +432,8 @@
{
sector_t dev_size;
dev_size = dd->bdev->bd_inode->i_size >> SECTOR_SHIFT;
- return ((start < dev_size) && (len <= (dev_size - start)));
+ return dev_size ?
+ ((start < dev_size) && (len <= (dev_size - start))) : 1;
}
/*
More information about the dm-devel
mailing list