1. 31 5月, 2015 2 次提交
  2. 15 4月, 2015 2 次提交
  3. 27 3月, 2015 1 次提交
  4. 13 2月, 2015 1 次提交
    • 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
  5. 10 1月, 2015 1 次提交
  6. 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
  7. 16 12月, 2014 2 次提交
    • 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
  8. 02 12月, 2014 1 次提交
  9. 25 11月, 2014 1 次提交
  10. 03 11月, 2014 1 次提交
  11. 04 10月, 2014 2 次提交
    • N
      target: Add force_pr_aptpl device attribute · 92404e60
      Nicholas Bellinger 提交于
      This patch adds a force_pr_aptpl device attribute used to force SPC-3 PR
      Activate Persistence across Target Power Loss (APTPL) operation.  This
      makes PR metadata write-out occur during state change regardless if new
      PERSISTENT_RESERVE_OUT CDBs have their APTPL feature bit set.
      
      This is useful during H/A failover in active/passive setups where all PR
      state is being re-created on a different node, driven by configfs backend
      device + export layout and pre-loaded $DEV/pr/res_aptpl_metadata.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      92404e60
    • N
      target: Fix APTPL metadata handling for dynamic MappedLUNs · e2480563
      Nicholas Bellinger 提交于
      This patch fixes a bug in handling of SPC-3 PR Activate Persistence
      across Target Power Loss (APTPL) logic where re-creation of state for
      MappedLUNs from dynamically generated NodeACLs did not occur during
      I_T Nexus establishment.
      
      It adds the missing core_scsi3_check_aptpl_registration() call during
      core_tpg_check_initiator_node_acl() -> core_tpg_add_node_to_devs() in
      order to replay any pre-loaded APTPL metadata state associated with
      the newly connected SCSI Initiator Port.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e2480563
  12. 02 10月, 2014 1 次提交
    • J
      target: encapsulate smp_mb__after_atomic() · 33940d09
      Joern Engel 提交于
      The target code has a rather generous helping of smp_mb__after_atomic()
      throughout the code base.  Most atomic operations were followed by one
      and none were preceded by smp_mb__before_atomic(), nor accompanied by a
      comment explaining the need for a barrier.
      
      Instead of trying to prove for every case whether or not it is needed,
      this patch introduces atomic_inc_mb() and atomic_dec_mb(), which
      explicitly include the memory barriers before and after the atomic
      operation.  For now they are defined in a target header, although they
      could be of general use.
      
      Most of the existing atomic/mb combinations were replaced by the new
      helpers.  In a few cases the atomic was sandwiched in
      spin_lock/spin_unlock and I simply removed the barrier.
      
      I suspect that in most cases the correct conversion would have been to
      drop the barrier.  I also suspect that a few cases exist where a) the
      barrier was necessary and b) a second barrier before the atomic would
      have been necessary and got added by this patch.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      33940d09
  13. 18 9月, 2014 1 次提交
  14. 18 4月, 2014 1 次提交
  15. 13 2月, 2014 1 次提交
  16. 21 11月, 2013 1 次提交
  17. 11 9月, 2013 2 次提交
  18. 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
  19. 14 6月, 2013 11 次提交
  20. 26 2月, 2013 1 次提交
  21. 11 1月, 2013 1 次提交
  22. 28 11月, 2012 1 次提交
  23. 08 11月, 2012 1 次提交
  24. 07 11月, 2012 2 次提交
    • 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