1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +03:00

toollib: improve ignore_vg case in _process_pvs_in_vgs

ignore_vg now returns 0 for the FAILED_CLUSTERED case,
so all the ignore_vg 1 cases will return vg's with an
empty vg->pvs, so we do not need to iterate through
vg->pvs to remove the entries from the devices list.

Clean up whitespace problems in that area from the
previous commit.
This commit is contained in:
David Teigland 2014-11-18 09:22:37 -06:00
parent cf37c04347
commit aaa6205d5a

View File

@ -2200,25 +2200,26 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
vg = vg_read(cmd, vg_name, vg_uuid, flags | READ_WARN_INCONSISTENT); vg = vg_read(cmd, vg_name, vg_uuid, flags | READ_WARN_INCONSISTENT);
if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) { if (ignore_vg(vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &skip)) {
stack; stack;
ret = ECMD_FAILED; ret_max = ECMD_FAILED;
skip = 1; continue;
/* Only continue if no vg was returned. */
if (!vg)
continue;
} }
/*
* Don't continue when skip is set, because we need to remove
* vg->pvs entries from devices list.
*/
ret = _process_pvs_in_vg(cmd, vg, all_devices, arg_pvnames, arg_tags, ret = _process_pvs_in_vg(cmd, vg, all_devices, arg_pvnames, arg_tags,
process_all, skip, handle, process_single_pv); process_all, skip, handle, process_single_pv);
if (ret != ECMD_PROCESSED) if (ret != ECMD_PROCESSED)
stack; stack;
if (ret > ret_max) if (ret > ret_max)
ret_max = ret; ret_max = ret;
if (skip) if (skip)
release_vg(vg); release_vg(vg);
else else
unlock_and_release_vg(cmd, vg, vg->name); unlock_and_release_vg(cmd, vg, vg->name);
/* Quit early when possible. */ /* Quit early when possible. */
if (!process_all && dm_list_empty(arg_tags) && dm_list_empty(arg_pvnames)) if (!process_all && dm_list_empty(arg_tags) && dm_list_empty(arg_pvnames))