Print this page
NEX-2787 Multiple comstar / fibre channel / qlt threads stuck waiting on locks with a spinning interrupt thread
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Approved by: Jean McCormack <jean.mccormack@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/stmf/stmf.c
          +++ new/usr/src/cmd/mdb/common/modules/stmf/stmf.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 2009 Sun Microsystems, Inc.  All rights reserved.
       23 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  #include <sys/dditypes.h>
  27   28  #include <sys/mdb_modapi.h>
  28   29  #include <sys/modctl.h>
  29   30  #include <sys/sunddi.h>
  30   31  #include <sys/lpif.h>
  31   32  #include <sys/stmf.h>
  32   33  #include <sys/portif.h>
       34 +#include <sys/list.h>
  33   35  #include <stmf_impl.h>
  34   36  #include <lun_map.h>
  35   37  #include <stmf_state.h>
  36   38  
  37   39  #include <sys/fct.h>
  38   40  #include <fct_impl.h>
  39   41  
  40   42  #include "cmd_options.h"
  41   43  
  42   44  static int
↓ open down ↓ 1055 lines elided ↑ open up ↑
1098 1100                  mdb_warn("fct_i_local_port_t address should be specified");
1099 1101                  return (DCMD_ERR);
1100 1102          }
1101 1103  
1102 1104          if (mdb_vread(&iport, sizeof (struct fct_i_local_port), addr)
1103 1105              != sizeof (struct fct_i_local_port)) {
1104 1106                  mdb_warn("Unable to read in fct_i_local_port at %p\n", addr);
1105 1107                  return (DCMD_ERR);
1106 1108          }
1107 1109  
1108      -        icmdp = iport.iport_cached_cmdlist;
     1110 +        icmdp = list_head(&iport.iport_cached_cmdlist);
1109 1111          while (icmdp) {
     1112 +
1110 1113                  if (mdb_vread(&icmd, sizeof (struct fct_i_cmd),
1111 1114                      (uintptr_t)icmdp) == -1) {
1112 1115                          mdb_warn("failed to read fct_i_cmd at %p", icmdp);
1113 1116                          return (DCMD_ERR);
1114 1117                  }
1115 1118  
1116 1119                  mdb_printf("%p\n", icmdp);
1117 1120                  if (verbose) {
1118 1121                          mdb_printf("  fct cmd: %p\n", icmd.icmd_cmd);
1119 1122                  }
1120 1123  
1121      -                icmdp = icmd.icmd_next;
     1124 +                icmdp = list_next(&iport.iport_cached_cmdlist, icmdp);
1122 1125          }
1123 1126  
1124 1127          return (DCMD_OK);
1125 1128  }
1126 1129  
1127 1130  /*
1128 1131   * Walker to list the addresses of all the active STMF scsi tasks (scsi_task_t),
1129 1132   * given a stmf_worker address
1130 1133   *
1131 1134   * To list all the active STMF scsi tasks, use
↓ open down ↓ 487 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX