1. 20 10月, 2016 1 次提交
  2. 21 7月, 2016 1 次提交
  3. 10 5月, 2016 3 次提交
  4. 27 1月, 2016 1 次提交
  5. 27 8月, 2015 4 次提交
  6. 03 8月, 2015 1 次提交
  7. 25 7月, 2015 1 次提交
    • N
      iscsi-target: Fix iscsit_start_kthreads failure OOPs · e5419865
      Nicholas Bellinger 提交于
      This patch fixes a regression introduced with the following commit
      in v4.0-rc1 code, where a iscsit_start_kthreads() failure triggers
      a NULL pointer dereference OOPs:
      
          commit 88dcd2da
          Author: Nicholas Bellinger <nab@linux-iscsi.org>
          Date:   Thu Feb 26 22:19:15 2015 -0800
      
              iscsi-target: Convert iscsi_thread_set usage to kthread.h
      
      To address this bug, move iscsit_start_kthreads() immediately
      preceeding the transmit of last login response, before signaling
      a successful transition into full-feature-phase within existing
      iscsi_target_do_tx_login_io() logic.
      
      This ensures that no target-side resource allocation failures can
      occur after the final login response has been successfully sent.
      
      Also, it adds a iscsi_conn->rx_login_comp to allow the RX thread
      to sleep to prevent other socket related failures until the final
      iscsi_post_login_handler() call is able to complete.
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e5419865
  8. 31 5月, 2015 1 次提交
    • C
      iscsi-target: remove support for obsolete markers · c04a6091
      Christophe Vu-Brugier 提交于
      Support for markers is currently broken because of a bug in
      iscsi_enforce_integrity_rules(): the "IFMarkInt_Reject" and
      "OFMarkInt_Reject" variables are always equal to 1 in
      iscsi_enforce_integrity_rules().
      
      Moreover, fixed interval markers keys (IFMarker, OFMarker, IFMarkInt
      and OFMarkInt) are obsolete according to iSCSI RFC 7143:
      
      >From http://tools.ietf.org/html/rfc7143#section-13.25:
      
         13.25.  Obsoleted Keys
      
         This document obsoletes the following keys defined in [RFC3720]:
         IFMarker, OFMarker, OFMarkInt, and IFMarkInt.  However, iSCSI
         implementations compliant to this document may still receive these
         obsoleted keys -- i.e., in a responder role -- in a text negotiation.
      
         When an IFMarker or OFMarker key is received, a compliant iSCSI
         implementation SHOULD respond with the constant "Reject" value.  The
         implementation MAY alternatively respond with a "No" value.
      
         However, the implementation MUST NOT respond with a "NotUnderstood"
         value for either of these keys.
      
         When an IFMarkInt or OFMarkInt key is received, a compliant iSCSI
         implementation MUST respond with the constant "Reject" value.  The
         implementation MUST NOT respond with a "NotUnderstood" value for
         either of these keys.
      
      This patch disables markers by turning the corresponding parameters to
      read-only. The default value of IFMarker and OFMarker remains "No" but
      the user cannot change it to "Yes" anymore. The new value of IFMarkInt
      and OFMarkInt is "Reject".
      
      (Drop left-over iscsi_get_value_from_number_range + make configfs
       parameters attrs R/W nops - nab)
      Signed-off-by: NChristophe Vu-Brugier <cvubrugier@fastmail.fm>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c04a6091
  9. 03 5月, 2015 1 次提交
  10. 27 3月, 2015 3 次提交
  11. 31 1月, 2015 1 次提交
  12. 16 12月, 2014 1 次提交
  13. 13 12月, 2014 2 次提交
  14. 18 9月, 2014 3 次提交
  15. 28 6月, 2014 1 次提交
    • M
      iscsi-target: fix iscsit_del_np deadlock on unload · 81a9c5e7
      Mikulas Patocka 提交于
      On uniprocessor preemptible kernel, target core deadlocks on unload. The
      following events happen:
      * iscsit_del_np is called
      * it calls send_sig(SIGINT, np->np_thread, 1);
      * the scheduler switches to the np_thread
      * the np_thread is woken up, it sees that kthread_should_stop() returns
        false, so it doesn't terminate
      * the np_thread clears signals with flush_signals(current); and goes back
        to sleep in iscsit_accept_np
      * the scheduler switches back to iscsit_del_np
      * iscsit_del_np calls kthread_stop(np->np_thread);
      * the np_thread is waiting in iscsit_accept_np and it doesn't respond to
        kthread_stop
      
      The deadlock could be resolved if the administrator sends SIGINT signal to
      the np_thread with killall -INT iscsi_np
      
      The reproducible deadlock was introduced in commit
      db6077fd, but the thread-stopping code was
      racy even before.
      
      This patch fixes the problem. Using kthread_should_stop to stop the
      np_thread is unreliable, so we test np_thread_state instead. If
      np_thread_state equals ISCSI_NP_THREAD_SHUTDOWN, the thread exits.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      81a9c5e7
  16. 07 6月, 2014 1 次提交
  17. 04 6月, 2014 1 次提交
    • R
      iscsi-target: Fix wrong buffer / buffer overrun in iscsi_change_param_value() · 79d59d08
      Roland Dreier 提交于
      In non-leading connection login, iscsi_login_non_zero_tsih_s1() calls
      iscsi_change_param_value() with the buffer it uses to hold the login
      PDU, not a temporary buffer.  This leads to the login header getting
      corrupted and login failing for non-leading connections in MC/S.
      
      Fix this by adding a wrapper iscsi_change_param_sprintf() that handles
      the temporary buffer itself to avoid confusion.  Also handle sending a
      reject in case of failure in the wrapper, which lets the calling code
      get quite a bit smaller and easier to read.
      
      Finally, bump the size of the temporary buffer from 32 to 64 bytes to be
      safe, since "MaxRecvDataSegmentLength=" by itself is 25 bytes; with a
      trailing NUL, a value >= 1M will lead to a buffer overrun.  (This isn't
      the default but we don't need to run right at the ragged edge here)
      Reported-by: NSantosh Kulkarni <santosh.kulkarni@calsoftinc.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      79d59d08
  18. 16 5月, 2014 2 次提交
    • N
      iscsi-target: Disable Immediate + Unsolicited Data with ISER Protection · 52d0aa79
      Nicholas Bellinger 提交于
      This patch explicitly disables Immediate + Unsolicited Data for ISER
      connections during login in iscsi_login_zero_tsih_s2() when protection
      has been enabled for the session by the underlying hardware.
      
      This is currently required because protection / signature memory regions
      (MRs) expect T10 PI to occur on RDMA READs + RDMA WRITEs transfers, and
      not on a immediate data payload associated with ISCSI_OP_SCSI_CMD, or
      unsolicited data-out associated with a ISCSI_OP_SCSI_DATA_OUT.
      
      v2 changes:
        - Add TARGET_PROT_DOUT_INSERT check (Sagi)
        - Add pr_debug noisemaker (Sagi)
        - Add goto to avoid early return from MRDSL check (nab)
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      52d0aa79
    • S
      Target/iscsi,iser: Avoid accepting transport connections during stop stage · 14f4b54f
      Sagi Grimberg 提交于
      When the target is in stop stage, iSER transport initiates RDMA disconnects.
      The iSER initiator may wish to establish a new connection over the
      still existing network portal. In this case iSER transport should not
      accept and resume new RDMA connections. In order to learn that, iscsi_np
      is added with enabled flag so the iSER transport can check when deciding
      weather to accept and resume a new connection request.
      
      The iscsi_np is enabled after successful transport setup, and disabled
      before iscsi_np login threads are cleaned up.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      14f4b54f
  19. 07 4月, 2014 1 次提交
    • N
      target: Pass in transport supported PI at session initialization · e70beee7
      Nicholas Bellinger 提交于
      In order to support local WRITE_INSERT + READ_STRIP operations for
      non PI enabled fabrics, the fabric driver needs to be able signal
      what protection offload operations are supported.
      
      This is done at session initialization time so the modes can be
      signaled by individual se_wwn + se_portal_group endpoints, as well
      as optionally across different transports on the same endpoint.
      
      For iser-target, set TARGET_PROT_ALL if the underlying ib_device
      has already signaled PI offload support, and allow this to be
      exposed via a new iscsit_transport->iscsit_get_sup_prot_ops()
      callback.
      
      For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode
      operation.
      
      For all other drivers, set TARGET_PROT_NORMAL to disable fabric
      level PI.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e70beee7
  20. 19 12月, 2013 1 次提交
    • N
      iscsi-target: Fix incorrect np->np_thread NULL assignment · db6077fd
      Nicholas Bellinger 提交于
      When shutting down a target there is a race condition between
      iscsit_del_np() and __iscsi_target_login_thread().
      The latter sets the thread pointer to NULL, and the former
      tries to issue kthread_stop() on that pointer without any
      synchronization.
      
      This patch moves the np->np_thread NULL assignment into
      iscsit_del_np(), after kthread_stop() has completed. It also
      removes the signal_pending() + np_state check, and only
      exits when kthread_should_stop() is true.
      Reported-by: NHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      db6077fd
  21. 20 11月, 2013 1 次提交
    • N
      iscsi-target: Convert iscsi_session statistics to atomic_long_t · 04f3b31b
      Nicholas Bellinger 提交于
      This patch converts a handful of iscsi_session statistics to type
      atomic_long_t, instead of using iscsi_session->session_stats_lock
      when incrementing these values.
      
      More importantly, go ahead and drop the spinlock usage within
      iscsit_setup_scsi_cmd(), iscsit_check_dataout_hdr(),
      iscsit_send_datain(), and iscsit_build_rsp_pdu() fast-path code.
      
      (Squash in Roland's  target: Remove write-only stats fields and lock
      from struct se_node_acl)
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      04f3b31b
  22. 17 10月, 2013 1 次提交
  23. 11 9月, 2013 2 次提交
  24. 10 9月, 2013 1 次提交
    • N
      iscsi-target: Prepare login code for multi-plexing support · a91eb7d9
      Nicholas Bellinger 提交于
      This patch prepares the iscsi-target login code for multi-plexing
      support.  This includes:
      
       - Adding iscsi_tpg_np->tpg_np_kref + iscsit_login_kref_put() for
         handling callback of iscsi_tpg_np->tpg_np_comp
       - Adding kref_put() in iscsit_deaccess_np()
       - Adding kref_put() and wait_for_completion() in
         iscsit_reset_np_thread()
       - Refactor login failure path release logic into
         iscsi_target_login_sess_out()
       - Update __iscsi_target_login_thread() to handle
         iscsi_post_login_handler() asynchronous completion
       - Add shutdown parameter for iscsit_clear_tpg_np_login_thread*()
      
      v3 changes:
       - Convert iscsi_portal_group->np_login_lock to ->np_login_sem
       - Add LOGIN_FLAGS definitions
      
      v2 changes:
       - Remove duplicate call to iscsi_post_login_handler() in
         __iscsi_target_login_thread()
       - Drop unused iscsi_np->np_login_tpg
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a91eb7d9
  25. 24 8月, 2013 1 次提交
    • N
      iscsi-target: Fix iscsit_transport reference leak during NP thread reset · c9a03c12
      Nicholas Bellinger 提交于
      This patch fixes a bug in __iscsi_target_login_thread() where an explicit
      network portal thread reset ends up leaking the iscsit_transport module
      reference, along with the associated iscsi_conn allocation.
      
      This manifests itself with iser-target where a NP reset causes the extra
      iscsit_transport reference to be taken in iscsit_conn_set_transport()
      during the reset, which prevents the ib_isert module from being unloaded
      after the NP thread shutdown has finished.
      
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c9a03c12
  26. 13 8月, 2013 2 次提交
    • C
      iscsi-target: ST response on IN6ADDR_ANY socket · dfecf611
      Chris Leech 提交于
      Odd little issue, found that if you create an IPv6 portal bound to the
      IN6ADDR_ANY wildcard address it will accept IPv4 connections (as long as
      bindv6only isn't set globally) but respond to SendTargets requests with
      an IPv4-mapped IPv6 address.
      
      Example over loopback:
      
       In targetcli create a wildcard IPv6 portal
         /iscsi/iqn.../portals/> create ::
       Which should create a portal [::]:3260
      
       Initiate SendTargets discovery to the portal using an IPv4 address
         # iscsiadm -m discovery -t st -p 127.0.0.1
       The response formats TargetAddress as [::ffff:127.0.0.1]:3260,1
      
      This still works and uses v4 on the network between two v6 sockets, but
      only if the initiator supports IPv6 with v4-mapped addresses.
      
      This change detects v4-mapped address on v6 sockets for the wildcard
      case, and instead formats the TargetAddress response as an IPv4 address.
      
      In order to not further complicate iscsit_build_sendtargets_response,
      I've actually simplified it by moving the bracket wrapping of IPv6
      address into iscsit_accept_np where local_ip and login_ip strings are
      set.  That also simplifies iscsi_stat_tgt_attr_show_attr_fail_intr_addr.
      
      Side effect of the string format change is that
      lio_target_nacl_show_info will now print login_ip bracket wrapped for
      IPv6 connections, as will a few debug prints.
      Signed-off-by: NChris Leech <cleech@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      dfecf611
    • J
      target: replace strict_strto*() with kstrto*() · 57103d7f
      Jingoo Han 提交于
      The usage of strict_strtoul() and strict_strtoull() is not preferred,
      because strict_strtoul() and strict_strtoull() are obsolete. Thus,
      kstrtoul() and kstrtoull() should be used.
      
      v2: Fix incorrect return in ft_add_tpg (Fengguang)
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      57103d7f
  27. 21 6月, 2013 1 次提交