From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@gmail.com>
Subject: [PATCH v2 14/18] multipathd: print "fail" when remove fails
Date: Thu, 7 Apr 2016 18:20:08 -0500 [thread overview]
Message-ID: <1460071212-21018-15-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1460071212-21018-1-git-send-email-bmarzins@redhat.com>
When multipathd fails to remove a path or a map, it was printing "ok"
instead of "fail", and exitting with a 0 return code. Now it prints
"fail" and exits with a 1, like it does when other commands fail.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/cli_handlers.c | 8 ++++----
multipathd/main.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 21fe00e..168b872 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -511,7 +511,7 @@ cli_del_path (void * v, char ** reply, int * len, void * data)
pp = find_path_by_dev(vecs->pathvec, param);
if (!pp) {
condlog(0, "%s: path already removed", param);
- return 0;
+ return 1;
}
return ev_remove_path(pp, vecs);
}
@@ -585,19 +585,19 @@ cli_del_map (void * v, char ** reply, int * len, void * data)
minor = dm_get_minor(param);
if (minor < 0) {
condlog(2, "%s: not a device mapper table", param);
- return 0;
+ return 1;
}
major = dm_get_major(param);
if (major < 0) {
condlog(2, "%s: not a device mapper table", param);
- return 0;
+ return 1;
}
sprintf(dev_path,"dm-%d", minor);
alias = dm_mapname(major, minor);
if (!alias) {
condlog(2, "%s: mapname not found for %d:%d",
param, major, minor);
- return 0;
+ return 1;
}
rc = ev_remove_map(param, alias, minor, vecs);
FREE(alias);
diff --git a/multipathd/main.c b/multipathd/main.c
index f1fdd21..bbcfe0d 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -448,12 +448,12 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs)
if (!mpp) {
condlog(2, "%s: devmap not registered, can't remove",
devname);
- return 0;
+ return 1;
}
if (strcmp(mpp->alias, alias)) {
condlog(2, "%s: minor number mismatch (map %d, event %d)",
mpp->alias, mpp->dmi->minor, minor);
- return 0;
+ return 1;
}
return flush_map(mpp, vecs, 0);
}
--
1.8.3.1
next prev parent reply other threads:[~2016-04-07 23:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 23:19 [PATCH v2 00/18] Multipath patch sync Benjamin Marzinski
2016-04-07 23:19 ` [PATCH v2 01/18] multipathd: use /run instead of /var/run Benjamin Marzinski
2016-04-07 23:19 ` [PATCH v2 02/18] retrigger uevents to try and get the uid through udev Benjamin Marzinski
2016-04-07 23:19 ` [PATCH v2 03/18] Fix issues with user_friendly_names initramfs bindings Benjamin Marzinski
2016-04-07 23:19 ` [PATCH v2 04/18] Add libmpathcmd library and use it internally Benjamin Marzinski
2016-04-07 23:19 ` [PATCH v2 05/18] libmultipath: add ignore_new_boot_devs option Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 06/18] libmultipath: fix PAD and PRINT macros Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 07/18] libmultipath: Cut down on alua prioritizer ioctls Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 08/18] multipathd: fail if pidfile can't be created Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 09/18] libmultipath: check correct function for define Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 10/18] multipathd: delay reloads during creation Benjamin Marzinski
2016-04-08 8:36 ` Zdenek Kabelac
2016-04-08 21:53 ` Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 11/18] multipath: Fix minor text issues Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 12/18] kpartx: verify partition devices Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 13/18] multipath: add exclusive_pref_bit for alua prio Benjamin Marzinski
2016-04-07 23:20 ` Benjamin Marzinski [this message]
2016-04-07 23:20 ` [PATCH v2 15/18] multipath: check partitions unused before removing Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 16/18] multipathd.service: remove blk-availability Requires Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 17/18] multipathd: use 64-bit int for command key Benjamin Marzinski
2016-04-07 23:20 ` [PATCH v2 18/18] multipath: add wwn keyword to weightedpath prio Benjamin Marzinski
2016-04-18 9:36 ` [PATCH v2 00/18] Multipath patch sync Christophe Varoqui
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=1460071212-21018-15-git-send-email-bmarzins@redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@gmail.com \
--cc=dm-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).