Print this page
3866 panic in idm module
3867 stmfCreateLu failed: GUID_IN_USE
3868 iscsi target not accepting any new connections
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Jeremy Jones <jeremy@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/stmf/stmf.c
          +++ new/usr/src/uts/common/io/comstar/stmf/stmf.c
↓ open down ↓ 6101 lines elided ↑ open up ↑
6102 6102  stmf_status_t
6103 6103  stmf_scsilib_uniq_lu_id2(uint32_t company_id, uint32_t host_id,
6104 6104      scsi_devid_desc_t *lu_id)
6105 6105  {
6106 6106          uint8_t *p;
6107 6107          struct timeval32 timestamp32;
6108 6108          uint32_t *t = (uint32_t *)&timestamp32;
6109 6109          struct ether_addr mac;
6110 6110          uint8_t *e = (uint8_t *)&mac;
6111 6111          int hid = (int)host_id;
     6112 +        uint16_t gen_number;
6112 6113  
6113 6114          if (company_id == COMPANY_ID_NONE)
6114 6115                  company_id = COMPANY_ID_SUN;
6115 6116  
6116 6117          if (lu_id->ident_length != 0x10)
6117 6118                  return (STMF_INVALID_ARG);
6118 6119  
6119 6120          p = (uint8_t *)lu_id;
6120 6121  
6121      -        atomic_add_16(&stmf_lu_id_gen_number, 1);
     6122 +        gen_number = atomic_add_16_nv(&stmf_lu_id_gen_number, 1);
6122 6123  
6123 6124          p[0] = 0xf1; p[1] = 3; p[2] = 0; p[3] = 0x10;
6124 6125          p[4] = ((company_id >> 20) & 0xf) | 0x60;
6125 6126          p[5] = (company_id >> 12) & 0xff;
6126 6127          p[6] = (company_id >> 4) & 0xff;
6127 6128          p[7] = (company_id << 4) & 0xf0;
6128 6129          if (hid == 0 && !localetheraddr((struct ether_addr *)NULL, &mac)) {
6129 6130                  hid = BE_32((int)zone_get_hostid(NULL));
6130 6131          }
6131 6132          if (hid != 0) {
6132 6133                  e[0] = (hid >> 24) & 0xff;
6133 6134                  e[1] = (hid >> 16) & 0xff;
6134 6135                  e[2] = (hid >> 8) & 0xff;
6135 6136                  e[3] = hid & 0xff;
6136 6137                  e[4] = e[5] = 0;
6137 6138          }
6138 6139          bcopy(e, p+8, 6);
6139 6140          uniqtime32(&timestamp32);
6140 6141          *t = BE_32(*t);
6141 6142          bcopy(t, p+14, 4);
6142      -        p[18] = (stmf_lu_id_gen_number >> 8) & 0xff;
6143      -        p[19] = stmf_lu_id_gen_number & 0xff;
     6143 +        p[18] = (gen_number >> 8) & 0xff;
     6144 +        p[19] = gen_number & 0xff;
6144 6145  
6145 6146          return (STMF_SUCCESS);
6146 6147  }
6147 6148  
6148 6149  /*
6149 6150   * saa is sense key, ASC, ASCQ
6150 6151   */
6151 6152  void
6152 6153  stmf_scsilib_send_status(scsi_task_t *task, uint8_t st, uint32_t saa)
6153 6154  {
↓ open down ↓ 2342 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX