Print this page
4051 Don't free mdi_pathinfo_t in mptsas when device(s) are retired.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/sunmdi.c
          +++ new/usr/src/uts/common/os/sunmdi.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  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   * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2014 Nexenta Systems Inc. All rights reserved.
  23   24   */
  24   25  
  25   26  /*
  26   27   * Multipath driver interface (MDI) implementation; see mdi_impldefs.h for a
  27   28   * more detailed discussion of the overall mpxio architecture.
  28   29   *
  29   30   * Default locking order:
  30   31   *
  31   32   * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_phci_mutex);
  32   33   * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_client_mutex);
↓ open down ↓ 3616 lines elided ↑ open up ↑
3649 3650                                           * Must do ndi_devi_online() through
3650 3651                                           * hotplug thread for deferred
3651 3652                                           * attach mechanism to work
3652 3653                                           */
3653 3654                                          MDI_CLIENT_UNLOCK(ct);
3654 3655                                          rv = ndi_devi_online(cdip, 0);
3655 3656                                          MDI_CLIENT_LOCK(ct);
3656 3657                                          if ((rv != NDI_SUCCESS) &&
3657 3658                                              (MDI_CLIENT_STATE(ct) ==
3658 3659                                              MDI_CLIENT_STATE_DEGRADED)) {
3659      -                                                /*
3660      -                                                 * ndi_devi_online failed.
3661      -                                                 * Reset client flags to
3662      -                                                 * offline.
3663      -                                                 */
3664 3660                                                  MDI_DEBUG(1, (MDI_WARN, cdip,
3665 3661                                                      "!ndi_devi_online failed "
3666 3662                                                      "error %x", rv));
3667      -                                                MDI_CLIENT_SET_OFFLINE(ct);
3668 3663                                          }
3669      -                                        if (rv != NDI_SUCCESS) {
3670      -                                                /* Reset the path state */
3671      -                                                MDI_PI_LOCK(pip);
3672      -                                                MDI_PI(pip)->pi_state =
3673      -                                                    MDI_PI_OLD_STATE(pip);
3674      -                                                MDI_PI_UNLOCK(pip);
3675      -                                        }
     3664 +                                        rv = NDI_SUCCESS;
3676 3665                                  }
3677 3666                                  break;
3678 3667  
3679 3668                          case MDI_CLIENT_STATE_FAILED:
3680 3669                                  /*
3681 3670                                   * This is the last path case for
3682 3671                                   * non-user initiated events.
3683 3672                                   */
3684 3673                                  if (((flag & NDI_USER_REQ) == 0) &&
3685 3674                                      cdip && (i_ddi_node_state(cdip) >=
↓ open down ↓ 1753 lines elided ↑ open up ↑
5439 5428          MDI_PHCI_UNLOCK(ph);
5440 5429  
5441 5430          return;
5442 5431  }
5443 5432  
5444 5433  /*
5445 5434   * offline the path(s) hanging off the pHCI. If the
5446 5435   * last path to any client, check that constraints
5447 5436   * have been applied.
5448 5437   *
5449      - * If constraint is 0, we aren't going to retire the 
     5438 + * If constraint is 0, we aren't going to retire the
5450 5439   * pHCI. However we still need to go through the paths
5451 5440   * calling e_ddi_retire_finalize() to clear their
5452 5441   * contract barriers.
5453 5442   */
5454 5443  void
5455 5444  mdi_phci_retire_finalize(dev_info_t *dip, int phci_only, void *constraint)
5456 5445  {
5457 5446          mdi_phci_t      *ph;
5458 5447          mdi_client_t    *ct;
5459 5448          mdi_pathinfo_t  *pip;
↓ open down ↓ 4297 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX