mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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;
|
||||
}
|
||||
|
||||
/********** FIXME
|
||||
log_print("maximum logical volume size is %s",
|
||||
(dummy = lvm_show_size(LVM_LV_SIZE_MAX(vg) / 2, LONG)));
|
||||
dm_free(dummy);
|
||||
dummy = NULL;
|
||||
**********/
|
||||
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) {
|
||||
log_error("Can't get lock for orphan PVs");
|
||||
unlock_and_release_vg(cmd, vg, vg_name);
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (!archive(vg))
|
||||
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 */
|
||||
if (!vg_extend(vg, argc, argv))
|
||||
goto error;
|
||||
|
Loading…
Reference in New Issue
Block a user