1. 02 12月, 2014 5 次提交
  2. 03 11月, 2014 1 次提交
  3. 29 10月, 2014 2 次提交
  4. 08 10月, 2014 1 次提交
  5. 04 10月, 2014 6 次提交
    • 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
    • A
      target/user: Recalculate pad size inside is_ring_space_avail() · f56574a2
      Andy Grover 提交于
      If more than one thread is waiting for command ring space that includes
      a PAD, then if the first one finishes (inserts a PAD and a CMD at the
      start of the cmd ring) then the second one will incorrectly think it still
      needs to insert a PAD (i.e. cmdr_space_needed is now wrong.) This will
      lead to it asking for more space than it actually needs, and then inserting
      a PAD somewhere else than at the end -- not what we want.
      
      This patch moves the pad calculation inside is_ring_space_available() so
      in the above scenario the second thread would then ask for space not
      including a PAD. The patch also inserts a PAD op based upon an up-to-date
      cmd_head, instead of the potentially stale value.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f56574a2
    • H
      tcm_loop: Fixup tag handling · 6375f890
      Hannes Reinecke 提交于
      The SCSI command tag is set to the tag assigned from the block
      layer, not the SCSI-II tag message. So we need to convert
      it into the correct SCSI-II tag message based on the
      device flags, not the tag value itself.
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6375f890
    • N
      target/user: Fix up smatch warnings in tcmu_netlink_event · 6e14eab9
      Nicholas Bellinger 提交于
      This patch fixes up the following unused return smatch warnings:
      
        drivers/target/target_core_user.c:778 tcmu_netlink_event warn: unused return: ret = nla_put_string()
        drivers/target/target_core_user.c:780 tcmu_netlink_event warn: unused `return: ret = nla_put_u32()
      
      (Fix up missing semicolon: grover)
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6e14eab9
    • A
      target: Add a user-passthrough backstore · 7c9e7a6f
      Andy Grover 提交于
      Add a LIO storage engine that presents commands to userspace for execution.
      This would allow more complex backstores to be implemented out-of-kernel,
      and also make experimentation a-la FUSE (but at the SCSI level -- "SUSE"?)
      possible.
      
      It uses a mmap()able UIO device per LUN to share a command ring and data
      area. The commands are raw SCSI CDBs and iovs for in/out data. The command
      ring is also reused for returning scsi command status and optional sense
      data.
      
      This implementation is based on Shaohua Li's earlier version but heavily
      modified. Differences include:
      
      * Shared memory allocated by kernel, not locked-down user pages
      * Single ring for command request and response
      * Offsets instead of embedded pointers
      * Generic SCSI CDB passthrough instead of per-cmd specialization in ring
        format.
      * Uses UIO device instead of anon_file passed in mailbox.
      * Optional in-kernel handling of some commands.
      
      The main reason for these differences is to permit greater resiliency
      if the user process dies or hangs.
      
      Things not yet implemented (on purpose):
      
      * Zero copy. The data area is flexible enough to allow page flipping or
        backend-allocated pages to be used by fabrics, but it's not clear these
        are performance wins. Can come later.
      * Out-of-order command completion by userspace. Possible to add by just
        allowing userspace to change cmd_id in rsp cmd entries, but currently
        not supported.
      * No locks between kernel cmd submission and completion routines. Sounds
        like it's possible, but this can come later.
      * Sparse allocation of mmaped area. Current code vmallocs the whole thing.
        If the mapped area was larger and not fully mapped then the driver would
        have more freedom to change cmd and data area sizes based on demand.
      
      Current code open issues:
      
      * The use of idrs may be overkill -- we maybe can replace them with a
        simple counter to generate cmd_ids, and a hash table to get a cmd_id's
        associated pointer.
      * Use of a free-running counter for cmd ring instead of explicit modulo
        math. This would require power-of-2 cmd ring size.
      
      (Add kconfig depends NET - Randy)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7c9e7a6f
  6. 03 10月, 2014 1 次提交
  7. 02 10月, 2014 8 次提交
  8. 25 9月, 2014 1 次提交
    • T
      percpu_ref: add PERCPU_REF_INIT_* flags · 2aad2a86
      Tejun Heo 提交于
      With the recent addition of percpu_ref_reinit(), percpu_ref now can be
      used as a persistent switch which can be turned on and off repeatedly
      where turning off maps to killing the ref and waiting for it to drain;
      however, there currently isn't a way to initialize a percpu_ref in its
      off (killed and drained) state, which can be inconvenient for certain
      persistent switch use cases.
      
      Similarly, percpu_ref_switch_to_atomic/percpu() allow dynamic
      selection of operation mode; however, currently a newly initialized
      percpu_ref is always in percpu mode making it impossible to avoid the
      latency overhead of switching to atomic mode.
      
      This patch adds @flags to percpu_ref_init() and implements the
      following flags.
      
      * PERCPU_REF_INIT_ATOMIC	: start ref in atomic mode
      * PERCPU_REF_INIT_DEAD		: start ref killed and drained
      
      These flags should be able to serve the above two use cases.
      
      v2: target_core_tpg.c conversion was missing.  Fixed.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NKent Overstreet <kmo@daterainc.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      2aad2a86
  9. 18 9月, 2014 15 次提交