From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - vdo: suffle code for better error path handling
Date: Sun, 10 Jul 2022 23:22:24 +0000 (GMT) [thread overview]
Message-ID: <20220710232224.11700385734A@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=493acb9195cef185b38ae4e4ffb84b984e5cc08c
Commit: 493acb9195cef185b38ae4e4ffb84b984e5cc08c
Parent: e2e31d9acf1b96ab741c22dc0a2fefd672996d3a
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sat Jul 9 21:33:57 2022 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
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'.
---
tools/toollib.c | 28 ++++++++++++++--------------
1 file 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);
reply other threads:[~2022-07-10 23:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220710232224.11700385734A@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.