1. 04 Oct, 2014 1 commit
    • Nicholas Bellinger's avatar
      target: Fix APTPL metadata handling for dynamic MappedLUNs · e2480563
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      e2480563
  2. 03 Oct, 2014 9 commits
    • Joern Engel's avatar
      qla_target: don't delete changed nacls · f4c24db1
      Joern Engel authored
      The code is currently riddled with "drop the hardware_lock to avoid a
      deadlock" bugs that expose races.  One of those races seems to expose a
      valid warning in tcm_qla2xxx_clear_nacl_from_fcport_map.  Add some
      bandaid to it.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      Cc: <stable@vger.kernel.org> # v3.5+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f4c24db1
    • Andy Grover's avatar
      target/user: Recalculate pad size inside is_ring_space_avail() · f56574a2
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f56574a2
    • Hannes Reinecke's avatar
      tcm_loop: Fixup tag handling · 6375f890
      Hannes Reinecke authored
      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: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6375f890
    • Sagi Grimberg's avatar
      iser-target: Fix smatch warning · 1acff63f
      Sagi Grimberg authored
      Unused return value from down_interruptible
      Reported-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      1acff63f
    • Nicholas Bellinger's avatar
      target/user: Fix up smatch warnings in tcmu_netlink_event · 6e14eab9
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6e14eab9
    • Andy Grover's avatar
      target: Add a user-passthrough backstore · 7c9e7a6f
      Andy Grover authored
      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: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      7c9e7a6f
    • Andy Grover's avatar
      target: Add documentation on the target userspace pass-through driver · ce876851
      Andy Grover authored
      Describes the driver and its interface to make it possible for user
      programs to back a LIO-exported LUN.
      
      Thanks to Richard W. M. Jones for review, and supplementing this doc
      with the first two paragraphs.
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      ce876851
    • Andy Grover's avatar
      uio: Export definition of struct uio_device · f14bb039
      Andy Grover authored
      In order to prevent a O(n) search of the filesystem to link up its uio
      node with its target configuration, TCMU needs to know the minor number
      that UIO assigned. Expose the definition of this struct so TCMU can
      access this field.
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f14bb039
    • Andy Grover's avatar
      target: Remove unneeded check in sbc_parse_cdb · 20959c4b
      Andy Grover authored
      The check of SCF_SCSI_DATA_CDB seems to be a remnant from before hch's
      refactoring of this function. There are no places where that flag is set
      that cmd->execute_cmd isn't also set.
      Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      20959c4b
  3. 01 Oct, 2014 12 commits
  4. 17 Sep, 2014 12 commits
  5. 15 Sep, 2014 6 commits