From: Zdenek Kabelac Date: Tue, 13 Dec 2016 11:28:12 +0000 (+0100) Subject: cleanup: remove wrapping function X-Git-Tag: v2_02_169~565 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=fce7449d7311b49839f339b714c48e953e9a837a;p=lvm2.git cleanup: remove wrapping function backup is not 'tested' for success and also it should actually happen just when command is finished. We do not target to make backups with each inter-step metadata change. --- diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 56fe6a7d8..049102ab2 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -226,21 +226,6 @@ static void _clear_allocation_prohibited(struct dm_list *pvs) pvl->pv->status &= ~PV_ALLOCATION_PROHIBITED; } -/* FIXME Move this out */ -/* Write, commit and optionally backup metadata of vg */ -static int _vg_write_commit_backup(struct volume_group *vg) -{ - if (!vg_write(vg) || !vg_commit(vg)) { - log_error("Failed to commit VG %s metadata.", vg->name); - return 0; - } - - if (!backup(vg)) - log_warn("WARNING: Backup of VG %s metadata failed. Continuing.", vg->name); - - return 1; -} - /* * Deactivate and remove the LVs on removal_lvs list from vg. */ @@ -1898,8 +1883,12 @@ static int _eliminate_extracted_lvs_optional_write_vg(struct volume_group *vg, dm_list_init(removal_lvs); - if (vg_write_requested && !_vg_write_commit_backup(vg)) - return_0; + if (vg_write_requested) { + if (!vg_write(vg) || !vg_commit(vg)) + return_0; + + backup(vg); + } return 1; }