Skip to contentSkip to conversation

dm: Allow tables to have devices with zero size

PATCH New Mike Anderson 1 participant 1 message Jan 8, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: Allow tables to have devices with zero size

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.

---

 drivers/md/dm-table.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/dm-table.c +2 -1
Index: linux-2.6-patched/drivers/md/dm-table.c
===================================================================
@@ -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;
 }
 
 /*