1. 11 9月, 2013 1 次提交
    • G
      target: Fix >= v3.9+ regression in PR APTPL + ALUA metadata write-out · f730f915
      Gera Kazakov 提交于
      This patch fixes a >= v3.9+ regression in __core_scsi3_write_aptpl_to_file()
      + core_alua_write_tpg_metadata() write-out, where a return value of -EIO was
      incorrectly being returned upon success.
      
      This bug was originally introduced in:
      
      commit 0e9b10a9
      Author: Al Viro <viro@zeniv.linux.org.uk>
      Date:   Sat Feb 23 15:22:43 2013 -0500
      
          target: writev() on single-element vector is pointless
      
      However, given that the return of core_scsi3_update_and_write_aptpl()
      was not used to determine if a command should be returned with non GOOD
      status, this bug was not being triggered in PR logic until v3.11-rc1 by
      commit:
      
      commit 459f213b
      Author: Andy Grover <agrover@redhat.com>
      Date:   Thu May 16 10:41:02 2013 -0700
      
          target: Allocate aptpl_buf inside update_and_write_aptpl()
      
      So, go ahead and only return -EIO if kernel_write() returned a
      negative value.
      Reported-by: NGera Kazakov <gkazakov@msn.com>
      Signed-off-by: NGera Kazakov <gkazakov@msn.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@vger.kernel.org # 3.9+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f730f915
  2. 04 7月, 2013 1 次提交
    • N
      target: Make core_scsi3_update_and_write_aptpl return sense_reason_t · 8a391857
      Nicholas Bellinger 提交于
      Fix up sense_reason_t breakage in core_scsi3_update_and_write_aptpl()
      from recent conversion to use local scope memory allocation.
      
      Reported as sparse warnings: (new ones prefixed by >>) by Fengguang:
      
      >> drivers/target/target_core_pr.c:2069:57: sparse: incorrect type in
      >> return expression (different base types)
         drivers/target/target_core_pr.c:2069:57:    expected restricted sense_reason_t
         drivers/target/target_core_pr.c:2069:57:    got int
      >> drivers/target/target_core_pr.c:2179:21: sparse: incorrect type in
      >> assignment (different base types)
         drivers/target/target_core_pr.c:2179:21:    expected restricted sense_reason_t [assigned] [usertype] ret
         drivers/target/target_core_pr.c:2179:21:    got int
      >> drivers/target/target_core_pr.c:2197:13: sparse: incorrect type in
      >> assignment (different base types)
         drivers/target/target_core_pr.c:2197:13:    expected restricted sense_reason_t [assigned] [usertype] ret
         drivers/target/target_core_pr.c:2197:13:    got int
         drivers/target/target_core_pr.c:1245:28: sparse: context imbalance in '__core_scsi3_free_registration' - unexpected unlock
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8a391857
  3. 14 6月, 2013 11 次提交
  4. 26 2月, 2013 1 次提交
  5. 11 1月, 2013 1 次提交
  6. 28 11月, 2012 1 次提交
  7. 08 11月, 2012 1 次提交
  8. 07 11月, 2012 3 次提交
    • C
      target: pass sense_reason as a return value · de103c93
      Christoph Hellwig 提交于
      Pass the sense reason as an explicit return value from the I/O submission
      path instead of storing it in struct se_cmd and using negative return
      values.  This cleans up a lot of the code pathes, and with the sparse
      annotations for the new sense_reason_t type allows for much better
      error checking.
      
      (nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
            sense_reason_t with Roland's MODE SELECT changes)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de103c93
    • C
      target: simplify reservations code · d977f437
      Christoph Hellwig 提交于
      We do not support host-level reservations for the pscsi backend, and all
      virtual backends are newere than SCSI-2, so just make the combined
      SPC-3 + SCSI-2 support the only supported variant and kill the switches
      for the different implementations, given that this code handles the no-op
      version just fine.
      
      (hch: Update DRF_SPC2_RESERVATIONS lock usage)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      d977f437
    • C
      target: kill struct se_subsystem_dev · 0fd97ccf
      Christoph Hellwig 提交于
      Simplify the code a lot by killing the superflous struct se_subsystem_dev.
      Instead se_device is allocated early on by the backend driver, which allocates
      it as part of its own per-device structure, borrowing the scheme that is for
      example used for inode allocation.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0fd97ccf
  9. 18 9月, 2012 2 次提交
  10. 08 9月, 2012 1 次提交
  11. 17 7月, 2012 2 次提交
  12. 15 5月, 2012 1 次提交
    • B
      target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups · edc318d9
      Bernhard Kohl 提交于
      This patch addresses a bug in a special case for target core SPC-2 RELEASE
      logic where the same physical client (eg: iSCSI InitiatorName) with
      differing iSCSI session identifiers (ISID) is allowed to incorrectly release
      the same client's SPC-2 reservation from the non reservation holding path.
      
      Note this bug is specific to iscsi-target w/ SPC-2 reservations, and
      with the default enforce_pr_isids=1 device attr setting in target-core
      controls if a InitiatorName + different ISID reservations are handled
      the same as a single iSCSI client entity.
      Signed-off-by: NBernhard Kohl <bernhard.kohl@gmx.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      edc318d9
  13. 07 5月, 2012 1 次提交
  14. 15 4月, 2012 1 次提交
  15. 16 3月, 2012 2 次提交
  16. 14 3月, 2012 1 次提交
    • N
      target: Fix compatible reservation handling (CRH=1) with legacy RESERVE/RELEASE · 087a03b3
      Nicholas Bellinger 提交于
      This patch addresses a bug with target_check_scsi2_reservation_conflict()
      return checking in target_scsi2_reservation_[reserve,release]() that was
      preventing CRH=1 operation from silently succeeding in the two special
      cases defined by SPC-3, and not failing with reservation conflict status
      when dealing with legacy RESERVE/RELEASE + active SPC-3 PR logic.
      
      Also explictly set cmd->scsi_status = SAM_STAT_RESERVATION_CONFLICT during
      the early non reservation holder failure from pr_ops->t10_seq_non_holder()
      check in transport_generic_cmd_sequencer() for fabrics that already expect
      it to be set.
      
      This bug was originally introduced in mainline commit:
      
      commit eacac00c
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Thu Nov 3 17:50:40 2011 -0400
      
          target: split core_scsi2_emulate_crh
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: Martin Svec <martin.svec@zoner.cz>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      087a03b3
  17. 26 2月, 2012 1 次提交
    • R
      target: Use LIST_HEAD()/DEFINE_MUTEX() for static objects · d0f474e5
      Roland Dreier 提交于
      Instead of
      
         static struct list_head foo;
         static struct mutex bar;
      
         ...
      
         INIT_LIST_HEAD(&foo);
         mutex_init(&bar);
      
      just do
      
         static LIST_HEAD(foo);
         static DEFINE_MUTEX(bar);
      
      Also remove some superfluous struct list_head and spinlock_t
      initialization calls where the variables are already defined using
      macros that initialize them.
      
      This saves a decent amount of compiled code too:
      
          add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-178 (-178)
          function                                     old     new   delta
          target_core_init_configfs                    898     850     -48
          core_scsi3_emulate_pro_preempt              1742    1683     -59
          iscsi_thread_set_init                        159      88     -71
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d0f474e5
  18. 18 1月, 2012 3 次提交
  19. 14 12月, 2011 3 次提交
  20. 06 12月, 2011 1 次提交
    • N
      target: Address legacy PYX_TRANSPORT_* return code breakage · 03e98c9e
      Nicholas Bellinger 提交于
      This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
      of locations and addresses cases where transport_generic_request_failure()
      was returning the incorrect sense upon CHECK_CONDITION status after the
      v3.1 converson to use errno return codes.
      
      This includes the conversion of transport_generic_request_failure() to
      process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
      before calling transport_send_check_condition_and_sense() to queue up
      response status.  It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
      usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
      for these cases.
      
      transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
      SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
      all been updated to set se_cmd->scsi_sense_reason and return errno codes
      universally upon failure.  This includes cmd->scsi_sense_reason assignment
      in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.
      
      Finally it updates fabric modules to remove the legacy usage, and for
      TFO->new_cmd_map() callers forwards return values outside of fabric code.
      iscsi-target has also been updated to remove a handful of special cases
      related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()
      
      (v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
           transport_generic_new_cmd, and re-add missing task->task_error_status
           assignment in transport_complete_task)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      03e98c9e
  21. 04 11月, 2011 1 次提交