From 1e482f7ca636caa666c90939f42bff55559a0e5d Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 11 Jan 2012 20:38:42 +0000 Subject: [PATCH] Give priority to emcpower devices with duplicate PVIDs. --- WHATS_NEW | 1 + lib/commands/toolcontext.c | 2 +- lib/filters/filter.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index cd3ce8fe3..f154fc357 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Give priority to emcpower devices with duplicate PVIDs. Add check for error in _adjust_policy_params() (lvextend --use-policies). Supports rounding of percentage (%LV, %VG...) for LV resize upward. Use dmeventd_lvm2_command in dmeventd plugins snapshot, raid, mirror. diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 0c0a71acf..16c6d228e 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -98,7 +98,7 @@ static void _get_sysfs_dir(struct cmd_context *cmd) } if (!(fp = fopen(proc_mounts, "r"))) { - log_sys_error("_get_sysfs_dir: fopen %s", proc_mounts); + log_sys_error("_get_sysfs_dir fopen", proc_mounts); return; } diff --git a/lib/filters/filter.c b/lib/filters/filter.c index 4c3d3b7df..d36f21b7e 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -44,6 +44,7 @@ static int _md_major = -1; static int _blkext_major = -1; static int _drbd_major = -1; static int _device_mapper_major = -1; +static int _emcpower_major = -1; int dm_major(void) { @@ -70,6 +71,9 @@ int dev_subsystem_part_major(const struct device *dev) if (MAJOR(dev->dev) == _drbd_major) return 1; + if (MAJOR(dev->dev) == _emcpower_major) + return 1; + if ((MAJOR(dev->dev) == _blkext_major) && (get_primary_dev(sysfs_dir_path(), dev, &primary_dev)) && (MAJOR(primary_dev) == _md_major)) @@ -86,6 +90,9 @@ const char *dev_subsystem_name(const struct device *dev) if (MAJOR(dev->dev) == _drbd_major) return "DRBD"; + if (MAJOR(dev->dev) == _emcpower_major) + return "EMCPOWER"; + if (MAJOR(dev->dev) == _blkext_major) return "BLKEXT"; @@ -246,6 +253,10 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn) if (!strncmp("drbd", line + i, 4) && isspace(*(line + i + 4))) _drbd_major = line_maj; + /* Look for EMC powerpath */ + if (!strncmp("emcpower", line + i, 8) && isspace(*(line + i + 8))) + _emcpower_major = line_maj; + /* Look for device-mapper device */ /* FIXME Cope with multiple majors */ if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13)))