Skip to contentSkip to conversation

pvcreate: don't support unpartitioned DASD devices with CDL formatted

PATCH New Lidong Zhong 2 participants 2 messages Oct 12, 2015 – Oct 27, 2015 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvcreate: don't support unpartitioned DASD devices with CDL formatted

The former patch(dab3ebce4c7) is a little bit strict. For example, it is OK to create PV on unpartitioned DASD devices with LDL formatted. So after lvm version containing the patch, LVs created on those devices could not be found.

---
 lib/Makefile.in       |  1 +
 lib/device/dev-dasd.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/device/dev-type.c |  2 +-
 lib/device/dev-type.h |  1 +
 4 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 lib/device/dev-dasd.c
lib/Makefile.in +1 -0
index 3e0e6f8..00014c2 100644
@@ -62,6 +62,7 @@ SOURCES =\
 	device/dev-swap.c \
 	device/dev-type.c \
 	device/dev-luks.c \
+	device/dev-dasd.c \
 	display/display.c \
 	error/errseg.c \
 	unknown/unknown.c \
lib/device/dev-dasd.c new file +75 -0

75 lines not on this page · raw message

lib/device/dev-type.c +1 -1
index 25f11d1..75d91bb 100644
@@ -363,7 +363,7 @@ static int _native_dev_is_partitioned(struct dev_types *dt, struct device *dev)
 		return 0;
 
 	/* Unpartitioned DASD devices are not supported. */
-	if (MAJOR(dev->dev) == dt->dasd_major)
+	if ((MAJOR(dev->dev) == dt->dasd_major) && dasd_is_cdl_formatted(dev))
 		return 1;
 
 	if (!dev_open_readonly_quiet(dev)) {
lib/device/dev-type.h +1 -0
index 2a49b4b..f1d52ca 100644
@@ -59,6 +59,7 @@ int major_is_scsi_device(struct dev_types *dt, int major);
 int dev_is_md(struct device *dev, uint64_t *sb);
 int dev_is_swap(struct device *dev, uint64_t *signature);
 int dev_is_luks(struct device *dev, uint64_t *signature);
+int dasd_is_cdl_formatted(struct device *dev);
 
 /* Signature wiping. */
 #define TYPE_LVM1_MEMBER	0x001
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 pvcreate: don't support unpartitioned DASD devices with CDL formatted

Dne 12.10.2015 v 09:09 Lidong Zhong napsal(a):

Quoted 5 lines

The former patch(dab3ebce4c7) is a little bit strict. For example, it is OK to create PV on unpartitioned DASD devices with LDL formatted. So after lvm version containing the patch, LVs created on those devices could not be found.

Thanks for code, upstreamed here:

https://www.redhat.com/archives/lvm-devel/2015-October/msg00164.html

Regards

Zdenek