lvm2/dab3ebce-devices-Do-not-support-unpartitioned-DASD.patch
2015-02-11 13:05:50 +00:00

59 lines
1.7 KiB
Diff

Index: LVM2.2.02.114/lib/device/dev-type.c
===================================================================
--- LVM2.2.02.114.orig/lib/device/dev-type.c
+++ LVM2.2.02.114/lib/device/dev-type.c
@@ -112,6 +112,10 @@ struct dev_types *create_dev_types(const
if (!strncmp("drbd", line + i, 4) && isspace(*(line + i + 4)))
dt->drbd_major = line_maj;
+ /* Look for DASD */
+ if (!strncmp("dasd", line + i, 4) && isspace(*(line + i + 4)))
+ dt->dasd_major = line_maj;
+
/* Look for EMC powerpath */
if (!strncmp("emcpower", line + i, 8) && isspace(*(line + i + 8)))
dt->emcpower_major = line_maj;
@@ -203,6 +207,9 @@ int dev_subsystem_part_major(struct dev_
if (MAJOR(dev->dev) == dt->emcpower_major)
return 1;
+ if (MAJOR(dev->dev) == dt->dasd_major)
+ return 1;
+
if (MAJOR(dev->dev) == dt->power2_major)
return 1;
@@ -222,6 +229,9 @@ const char *dev_subsystem_name(struct de
if (MAJOR(dev->dev) == dt->drbd_major)
return "DRBD";
+ if (MAJOR(dev->dev) == dt->dasd_major)
+ return "DASD";
+
if (MAJOR(dev->dev) == dt->emcpower_major)
return "EMCPOWER";
@@ -319,6 +329,10 @@ int dev_is_partitioned(struct dev_types
if (!_is_partitionable(dt, dev))
return 0;
+ /* Unpartitioned DASD devices are not supported. */
+ if (MAJOR(dev->dev) == dt->dasd_major)
+ return 1;
+
return _has_partition_table(dev);
}
Index: LVM2.2.02.114/lib/device/dev-type.h
===================================================================
--- LVM2.2.02.114.orig/lib/device/dev-type.h
+++ LVM2.2.02.114/lib/device/dev-type.h
@@ -44,6 +44,7 @@ struct dev_types {
int device_mapper_major;
int emcpower_major;
int power2_major;
+ int dasd_major;
struct dev_type_def dev_type_array[NUMBER_OF_MAJORS];
};