diff options
author | Mike Snitzer <snitzer@redhat.com> | 2009-08-19 15:34:33 +0000 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2009-08-19 15:34:33 +0000 |
commit | 3d37e976bfa8a4d4837854e620648ded58bc6bde (patch) | |
tree | 0db0d2348fb22ab1fec0525a68db4903a07c59e3 /lib/filters/filter.c | |
parent | c7a3cc0a9b0a285244956f03df3c1a3e416c1e7c (diff) | |
download | lvm2-3d37e976bfa8a4d4837854e620648ded58bc6bde.tar.gz lvm2-3d37e976bfa8a4d4837854e620648ded58bc6bde.tar.xz lvm2-3d37e976bfa8a4d4837854e620648ded58bc6bde.zip |
Fix pvcreate on a partition (regressed in 2.02.51).
Eliminate busy loop during pvcreate of a "normal" partition.
_md_sysfs_attribute_snprintf() would busy loop if the device it was
given was not a blkext-based MD partition.
Rather than being cute with a busy-loop prone 'goto check_md_major' in
_md_sysfs_attribute_snprintf(): explicitly check if the provided device
is a blkext-based partition (blkext_major()); and then check that the
get_primary_dev() determined parent is an MD device (md_major()).
Diffstat (limited to 'lib/filters/filter.c')
-rw-r--r-- | lib/filters/filter.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/filters/filter.c b/lib/filters/filter.c index c218d548..d8ce366d 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))) |