1. 27 3月, 2015 6 次提交
  2. 21 3月, 2015 2 次提交
  3. 07 3月, 2015 2 次提交
  4. 28 2月, 2015 2 次提交
  5. 14 2月, 2015 8 次提交
  6. 13 2月, 2015 4 次提交
    • N
      iscsi-target: Avoid IN_LOGOUT failure case for iser-target · 72859d91
      Nicholas Bellinger 提交于
      This patch addresses a bug reported during iser-target login/logout
      stress testing, where iscsit_take_action_for_connection_exit() is
      incorrectly invoking iscsit_close_connection() twice during IN_LOGOUT
      state, after connection shutdown has already been initiated by
      iser-target code.
      
      Here is the backtrace:
      
      BUG: unable to handle kernel NULL pointer dereference at 00000000000001f0
      IP: [<ffffffffa033d992>] iscsit_take_action_for_connection_exit+0x62/0x110 [iscsi_target_mod]
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in: target_core_pscsi(O) target_core_file(O) target_core_iblock(O) ib_isert(O) iscsi_target_mod(O) ib_srpt(O) tcm_loop(O) tcm_fc(O) target_core_mod(O) mst_pciconf(OE) bonding mlx5_ib(O) mlx5_core libfc scsi_transport_fc netconsole configfs nfsv3 nfs_acl mlx4_ib(O) rdma_ucm(O) ib_ucm(O) rdma_cm(O) iw_cm(O) ib_uverbs(O) libiscsi_tcp libiscsi scsi_transport_iscsi mlx4_en mlx4_core ib_ipoib(O) ib_cm(O) ib_sa(O) ib_umad(O) ib_mad(O) ib_core(O) ib_addr(O) rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs fscache lockd grace autofs4 sunrpc 8021q garp stp llc ipv6 dm_mirror dm_region_hash dm_log dm_multipath uinput ipmi_si ipmi_msghandler acpi_pad iTCO_wdt iTCO_vendor_support dcdbas microcode pcspkr wmi sb_edac edac_core sg lpc_ich mfd_core shpchp tg3 ptp pps_core dm_mod ext3(E) jbd(E) mbcache(E) sr_mod(E) cdrom(E) sd_mod(E) ahci(E) libahci(E) megaraid_sas(E) [last unloaded: target_core_mod]
      CPU: 2 PID: 5280 Comm: iscsi_ttx Tainted: G        W  OE  3.18.0-rc2+ #22
      Hardware name: Dell Inc. PowerEdge R720/0VWT90, BIOS 2.0.9 03/08/2013
      task: ffff8806132f9010 ti: ffff880601d6c000 task.ti: ffff880601d6c000
      RIP: 0010:[<ffffffffa033d992>] [<ffffffffa033d992>] iscsit_take_action_for_connection_exit+0x62/0x110 [iscsi_target_mod]
      RSP: 0018:ffff880601d6fe18  EFLAGS: 00010296
      RAX: 0000000000000000 RBX: ffff8805dc437800 RCX: 0000000000000006
      RDX: 0000000000000000 RSI: 0000000000000200 RDI: ffffffffa033d98b
      RBP: ffff880601d6fe28 R08: 0000000000000000 R09: 000000000000dd37
      R10: 00000000ec5d4202 R11: 0000000000000001 R12: ffff8805dc437bf4
      R13: ffff88061b831600 R14: ffff880601d6fe58 R15: ffff8806132f9010
      FS:  0000000000000000(0000) GS:ffff88032fa20000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000000001f0 CR3: 0000000001a14000 CR4: 00000000000407e0
      Stack:
      ffff8805dc437800 fffffffffffffe00 ffff880601d6feb8 ffffffffa034ed40
      ffff8806132f9010 ffff880601d6fe70 0f00000000000000 ffff8805d51fbef0
      0000000000000000 ffff8806132f9010 ffffffff8108e7f0 ffff880601d6fe70
      Call Trace:
      [<ffffffffa034ed40>] iscsi_target_tx_thread+0x160/0x220 [iscsi_target_mod]
      [<ffffffff8108e7f0>] ? bit_waitqueue+0xb0/0xb0
      [<ffffffffa034ebe0>] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
      [<ffffffff8107017e>] kthread+0xce/0xf0
      [<ffffffff810700b0>] ? kthread_freezable_should_stop+0x70/0x70
      [<ffffffff815a0b6c>] ret_from_fork+0x7c/0xb0
      [<ffffffff810700b0>] ? kthread_freezable_should_stop+0x70/0x70
      Code: 06 0f 84 82 00 00 00 3c 08 74 4e f6 05 39 e6 02 00 04 0f 85 9e 00 00 00 c6 43 19 08 4c 89 e7 e8 65 2a 26 e1 48 8b 83 a0 04 00 00 <48> 8b 88 f0 01 00 00 80 b9 d8 04 00 00 02 74 2e f6 05 31 e6 02
      RIP  [<ffffffffa033d992>] iscsit_take_action_for_connection_exit+0x62/0x110 [iscsi_target_mod]
      RSP <ffff880601d6fe18>
      CR2: 00000000000001f0
      ---[ end trace a0c33436cd0836b4 ]---
      
      This special case is still required by ISCSI_TCP transport during a
      iscsit_handle_logout_cmd() failure case in iscsi_target_rx_opcode(),
      but must be avoided for iser-target.
      Reported-by: NSagi Grimberg <sagig@mellanox.com>
      Reported-by: NSlava Shwartsman <valyushash@gmail.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Slava Shwartsman <valyushash@gmail.com>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      72859d91
    • N
      target: Fix PR_APTPL_BUF_LEN buffer size limitation · f161d4b4
      Nicholas Bellinger 提交于
      This patch addresses the original PR_APTPL_BUF_LEN = 8k limitiation
      for write-out of PR APTPL metadata that Martin has recently been
      running into.
      
      It changes core_scsi3_update_and_write_aptpl() to use vzalloc'ed
      memory instead of kzalloc, and increases the default hardcoded
      length to 256k.
      
      It also adds logic in core_scsi3_update_and_write_aptpl() to double
      the original length upon core_scsi3_update_aptpl_buf() failure, and
      retries until the vzalloc'ed buffer is large enough to accommodate
      the outgoing APTPL metadata.
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f161d4b4
    • N
      iscsi-target: Drop problematic active_ts_list usage · 3fd7b60f
      Nicholas Bellinger 提交于
      This patch drops legacy active_ts_list usage within iscsi_target_tq.c
      code.  It was originally used to track the active thread sets during
      iscsi-target shutdown, and is no longer used by modern upstream code.
      
      Two people have reported list corruption using traditional iscsi-target
      and iser-target with the following backtrace, that appears to be related
      to iscsi_thread_set->ts_list being used across both active_ts_list and
      inactive_ts_list.
      
      [   60.782534] ------------[ cut here ]------------
      [   60.782543] WARNING: CPU: 0 PID: 9430 at lib/list_debug.c:53 __list_del_entry+0x63/0xd0()
      [   60.782545] list_del corruption, ffff88045b00d180->next is LIST_POISON1 (dead000000100100)
      [   60.782546] Modules linked in: ib_srpt tcm_qla2xxx qla2xxx tcm_loop tcm_fc libfc scsi_transport_fc scsi_tgt ib_isert rdma_cm iw_cm ib_addr iscsi_target_mod target_core_pscsi target_core_file target_core_iblock target_core_mod configfs ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT xt_CHECKSUM iptable_mangle iptable_filter ip_tables bridge stp llc autofs4 sunrpc ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ib_ipoib ib_cm ib_uverbs ib_umad mlx4_en mlx4_ib ib_sa ib_mad ib_core mlx4_core dm_mirror dm_region_hash dm_log dm_mod vhost_net macvtap macvlan vhost tun kvm_intel kvm uinput iTCO_wdt iTCO_vendor_support microcode serio_raw pcspkr sb_edac edac_core sg i2c_i801 lpc_ich mfd_core mtip32xx igb i2c_algo_bit i2c_core ptp pps_core ioatdma dca wmi ext3(F) jbd(F) mbcache(F) sd_mod(F) crc_t10dif(F) crct10dif_common(F) ahci(F) libahci(F) isci(F) libsas(F) scsi_transport_sas(F) [last unloaded: speedstep_lib]
      [   60.782597] CPU: 0 PID: 9430 Comm: iscsi_ttx Tainted: GF 3.12.19+ #2
      [   60.782598] Hardware name: Supermicro X9DRX+-F/X9DRX+-F, BIOS 3.00 07/09/2013
      [   60.782599]  0000000000000035 ffff88044de31d08 ffffffff81553ae7 0000000000000035
      [   60.782602]  ffff88044de31d58 ffff88044de31d48 ffffffff8104d1cc 0000000000000002
      [   60.782605]  ffff88045b00d180 ffff88045b00d0c0 ffff88045b00d0c0 ffff88044de31e58
      [   60.782607] Call Trace:
      [   60.782611]  [<ffffffff81553ae7>] dump_stack+0x49/0x62
      [   60.782615]  [<ffffffff8104d1cc>] warn_slowpath_common+0x8c/0xc0
      [   60.782618]  [<ffffffff8104d2b6>] warn_slowpath_fmt+0x46/0x50
      [   60.782620]  [<ffffffff81280933>] __list_del_entry+0x63/0xd0
      [   60.782622]  [<ffffffff812809b1>] list_del+0x11/0x40
      [   60.782630]  [<ffffffffa06e7cf9>] iscsi_del_ts_from_active_list+0x29/0x50 [iscsi_target_mod]
      [   60.782635]  [<ffffffffa06e87b1>] iscsi_tx_thread_pre_handler+0xa1/0x180 [iscsi_target_mod]
      [   60.782642]  [<ffffffffa06fb9ae>] iscsi_target_tx_thread+0x4e/0x220 [iscsi_target_mod]
      [   60.782647]  [<ffffffffa06fb960>] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
      [   60.782652]  [<ffffffffa06fb960>] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
      [   60.782655]  [<ffffffff8106f99e>] kthread+0xce/0xe0
      [   60.782657]  [<ffffffff8106f8d0>] ? kthread_freezable_should_stop+0x70/0x70
      [   60.782660]  [<ffffffff8156026c>] ret_from_fork+0x7c/0xb0
      [   60.782662]  [<ffffffff8106f8d0>] ? kthread_freezable_should_stop+0x70/0x70
      [   60.782663] ---[ end trace 9662f4a661d33965 ]---
      
      Since this code is no longer used, go ahead and drop the problematic usage
      all-together.
      Reported-by: NGavin Guo <gavin.guo@canonical.com>
      Reported-by: NMoussa Ba <moussaba@micron.com>
      Cc: stable@vger.kernel.org # 3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3fd7b60f
    • S
      iscsi/iser-target: Support multi-sequence sendtargets text response · e4f4e801
      Sagi Grimberg 提交于
      In case sendtargets response is larger than initiator MRDSL, we
      send a partial sendtargets response (setting F=0, C=1, TTT!=0xffffffff),
      accept a consecutive empty text message and send the rest of the payload.
      In case we are done, we set F=1, C=0, TTT=0xffffffff.
      We do that by storing the sendtargets response bytes done under
      the session.
      
      This patch also makes iscsit_find_cmd_from_itt public for isert.
      
      (Re-add cmd->maxcmdsn_inc and clear in iscsit_build_text_rsp - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e4f4e801
  7. 05 2月, 2015 2 次提交
  8. 31 1月, 2015 1 次提交
  9. 18 1月, 2015 1 次提交
    • J
      netlink: make nlmsg_end() and genlmsg_end() void · 053c095a
      Johannes Berg 提交于
      Contrary to common expectations for an "int" return, these functions
      return only a positive value -- if used correctly they cannot even
      return 0 because the message header will necessarily be in the skb.
      
      This makes the very common pattern of
      
        if (genlmsg_end(...) < 0) { ... }
      
      be a whole bunch of dead code. Many places also simply do
      
        return nlmsg_end(...);
      
      and the caller is expected to deal with it.
      
      This also commonly (at least for me) causes errors, because it is very
      common to write
      
        if (my_function(...))
          /* error condition */
      
      and if my_function() does "return nlmsg_end()" this is of course wrong.
      
      Additionally, there's not a single place in the kernel that actually
      needs the message length returned, and if anyone needs it later then
      it'll be very easy to just use skb->len there.
      
      Remove this, and make the functions void. This removes a bunch of dead
      code as described above. The patch adds lines because I did
      
      -	return nlmsg_end(...);
      +	nlmsg_end(...);
      +	return 0;
      
      I could have preserved all the function's return values by returning
      skb->len, but instead I've audited all the places calling the affected
      functions and found that none cared. A few places actually compared
      the return value with <= 0 in dump functionality, but that could just
      be changed to < 0 with no change in behaviour, so I opted for the more
      efficient version.
      
      One instance of the error I've made numerous times now is also present
      in net/phonet/pn_netlink.c in the route_dumpit() function - it didn't
      check for <0 or <=0 and thus broke out of the loop every single time.
      I've preserved this since it will (I think) have caused the messages to
      userspace to be formatted differently with just a single message for
      every SKB returned to userspace. It's possible that this isn't needed
      for the tools that actually use this, but I don't even know what they
      are so couldn't test that changing this behaviour would be acceptable.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      053c095a
  10. 16 1月, 2015 1 次提交
  11. 10 1月, 2015 4 次提交
    • A
      iscsi-target: Fix typos in enum cmd_flags_table · 8060b8dd
      Andy Grover 提交于
      Everything else starts with ICF so the last two should as well.
      
      Fix places they are used to match.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8060b8dd
    • L
      target: Allow Write Exclusive non-reservation holders to READ · 1ecc7586
      Lee Duncan 提交于
      For PGR reservation of type Write Exclusive Access, allow all non
      reservation holding I_T nexuses with active registrations to READ
      from the device.
      
      This addresses a bug where active registrations that attempted
      to READ would result in an reservation conflict.
      Signed-off-by: NLee Duncan <lduncan@suse.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1ecc7586
    • N
      target: Drop left-over fabric_max_sectors attribute · 7216dc07
      Nicholas Bellinger 提交于
      Now that fabric_max_sectors is no longer used to enforce the maximum
      I/O size, go ahead and drop it's left-over usage in target-core and
      associated backend drivers.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7216dc07
    • N
      target: Drop arbitrary maximum I/O size limit · 046ba642
      Nicholas Bellinger 提交于
      This patch drops the arbitrary maximum I/O size limit in sbc_parse_cdb(),
      which currently for fabric_max_sectors is hardcoded to 8192 (4 MB for 512
      byte sector devices), and for hw_max_sectors is a backend driver dependent
      value.
      
      This limit is problematic because Linux initiators have only recently
      started to honor block limits MAXIMUM TRANSFER LENGTH, and other non-Linux
      based initiators (eg: MSFT Fibre Channel) can also generate I/Os larger
      than 4 MB in size.
      
      Currently when this happens, the following message will appear on the
      target resulting in I/Os being returned with non recoverable status:
      
        SCSI OP 28h with too big sectors 16384 exceeds fabric_max_sectors: 8192
      
      Instead, drop both [fabric,hw]_max_sector checks in sbc_parse_cdb(),
      and convert the existing hw_max_sectors into a purely informational
      attribute used to represent the granuality that backend driver and/or
      subsystem code is splitting I/Os upon.
      
      Also, update FILEIO with an explicit FD_MAX_BYTES check in fd_execute_rw()
      to deal with the one special iovec limitiation case.
      
      v2 changes:
        - Drop hw_max_sectors check in sbc_parse_cdb()
      Reported-by: NLance Gropper <lance.gropper@qosserver.com>
      Reported-by: NStefan Priebe <s.priebe@profihost.ag>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org # 3.4
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      046ba642
  12. 19 12月, 2014 1 次提交
    • N
      target: Allow AllRegistrants to re-RESERVE existing reservation · ae450e24
      Nicholas Bellinger 提交于
      This patch changes core_scsi3_pro_release() logic to allow an
      existing AllRegistrants type reservation to be re-reserved by
      any registered I_T nexus.
      
      This addresses a issue where AllRegistrants type RESERVE was
      receiving RESERVATION_CONFLICT status if dev_pr_res_holder did
      not match the same I_T nexus, instead of just returning GOOD
      status following spc4r34 Section 5.9.9:
      
      "If the device server receives a PERSISTENT RESERVE OUT command
       with RESERVE service action where the TYPE field and the SCOPE
       field contain the same values as the existing type and scope
       from a persistent reservation holder, it shall not make any
       change to the existing persistent reservation and shall complete
       the command with GOOD status."
      Reported-by: NIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: Lee Duncan <lduncan@suse.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ae450e24
  13. 16 12月, 2014 4 次提交
    • N
      iscsi-target: Fail connection on short sendmsg writes · 6bf6ca75
      Nicholas Bellinger 提交于
      This patch changes iscsit_do_tx_data() to fail on short writes
      when kernel_sendmsg() returns a value different than requested
      transfer length, returning -EPIPE and thus causing a connection
      reset to occur.
      
      This avoids a potential bug in the original code where a short
      write would result in kernel_sendmsg() being called again with
      the original iovec base + length.
      
      In practice this has not been an issue because iscsit_do_tx_data()
      is only used for transferring 48 byte headers + 4 byte digests,
      along with seldom used control payloads from NOPIN + TEXT_RSP +
      REJECT with less than 32k of data.
      
      So following Al's audit of iovec consumers, go ahead and fail
      the connection on short writes for now, and remove the bogus
      logic ahead of his proper upstream fix.
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6bf6ca75
    • S
      iscsi-target: nullify session in failed login sequence · a0b3b9b2
      Sagi Grimberg 提交于
      In case login sequence failed, make sure conn->sess is
      NULL before calling wait_conn as some transports (iser)
      may rely on that (waiting for session commands).
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a0b3b9b2
    • N
      target: Avoid dropping AllRegistrants reservation during unregister · 6c3c9baa
      Nicholas Bellinger 提交于
      This patch fixes an issue with AllRegistrants reservations where
      an unregister operation by the I_T nexus reservation holder would
      incorrectly drop the reservation, instead of waiting until the
      last active I_T nexus is unregistered as per SPC-4.
      
      This includes updating __core_scsi3_complete_pro_release() to reset
      dev->dev_pr_res_holder with another pr_reg for this special case,
      as well as a new 'unreg' parameter to determine when the release
      is occuring from an implicit unregister, vs. explicit RELEASE.
      
      It also adds special handling in core_scsi3_free_pr_reg_from_nacl()
      to release the left-over pr_res_holder, now that pr_reg is deleted
      from pr_reg_list within __core_scsi3_complete_pro_release().
      Reported-by: NIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6c3c9baa
    • N
      target: Fix R_HOLDER bit usage for AllRegistrants · d16ca7c5
      Nicholas Bellinger 提交于
      This patch fixes the usage of R_HOLDER bit for an All Registrants
      reservation in READ_FULL_STATUS, where only the registration who
      issued RESERVE was being reported as having an active reservation.
      
      It changes core_scsi3_pri_read_full_status() to check ahead of the
      list walk of active registrations to see if All Registrants is active,
      and if so set R_HOLDER bit and scope/type fields for all active
      registrations.
      Reported-by: NIlias Tsitsimpis <i.tsitsimpis@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d16ca7c5
  14. 13 12月, 2014 2 次提交