diff --git a/WHATS_NEW b/WHATS_NEW index 2ca6d5866..448d32b2d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.52 - ================================= + Fix pvcreate on a partition (2.02.51). Fix vgcfgrestore error paths when locking fails (2.02.49). Added configure --enable-clogd to conditionally build the cluster log daemon. Make lvchange --refresh only take a read lock on volume group. diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c index 11362340a..64d54fabb 100644 --- a/lib/device/dev-md.c +++ b/lib/device/dev-md.c @@ -137,13 +137,15 @@ static int _md_sysfs_attribute_snprintf(char *path, size_t size, if (!sysfs_dir || !*sysfs_dir) return ret; -check_md_major: - if (MAJOR(dev) != md_major()) { - if (get_primary_dev(sysfs_dir, blkdev, &dev)) - goto check_md_major; - return ret; + if (MAJOR(dev) == blkext_major()) { + /* lookup parent MD device from blkext partition */ + if (!get_primary_dev(sysfs_dir, blkdev, &dev)) + return ret; } + if (MAJOR(dev) != md_major()) + return ret; + ret = dm_snprintf(path, size, "%s/dev/block/%d:%d/md/%s", sysfs_dir, (int)MAJOR(dev), (int)MINOR(dev), attribute); if (ret < 0) { diff --git a/lib/filters/filter.c b/lib/filters/filter.c index c218d548e..d8ce366dc 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -38,6 +38,7 @@ typedef struct { } device_info_t; static int _md_major = -1; +static int _blkext_major = -1; static int _device_mapper_major = -1; int md_major(void) @@ -45,6 +46,11 @@ int md_major(void) return _md_major; } +int blkext_major(void) +{ + return _blkext_major; +} + /* * Devices are only checked for partition tables if their minor number * is a multiple of the number corresponding to their type below @@ -197,6 +203,10 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) if (!strncmp("md", line + i, 2) && isspace(*(line + i + 2))) _md_major = line_maj; + /* Look for blkext device */ + if (!strncmp("blkext", line + i, 6) && isspace(*(line + i + 6))) + _blkext_major = line_maj; + /* Look for device-mapper device */ /* FIXME Cope with multiple majors */ if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13))) diff --git a/lib/filters/filter.h b/lib/filters/filter.h index 1a326cd8f..948d0746e 100644 --- a/lib/filters/filter.h +++ b/lib/filters/filter.h @@ -36,6 +36,7 @@ struct dev_filter *lvm_type_filter_create(const char *proc, void lvm_type_filter_destroy(struct dev_filter *f); int md_major(void); +int blkext_major(void); int max_partitions(int major); #endif