Skip to contentSkip to conversation

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

PATCH Zdenek Kabelac 1 participant 1 message Oct 27, 2015 Library code

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=729f489009b4dfc8488265bc64414edcfeae0755
Commit:        729f489009b4dfc8488265bc64414edcfeae0755
Parent:        5d76bdcdbdf6bef81872e8eef2cce156cfce228f
Author:        Lidong Zhong <[email protected]>
AuthorDate:    Mon Oct 12 15:09:11 2015 +0800
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Oct 27 11:42:47 2015 +0100

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.

---
 WHATS_NEW             |    1 +
 lib/Makefile.in       |    1 +
 lib/device/dev-dasd.c |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 lib/device/dev-type.c |    2 +-
 lib/device/dev-type.h |    1 +
 5 files changed, 78 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index bced219..264b3f7 100644
@@ -1,5 +1,6 @@
 Version 2.02.133 - 
 ======================================
+  Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
   For thins use flush for suspend only when volume size is reduced.
   Enable code which detects the need of flush during suspend.
   Ensure --use-policy will resize volume to fit below threshold.
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 +74 -0

74 lines not on this page · raw message

lib/device/dev-type.c +1 -1
index 1d03024..a66ef95 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