When formatting a JBOD disk to AF, we unbind the /dev/sd
device nodes prior to starting the format in order to
avoid strange errors from cropping up. Additionally, we
also flush the unused multipath device maps for the same
reason. When we delete a RAID array, although delete the
/dev/sd device nodes prior to deleting the RAID array,
we weren't flushing the unused multipaths, so let's do that.

Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
---

 iprlib.c |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff -puN iprlib.c~iprutils_raid_mpath_teardown iprlib.c
--- iprutils.patched/iprlib.c~iprutils_raid_mpath_teardown      2016-06-15 
08:50:20.430472405 -0500
+++ iprutils.patched-bjking1/iprlib.c   2016-06-15 08:51:58.526421693 -0500
@@ -2706,6 +2706,19 @@ static int ipr_stop_array(struct ipr_ioa
        return rc;
 }
 
+static void ipr_mpath_flush()
+{
+       int pid, status;
+
+       /* flush unused multipath device maps */
+       pid = fork();
+       if (pid == 0) {
+               execlp("multipath", "-F", NULL);
+               _exit(errno);
+       } else
+               waitpid(pid, &status, 0);
+}
+
 /**
  * ipr_stop_array_protection - Stop array protection for an array
  * @ioa:               ipr ioa struct
@@ -2715,6 +2728,7 @@ static int ipr_stop_array(struct ipr_ioa
  **/
 int ipr_stop_array_protection(struct ipr_ioa *ioa)
 {
+       ipr_mpath_flush();
        return ipr_stop_array(ioa, "Stop Array Protection", 0);
 }
 
@@ -3748,18 +3762,8 @@ int ipr_format_unit(struct ipr_dev *dev)
        int length = IPR_DEFECT_LIST_HDR_LEN;
        char *name = dev->gen_name;
 
-       if (strlen(dev->dev_name) && dev->scsi_dev_data->device_id) {
-               int pid, status;
-
-               /* flush unused multipath device maps */
-               pid = fork();
-               if (pid == 0) {
-                       execlp("multipath", "-F", NULL);
-                       _exit(errno);
-               } else {
-                       waitpid(pid, &status, 0);
-               }
-       }
+       if (strlen(dev->dev_name) && dev->scsi_dev_data->device_id)
+               ipr_mpath_flush();
 
        if (strlen(name) == 0)
                return -ENOENT;
_


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to