Print this page
NEX-3414 CLONE - Port 3339 iscsi/fs:5 causes panic on initiator
NEX-3419 CLONE - Run multi initiator sessions to a single target test can panic the initiator
Reviewed by: Steve Peng <steve.peng@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_io.c
          +++ new/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_io.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  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 2000 by Cisco Systems, Inc.  All rights reserved.
  23   23   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
       24 + * Copyright 2011, 2015 Nexenta Systems, Inc. All rights reserved.
  25   25   *
  26   26   * iSCSI Pseudo HBA Driver
  27   27   */
  28   28  
  29   29  #include <sys/socket.h>         /* networking stuff */
  30   30  #include <sys/t_kuser.h>        /* networking stuff */
  31   31  #include <sys/tihdr.h>          /* networking stuff */
  32   32  #include <sys/strsubr.h>        /* networking stuff */
  33   33  #include <netinet/tcp.h>        /* TCP_NODELAY */
  34   34  #include <sys/socketvar.h>      /* _ALLOC_SLEEP */
↓ open down ↓ 3468 lines elided ↑ open up ↑
3503 3503                  }
3504 3504                  mutex_exit(&icp->conn_queue_active.mutex);
3505 3505                  mutex_exit(&isp->sess_queue_pending.mutex);
3506 3506                  mutex_exit(&icp->conn_state_mutex);
3507 3507  
3508 3508                  icp = icp->conn_next;
3509 3509          }
3510 3510  
3511 3511          icp = isp->sess_conn_list;
3512 3512          while (icp != NULL) {
3513      -                if (icp->conn_timeout == B_TRUE) {
     3513 +                mutex_enter(&icp->conn_state_mutex);
     3514 +                if ((icp->conn_timeout == B_TRUE) &&
     3515 +                    (icp->conn_state_idm_connected == B_TRUE)) {
3514 3516                          /* timeout on this connect detected */
3515 3517                          idm_ini_conn_disconnect(icp->conn_ic);
3516 3518                          icp->conn_timeout = B_FALSE;
3517 3519                  }
     3520 +                mutex_exit(&icp->conn_state_mutex);
3518 3521                  icp = icp->conn_next;
3519 3522          }
3520 3523          rw_exit(&isp->sess_conn_list_rwlock);
3521 3524  }
3522 3525  
3523 3526  /*
3524 3527   * iscsi_nop_checks - sends a NOP on idle connections
3525 3528   *
3526 3529   * This function walks the connections on a session and
3527 3530   * issues NOPs on those connections that are in FULL
↓ open down ↓ 173 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX