[PATCH] dm: Allow tables to have devices with zero size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mike Anderson <andmike@xxxxxxxxxx>

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@xxxxxxxxxx>
---

 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;
 }
 
 /*

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux