<div dir="ltr">Merged,<div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 13, 2017 at 3:05 PM, Martin Wilck <span dir="ltr"><<a href="mailto:mwilck@suse.com" target="_blank">mwilck@suse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Commit 79a05a4e inadvertently removed the code necessary<br>
to support multipath maps without partitions, as introduced<br>
in b73a34ea "libmultipath: add skip_kpartx option". Revert<br>
this part of the commit, so that skip_kpartx works again.<br>
<br>
Fixes: 79a05a4e libmultipath: move suspend logic to _dm_flush_map<br>
Signed-off-by: Martin Wilck <<a href="mailto:mwilck@suse.com">mwilck@suse.com</a>><br>
---<br>
libmultipath/devmapper.c | 14 +++++++++++++-<br>
1 file changed, 13 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c<br>
index 026418f8..5fb9d9ac 100644<br>
--- a/libmultipath/devmapper.c<br>
+++ b/libmultipath/devmapper.c<br>
@@ -761,6 +761,12 @@ out:<br>
}<br>
<br>
static int<br>
+has_partmap(const char *name, void *data)<br>
+{<br>
+ return 1;<br>
+}<br>
+<br>
+static int<br>
partmap_in_use(const char *name, void *data)<br>
{<br>
int part_count, *ret_count = (int *)data;<br>
@@ -785,12 +791,18 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove,<br>
{<br>
int r;<br>
int queue_if_no_path = 0;<br>
+ int udev_flags = 0;<br>
unsigned long long mapsize;<br>
char params[PARAMS_SIZE] = {0};<br>
<br>
if (!dm_is_mpath(mapname))<br>
return 0; /* nothing to do */<br>
<br>
+ /* if the device currently has no partitions, do not<br>
+ run kpartx on it if you fail to delete it */<br>
+ if (do_foreach_partmaps(mapname, has_partmap, NULL) == 0)<br>
+ udev_flags |= MPATH_UDEV_NO_KPARTX_FLAG;<br>
+<br>
/* If you aren't doing a deferred remove, make sure that no<br>
* devices are in use */<br>
if (!do_deferred(deferred_remove) && partmap_in_use(mapname, NULL))<br>
@@ -834,7 +846,7 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove,<br>
mapname);<br>
if (need_suspend && queue_if_no_path != -1) {<br>
dm_simplecmd_noflush(DM_<wbr>DEVICE_RESUME,<br>
- mapname, 0);<br>
+ mapname, udev_flags);<br>
}<br>
}<br>
if (retries)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.2<br>
<br>
</font></span></blockquote></div><br></div>