mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-08 08:58:50 +03:00
lvremove: correct return code
Need to return ECMD_FAILED from toollib code. Add missing stack traces.
This commit is contained in:
parent
3cbb751815
commit
843ee943ab
@ -6610,7 +6610,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
!lv_is_pending_delete(lv) &&
|
||||
lv_is_visible(lv)) {
|
||||
if (vg->needs_write_and_commit && (!vg_write(vg) || !vg_commit(vg)))
|
||||
return 0;
|
||||
return_0;
|
||||
if (yes_no_prompt("Do you really want to remove%s active "
|
||||
"%slogical volume %s? [y/n]: ",
|
||||
ask_discard ? " and DISCARD" : "",
|
||||
@ -6651,7 +6651,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
if (!lv_is_historical(lv) && (force == PROMPT) && ask_discard) {
|
||||
/* try to store on disks already confirmed removals */
|
||||
if (vg->needs_write_and_commit && (!vg_write(vg) || !vg_commit(vg)))
|
||||
return 0;
|
||||
return_0;
|
||||
if (yes_no_prompt("Do you really want to remove and DISCARD "
|
||||
"logical volume %s? [y/n]: ",
|
||||
display_lvname(lv)) == 'n') {
|
||||
|
@ -3218,9 +3218,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
|
||||
|
||||
if (vg->needs_write_and_commit && (ret_max == ECMD_PROCESSED) &&
|
||||
(!vg_write(vg) || !vg_commit(vg)))
|
||||
return_0;
|
||||
|
||||
if (vg->needs_backup)
|
||||
ret_max = ECMD_FAILED;
|
||||
else if (vg->needs_backup)
|
||||
backup(vg);
|
||||
|
||||
if (lvargs_supplied) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user