Print this page
9702 HBA drivers don't need the redundant devfs_clean step
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

@@ -16,28 +16,19 @@
  * fields enclosed by brackets "[]" replaced with your own identifying
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 Nexenta Systems Inc. All rights reserved.
  */
 
 /*
  * Multipath driver interface (MDI) implementation; see mdi_impldefs.h for a
  * more detailed discussion of the overall mpxio architecture.
- *
- * Default locking order:
- *
- * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_phci_mutex);
- * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_client_mutex);
- * _NOTE(LOCK_ORDER(mdi_vhci:vh_phci_mutex, mdi_phci::ph_mutex);
- * _NOTE(LOCK_ORDER(mdi_vhci:vh_client_mutex, mdi_client::ct_mutex);
- * _NOTE(LOCK_ORDER(mdi_phci::ph_mutex mdi_pathinfo::pi_mutex))
- * _NOTE(LOCK_ORDER(mdi_phci::ph_mutex mdi_client::ct_mutex))
- * _NOTE(LOCK_ORDER(mdi_client::ct_mutex mdi_pathinfo::pi_mutex))
  */
 
 #include <sys/note.h>
 #include <sys/types.h>
 #include <sys/varargs.h>

@@ -3668,31 +3659,29 @@
                         case MDI_CLIENT_STATE_FAILED:
                                 /*
                                  * This is the last path case for
                                  * non-user initiated events.
                                  */
-                                if (((flag & NDI_USER_REQ) == 0) &&
-                                    cdip && (i_ddi_node_state(cdip) >=
-                                    DS_INITIALIZED)) {
+                                if ((flag & NDI_USER_REQ) ||
+                                    cdip == NULL || i_ddi_node_state(cdip) <
+                                    DS_INITIALIZED)
+                                        break;
+
                                         MDI_CLIENT_UNLOCK(ct);
-                                        rv = ndi_devi_offline(cdip,
-                                            NDI_DEVFS_CLEAN);
+                                rv = ndi_devi_offline(cdip, NDI_DEVFS_CLEAN);
                                         MDI_CLIENT_LOCK(ct);
 
                                         if (rv != NDI_SUCCESS) {
                                                 /*
-                                                 * ndi_devi_offline failed.
-                                                 * Reset client flags to
-                                                 * online as the path could not
-                                                 * be offlined.
+                                         * Reset client flags to online as the
+                                         * path could not be offlined.
                                                  */
                                                 MDI_DEBUG(1, (MDI_WARN, cdip,
-                                                    "!ndi_devi_offline failed: "
-                                                    "error %x", rv));
+                                            "!ndi_devi_offline failed: %d",
+                                            rv));
                                                 MDI_CLIENT_SET_ONLINE(ct);
                                         }
-                                }
                                 break;
                         }
                         /*
                          * Convert to MDI error code
                          */