diff options
author | David Teigland <teigland@redhat.com> | 2020-02-07 10:21:07 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-02-07 10:21:07 -0600 |
commit | b756cb3e49b762b3a5160f9748aeb5bf995ae80e (patch) | |
tree | d9d655defa887b50cc80ac7625d3c77ae76c7cb4 | |
parent | 96985b1373d58b411a80c2985f348466e78cbe6e (diff) | |
download | lvm2-b756cb3e49b762b3a5160f9748aeb5bf995ae80e.tar.gz |
writecache: fix return value
-rw-r--r-- | tools/lvconvert.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index f6a329b22..a83b019ae 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5580,13 +5580,13 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd, if (!seg_is_linear(first_seg(lv_fast))) { log_error("LV %s must be linear to use as a writecache.", display_lvname(lv_fast)); - return 0; + goto bad; } /* fast LV shouldn't generally be active by itself, but just in case. */ if (lv_info(cmd, lv_fast, 1, NULL, 0, 0)) { log_error("LV %s must be inactive to attach.", display_lvname(lv_fast)); - return 0; + goto bad; } memset(&settings, 0, sizeof(settings)); @@ -5594,13 +5594,13 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd, if (!_get_writecache_settings(cmd, &settings, &block_size_sectors)) { log_error("Invalid writecache settings."); - return 0; + goto bad; } if (!arg_is_set(cmd, yes_ARG) && yes_no_prompt("Erase all existing data on %s? [y/n]: ", display_lvname(lv_fast)) == 'n') { log_error("Conversion aborted."); - return 0; + goto bad; } /* Ensure the two LVs are not active elsewhere. */ |