Skip to contentSkip to conversation

update to v2 Fix false removes

PATCH In review Benjamin Marzinski 3 participants 5 messages Dec 11, 2018 – Jan 8, 2019 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

cover update to v2 Fix false removes

I accidentally didn't include Christophe in my

[PATCH v2 0/1] Fix false removes

patchset, so v1 of "libmultipath: fix false removes in dmevents polling code" went in. This commit just patches the code to my v2 version. Sorry for the confusion. I've included Martin's Reviewed-by as the end result is the same as what he reviewed, and no intervening commits have touched libmultipath/devmapper.c or multipathd/dmevents.c

Benjamin Marzinski (1):
libmultipath: dm_is_mpath cleanup

 libmultipath/devmapper.c | 21 ++++++++++++---------
 multipathd/dmevents.c    |  4 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 1/1 libmultipath: dm_is_mpath cleanup

Add condlog() message in dm_is_mpath() fails and change the dm_is_mpath() call in watch_dmevents() to check the return value with the same syntax as all the other callers.

Fixes 9050cd5a "libmultipath: fix false removes in dmevents polling code"
---
 libmultipath/devmapper.c | 21 ++++++++++++---------
 multipathd/dmevents.c    |  4 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)
libmultipath/devmapper.c +12 -9
index 0e98923..3294bd4 100644
@@ -709,41 +709,44 @@ int dm_is_mpath(const char *name)
 	const char *uuid;
 
 	if (!(dmt = libmp_dm_task_create(DM_DEVICE_TABLE)))
-		return -1;
+		goto out;
 
 	if (!dm_task_set_name(dmt, name))
-		goto out;
+		goto out_task;
 
 	dm_task_no_open_count(dmt);
 
 	if (!dm_task_run(dmt))
-		goto out;
+		goto out_task;
 
 	if (!dm_task_get_info(dmt, &info))
-		goto out;
+		goto out_task;
 
 	r = 0;
 
 	if (!info.exists)
-		goto out;
+		goto out_task;
 
 	uuid = dm_task_get_uuid(dmt);
 
 	if (!uuid || strncmp(uuid, UUID_PREFIX, UUID_PREFIX_LEN) != 0)
-		goto out;
+		goto out_task;
 
 	/* Fetch 1st target */
 	if (dm_get_next_target(dmt, NULL, &start, &length, &target_type,
 			       &params) != NULL)
 		/* multiple targets */
-		goto out;
+		goto out_task;
 
 	if (!target_type || strcmp(target_type, TGT_MPATH) != 0)
-		goto out;
+		goto out_task;
 
 	r = 1;
-out:
+out_task:
 	dm_task_destroy(dmt);
+out:
+	if (r < 0)
+		condlog(2, "%s: dm command failed in %s", name, __FUNCTION__);
 	return r;
 }
 
multipathd/dmevents.c +3 -1
index aae7a09..0034892 100644
@@ -206,7 +206,9 @@ int watch_dmevents(char *name)
 	struct dev_event *dev_evt, *old_dev_evt;
 	int i;
 
-	if (!dm_is_mpath(name)) {
+	/* We know that this is a multipath device, so only fail if
+	 * device-mapper tells us that we're wrong */
+	if (dm_is_mpath(name) == 0) {
 		condlog(0, "%s: not a multipath device. can't watch events",
 			name);
 		return -1;
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/1] libmultipath: dm_is_mpath cleanup

Hi Christophe,

you missed the patch below in your last merge.

Thanks,
Martin

Quoted 12 lines · Benjamin Marzinski

Add condlog() message in dm_is_mpath() fails and change the dm_is_mpath() call in watch_dmevents() to check the return value with the same syntax as all the other callers.

Fixes 9050cd5a "libmultipath: fix false removes in dmevents polling

code"

---
 libmultipath/devmapper.c | 21 ++++++++++++---------
 multipathd/dmevents.c    |  4 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)
Signature · 9 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
author maintainer
#3 lore raw
In reply to Benjamin Marzinski
Quoted 3 lines · Benjamin Marzinski

I accidentally didn't include Christophe in my

[PATCH v2 0/1] Fix false removes

Clearly, something is wrong with my git send-mail setup, since you got ignored again. Sorry. I'll figure out what's going on.

-Ben

Quoted 20 lines

patchset, so v1 of "libmultipath: fix false removes in dmevents polling code" went in. This commit just patches the code to my v2 version. Sorry for the confusion. I've included Martin's Reviewed-by as the end result is the same as what he reviewed, and no intervening commits have touched libmultipath/devmapper.c or multipathd/dmevents.c

Benjamin Marzinski (1):
libmultipath: dm_is_mpath cleanup

 libmultipath/devmapper.c | 21 ++++++++++++---------
 multipathd/dmevents.c    |  4 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)
Signature · 6 lines
2.7.4

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
#4 lore raw

FYI, I did receive the v2 patch and wrapping message.

Thanks

Le mer. 12 déc. 2018 à 00:47, Benjamin Marzinski <[email protected]> a écrit :

Quoted 32 lines · Benjamin Marzinski
Quoted 3 lines

I accidentally didn't include Christophe in my

[PATCH v2 0/1] Fix false removes

Clearly, something is wrong with my git send-mail setup, since you got ignored again. Sorry. I'll figure out what's going on.

-Ben

Quoted 21 lines

patchset, so v1 of "libmultipath: fix false removes in dmevents polling

code" went in. This commit just patches the code to my v2 version. Sorry for the confusion. I've included Martin's Reviewed-by as the end result is the same as what he reviewed, and no intervening commits have touched libmultipath/devmapper.c or multipathd/dmevents.c

Benjamin Marzinski (1):
libmultipath: dm_is_mpath cleanup

 libmultipath/devmapper.c | 21 ++++++++++++---------
 multipathd/dmevents.c    |  4 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)

--
2.7.4

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel