summaryrefslogtreecommitdiff
path: root/tools/toollib.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2022-07-09 21:33:57 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2022-07-11 01:18:24 +0200
commit493acb9195cef185b38ae4e4ffb84b984e5cc08c (patch)
tree7c07cc4f887586569aa5ee61c07920103d50841a /tools/toollib.c
parente2e31d9acf1b96ab741c22dc0a2fefd672996d3a (diff)
downloadlvm2-493acb9195cef185b38ae4e4ffb84b984e5cc08c.tar.gz
vdo: suffle code for better error path handling
For failing dm_ no need to report 2nd. error, but we missed to report error with 'updated==NULL'.
Diffstat (limited to 'tools/toollib.c')
-rw-r--r--tools/toollib.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/toollib.c b/tools/toollib.c
index 544791808..c29ba2ab4 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1347,23 +1347,23 @@ int get_vdo_settings(struct cmd_context *cmd,
u |= VDO_CHANGE_ONLINE;
}
- if (updated) {
- // validation of updated VDO option
- if (!dm_vdo_validate_target_params(vtp, 0 /* vdo_size */)) {
-err:
- if (is_lvchange)
- log_error("Cannot change VDO setting \"vdo_%s\" in existing VDO pool.",
- option);
- else
- log_error("Invalid argument for VDO setting \"vdo_%s\".",
- option);
- goto out;
- }
+ // validation of updated VDO option
+ if (!dm_vdo_validate_target_params(vtp, 0 /* vdo_size */))
+ goto_out;
+ if (updated)
*updated = u;
- }
- r = 1;
+ r = 1; // success
+ goto out;
+err:
+ if (is_lvchange)
+ log_error("Cannot change VDO setting \"vdo_%s\" in existing VDO pool.",
+ option);
+ else
+ log_error("Invalid argument for VDO setting \"vdo_%s\".",
+ option);
+
out:
if (result)
dm_config_destroy(result);