mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Fix vgextend error path - if ORPHAN lock fails, unlock and release vg.
Full changes - Fix vgextend error path when lock_vol(VG_ORPHANS) fails - Move lock_vol(VG_ORPHANS) before archive(vg) - safe & simpler error paths - Remove legacy comment/code that no longer applies Found in review - Milan Broz <mbroz@redhat.com> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
defed336ae
commit
acac361359
@ -43,21 +43,15 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********** FIXME
|
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
|
||||||
log_print("maximum logical volume size is %s",
|
log_error("Can't get lock for orphan PVs");
|
||||||
(dummy = lvm_show_size(LVM_LV_SIZE_MAX(vg) / 2, LONG)));
|
unlock_and_release_vg(cmd, vg, vg_name);
|
||||||
dm_free(dummy);
|
return ECMD_FAILED;
|
||||||
dummy = NULL;
|
}
|
||||||
**********/
|
|
||||||
|
|
||||||
if (!archive(vg))
|
if (!archive(vg))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
|
|
||||||
log_error("Can't get lock for orphan PVs");
|
|
||||||
return ECMD_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* extend vg */
|
/* extend vg */
|
||||||
if (!vg_extend(vg, argc, argv))
|
if (!vg_extend(vg, argc, argv))
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user