[PATCH 1/1] Don't allow create ddf container on partitioned devices

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

 



Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 super-ddf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/super-ddf.c b/super-ddf.c
index c095e8a..49f7d94 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -3469,6 +3469,9 @@ validate_geometry_ddf_container(struct supertype *st,
 			       dev, strerror(errno));
 		return 0;
 	}
+	if (test_partition(fd))
+		/* DDF is not allowed on partitions */
+		return 1;
 	if (!get_dev_size(fd, dev, &ldsize)) {
 		close(fd);
 		return 0;
-- 
2.7.5




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux