<div dir="ltr"><div>Applied.<br></div>Thanks.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 25, 2014 at 10:57 AM, Vaughan Cao <span dir="ltr"><<a href="mailto:vaughan.cao@oracle.com" target="_blank">vaughan.cao@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We encounter the following case:<br>
<br>
@ After adding a multipaths section into /etc/multipath.conf to specify 'alias'<br>
@ and other attributes for a particular multipath device and<br>
@ reloading/restarting the multipathd service, only renaming of the multipath<br>
@ device is done, other attribute changes are ignored.<br>
@<br>
@ It is more evident if you directly run 'multipath -r' to reload devmap after<br>
@ adding the 'multipaths' section with alias into /etc/multipath.conf.<br>
@<br>
@ When reload/restart multipathd service or 'multipath -r' again, new settings<br>
@ can be applied right.<br>
<br>
It's because that in select_action() when force_reload is set, if we also need<br>
rename the mpp device, reload action won't be taken any more.<br>
<br>
I did this patch by introducing a new action ACT_RENAME2 to group these two<br>
action. Test passed. However, it seems to be a rough patch and I am not<br>
certain if this bind is fine refering to dm_reassign. Please comment, Thanks.<br>
<br>
Signed-off-by: Vaughan Cao <<a href="mailto:vaughan.cao@oracle.com">vaughan.cao@oracle.com</a>><br>
---<br>
 libmultipath/configure.c | 11 +++++++++++<br>
 libmultipath/configure.h |  1 +<br>
 2 files changed, 12 insertions(+)<br>
<br>
diff --git a/libmultipath/configure.c b/libmultipath/configure.c<br>
index 3ed6b55..7331f90 100644<br>
--- a/libmultipath/configure.c<br>
+++ b/libmultipath/configure.c<br>
@@ -385,6 +385,8 @@ select_action (struct multipath * mpp, vector curmp, int force_reload)<br>
                                cmpp->alias, mpp->alias);<br>
                        strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE);<br>
                        mpp->action = ACT_RENAME;<br>
+                       if (force_reload)<br>
+                               mpp->action = ACT_RENAME2;<br>
                        return;<br>
                }<br>
                mpp->action = ACT_CREATE;<br>
@@ -623,6 +625,15 @@ domap (struct multipath * mpp, char * params)<br>
                r = dm_rename(mpp->alias_old, mpp->alias);<br>
                break;<br>
<br>
+       case ACT_RENAME2:<br>
+               r = dm_rename(mpp->alias_old, mpp->alias);<br>
+               if (r) {<br>
+                       r = dm_addmap_reload(mpp, params);<br>
+                       if (r)<br>
+                               r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);<br>
+               }<br>
+               break;<br>
+<br>
        default:<br>
                break;<br>
        }<br>
diff --git a/libmultipath/configure.h b/libmultipath/configure.h<br>
index b3a6bb8..c014b55 100644<br>
--- a/libmultipath/configure.h<br>
+++ b/libmultipath/configure.h<br>
@@ -18,6 +18,7 @@ enum actions {<br>
        ACT_RENAME,<br>
        ACT_CREATE,<br>
        ACT_RESIZE,<br>
+       ACT_RENAME2,<br>
 };<br>
<br>
 #define FLUSH_ONE 1<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.0<br>
<br>
</font></span></blockquote></div><br></div>