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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/sunmdi.c
          +++ new/usr/src/uts/common/os/sunmdi.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
       21 +
  21   22  /*
  22   23   * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  23   24   * Copyright (c) 2014 Nexenta Systems Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Multipath driver interface (MDI) implementation; see mdi_impldefs.h for a
  28   29   * more detailed discussion of the overall mpxio architecture.
  29      - *
  30      - * Default locking order:
  31      - *
  32      - * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_phci_mutex);
  33      - * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_client_mutex);
  34      - * _NOTE(LOCK_ORDER(mdi_vhci:vh_phci_mutex, mdi_phci::ph_mutex);
  35      - * _NOTE(LOCK_ORDER(mdi_vhci:vh_client_mutex, mdi_client::ct_mutex);
  36      - * _NOTE(LOCK_ORDER(mdi_phci::ph_mutex mdi_pathinfo::pi_mutex))
  37      - * _NOTE(LOCK_ORDER(mdi_phci::ph_mutex mdi_client::ct_mutex))
  38      - * _NOTE(LOCK_ORDER(mdi_client::ct_mutex mdi_pathinfo::pi_mutex))
  39   30   */
  40   31  
  41   32  #include <sys/note.h>
  42   33  #include <sys/types.h>
  43   34  #include <sys/varargs.h>
  44   35  #include <sys/param.h>
  45   36  #include <sys/errno.h>
  46   37  #include <sys/uio.h>
  47   38  #include <sys/buf.h>
  48   39  #include <sys/modctl.h>
↓ open down ↓ 3614 lines elided ↑ open up ↑
3663 3654                                          }
3664 3655                                          rv = NDI_SUCCESS;
3665 3656                                  }
3666 3657                                  break;
3667 3658  
3668 3659                          case MDI_CLIENT_STATE_FAILED:
3669 3660                                  /*
3670 3661                                   * This is the last path case for
3671 3662                                   * non-user initiated events.
3672 3663                                   */
3673      -                                if (((flag & NDI_USER_REQ) == 0) &&
3674      -                                    cdip && (i_ddi_node_state(cdip) >=
3675      -                                    DS_INITIALIZED)) {
3676      -                                        MDI_CLIENT_UNLOCK(ct);
3677      -                                        rv = ndi_devi_offline(cdip,
3678      -                                            NDI_DEVFS_CLEAN);
3679      -                                        MDI_CLIENT_LOCK(ct);
     3664 +                                if ((flag & NDI_USER_REQ) ||
     3665 +                                    cdip == NULL || i_ddi_node_state(cdip) <
     3666 +                                    DS_INITIALIZED)
     3667 +                                        break;
3680 3668  
3681      -                                        if (rv != NDI_SUCCESS) {
3682      -                                                /*
3683      -                                                 * ndi_devi_offline failed.
3684      -                                                 * Reset client flags to
3685      -                                                 * online as the path could not
3686      -                                                 * be offlined.
3687      -                                                 */
3688      -                                                MDI_DEBUG(1, (MDI_WARN, cdip,
3689      -                                                    "!ndi_devi_offline failed: "
3690      -                                                    "error %x", rv));
3691      -                                                MDI_CLIENT_SET_ONLINE(ct);
3692      -                                        }
     3669 +                                MDI_CLIENT_UNLOCK(ct);
     3670 +                                rv = ndi_devi_offline(cdip, NDI_DEVFS_CLEAN);
     3671 +                                MDI_CLIENT_LOCK(ct);
     3672 +
     3673 +                                if (rv != NDI_SUCCESS) {
     3674 +                                        /*
     3675 +                                         * Reset client flags to online as the
     3676 +                                         * path could not be offlined.
     3677 +                                         */
     3678 +                                        MDI_DEBUG(1, (MDI_WARN, cdip,
     3679 +                                            "!ndi_devi_offline failed: %d",
     3680 +                                            rv));
     3681 +                                        MDI_CLIENT_SET_ONLINE(ct);
3693 3682                                  }
3694 3683                                  break;
3695 3684                          }
3696 3685                          /*
3697 3686                           * Convert to MDI error code
3698 3687                           */
3699 3688                          switch (rv) {
3700 3689                          case NDI_SUCCESS:
3701 3690                                  MDI_CLIENT_SET_REPORT_DEV_NEEDED(ct);
3702 3691                                  i_mdi_report_path_state(ct, pip);
↓ open down ↓ 6042 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX