05 Jul, 2015

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "It's been a busy development cycle for target-core in a number of
    different areas.

    The fabric API usage for se_node_acl allocation is now within
    target-core code, dropping the external API callers for all fabric
    drivers tree-wide.

    There is a new conversion to RCU hlists for se_node_acl and
    se_portal_group LUN mappings, that turns fast-past LUN lookup into a
    completely lockless code-path. It also removes the original
    hard-coded limitation of 256 LUNs per fabric endpoint.

    The configfs attributes for backends can now be shared between core
    and driver code, allowing existing drivers to use common code while
    still allowing flexibility for new backend provided attributes.

    The highlights include:

    - Merge sbc_verify_dif_* into common code (sagi)
    - Remove iscsi-target support for obsolete IFMarker/OFMarker
    (Christophe Vu-Brugier)
    - Add bidi support in target/user backend (ilias + vangelis + agover)
    - Move se_node_acl allocation into target-core code (hch)
    - Add crc_t10dif_update common helper (akinobu + mkp)
    - Handle target-core odd SGL mapping for data transfer memory
    (akinobu)
    - Move transport ID handling into target-core (hch)
    - Move task tag into struct se_cmd + support 64-bit tags (bart)
    - Convert se_node_acl->device_list[] to RCU hlist (nab + hch +
    paulmck)
    - Convert se_portal_group->tpg_lun_list[] to RCU hlist (nab + hch +
    paulmck)
    - Simplify target backend driver registration (hch)
    - Consolidate + simplify target backend attribute implementations
    (hch + nab)
    - Subsume se_port + t10_alua_tg_pt_gp_member into se_lun (hch)
    - Drop lun_sep_lock for se_lun->lun_se_dev RCU usage (hch + nab)
    - Drop unnecessary core_tpg_register TFO parameter (nab)
    - Use 64-bit LUNs tree-wide (hannes)
    - Drop left-over TARGET_MAX_LUNS_PER_TRANSPORT limit (hannes)"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (76 commits)
    target: Bump core version to v5.0
    target: remove target_core_configfs.h
    target: remove unused TARGET_CORE_CONFIG_ROOT define
    target: consolidate version defines
    target: implement WRITE_SAME with UNMAP bit using ->execute_unmap
    target: simplify UNMAP handling
    target: replace se_cmd->execute_rw with a protocol_data field
    target/user: Fix inconsistent kmap_atomic/kunmap_atomic
    target: Send UA when changing LUN inventory
    target: Send UA upon LUN RESET tmr completion
    target: Send UA on ALUA target port group change
    target: Convert se_lun->lun_deve_lock to normal spinlock
    target: use 'se_dev_entry' when allocating UAs
    target: Remove 'ua_nacl' pointer from se_ua structure
    target_core_alua: Correct UA handling when switching states
    xen-scsiback: Fix compile warning for 64-bit LUN
    target: Remove TARGET_MAX_LUNS_PER_TRANSPORT
    target: use 64-bit LUNs
    target: Drop duplicate + unused se_dev_check_wce
    target: Drop unnecessary core_tpg_register TFO parameter
    ...

    Linus Torvalds
     

24 Jun, 2015

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is the usual grab bag of driver updates (lpfc, hpsa,
    megaraid_sas, cxgbi, be2iscsi) plus an assortment of minor updates.

    There is also one new driver: the Cisco snic. The advansys driver has
    been rewritten to get rid of the warning about converting it to the
    DMA API, the tape statistics patch got in and finally, there's a
    resuffle of SCSI header files to separate more cleanly initiator from
    target mode (and better share the common definitions)"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (156 commits)
    snic: driver for Cisco SCSI HBA
    qla2xxx: Fix indentation
    qla2xxx: Comment out unreachable code
    fusion: remove dead MTRR code
    advansys: fix compilation errors and warnings when CONFIG_PCI is not set
    mptsas: fix depth param in scsi_track_queue_full
    megaraid: fix irq setup process regression
    lpfc: Update version to 10.7.0.0 for upstream patch set.
    lpfc: Fix to drop PLOGIs from fabric node till LOGO processing completes
    lpfc: Fix scsi task management error message.
    lpfc: Fix cq_id masking problem.
    lpfc: Fix scsi prep dma buf error.
    lpfc: Add support for using block multi-queue
    lpfc: Devices are not discovered during takeaway/giveback testing
    lpfc: Fix vport deletion failure.
    lpfc: Check for active portpeerbeacon.
    lpfc: Update driver version for upstream patch set 10.6.0.1.
    lpfc: Change buffer pool empty message to miscellaneous category
    lpfc: Fix incorrect log message reported for empty FCF record.
    lpfc: Fix rport leak.
    ...

    Linus Torvalds
     

23 Jun, 2015

2 commits


17 Jun, 2015

1 commit


16 Jun, 2015

2 commits


02 Jun, 2015

1 commit

  • Only include SCSI initiator header files in target code that needs
    these header files, namely the SCSI pass-through code and the tcm_loop
    driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
    target code because the former is intended for initiator code and the
    latter for target code. With this patch the only initiator include
    directives in target code that remain are as follows:

    $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
    drivers/target/loopback/tcm_loop.c:29:#include
    drivers/target/loopback/tcm_loop.c:31:#include
    drivers/target/loopback/tcm_loop.c:32:#include
    drivers/target/loopback/tcm_loop.c:33:#include
    drivers/target/target_core_pscsi.c:39:#include
    drivers/target/target_core_pscsi.c:40:#include
    drivers/xen/xen-scsiback.c:52:#include /* SG_ALL */

    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Bart Van Assche
     

01 Jun, 2015

4 commits

  • With se_port_t and t10_alua_tg_pt_gp_member being absored into se_lun,
    there is no need for an extra atomic_t based reference count for PR
    ALL_TG_PT=1 and ALUA access state transition.

    Go ahead and use the existing percpu se_lun->lun_ref instead, and
    convert the two special cases to percpu_ref_tryget_live() to avoid
    se_lun if transport_clear_lun_ref() has already been invoked to
    shutdown the se_lun.

    Cc: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • With se_port and t10_alua_tg_pt_gp_member being absored into se_lun,
    there is no need for an extra lock to protect se_lun->lun_se_dev
    assignment.

    This patch also converts backend drivers to use call_rcu() release
    to allow any se_device readers to complete. The call_rcu() instead
    of kfree_rcu() is required here because se_device is embedded into
    the backend driver specific structure.

    Also, convert se_lun->lun_stats to use atomic_long_t within the
    target_complete_ok_work() completion callback, and add FIXME for
    transport_lookup_tmr_lun() with se_lun->lun_ref.

    Finally, update sbp_update_unit_directory() special case usage with
    proper rcu_dereference_raw() and configfs symlink comment.

    Reported-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Cc: Paul E. McKenney
    Cc: Chris Boot
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • This patch eliminates all se_port + t10_alua_tg_pt_gp_member usage,
    and converts current users to direct se_lun pointer dereference.

    This includes the removal of core_export_port(), core_release_port()
    core_dev_export() and core_dev_unexport(). Along with conversion
    of special case se_lun pointer dereference within PR ALL_TG_PT=1
    and ALUA access state transition UNIT_ATTENTION handling.

    Also, update core_enable_device_list_for_node() to reference the
    new per se_lun->lun_deve_list when creating a new entry, or
    replacing an existing one via RCU.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • This patch converts se_node_acl->device_list[] table for mappedluns
    to modern RCU hlist_head usage in order to support an arbitrary number
    of node_acl lun mappings.

    It converts transport_lookup_*_lun() fast-path code to use RCU read path
    primitives when looking up se_dev_entry. It adds a new hlist_head at
    se_node_acl->lun_entry_hlist for this purpose.

    For transport_lookup_cmd_lun() code, it works with existing per-cpu
    se_lun->lun_ref when associating se_cmd with se_lun + se_device.
    Also, go ahead and update core_create_device_list_for_node() +
    core_free_device_list_for_node() to use ->lun_entry_hlist.

    It also converts se_dev_entry->pr_ref_count access to use modern
    struct kref counting, and updates core_disable_device_list_for_node()
    to kref_put() and block on se_deve->pr_comp waiting for outstanding PR
    special-case PR references to drop, then invoke kfree_rcu() to wait
    for the RCU grace period to complete before releasing memory.

    So now that se_node_acl->lun_entry_hlist fast path access uses RCU
    protected pointers, go ahead and convert remaining non-fast path
    RCU updater code using ->lun_entry_lock to struct mutex to allow
    callers to block while walking se_node_acl->lun_entry_hlist.

    Finally drop the left-over core_clear_initiator_node_from_tpg() that
    originally cleared lun_access during se_node_acl shutdown, as post
    RCU conversion it now becomes duplicated logic.

    Reviewed-by: Hannes Reinecke
    Cc: Christoph Hellwig
    Cc: Sagi Grimberg
    Cc: Paul E. McKenney
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

31 May, 2015

2 commits


25 Nov, 2014

1 commit


02 Oct, 2014

1 commit

  • 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: Joern Engel
    Signed-off-by: Nicholas Bellinger

    Joern Engel
     

09 Jun, 2014

1 commit

  • Now that 3.15 is released, this merges the 'next' branch into 'master',
    bringing us to the normal situation where my 'master' branch is the
    merge window.

    * accumulated work in next: (6809 commits)
    ufs: sb mutex merge + mutex_destroy
    powerpc: update comments for generic idle conversion
    cris: update comments for generic idle conversion
    idle: remove cpu_idle() forward declarations
    nbd: zero from and len fields in NBD_CMD_DISCONNECT.
    mm: convert some level-less printks to pr_*
    MAINTAINERS: adi-buildroot-devel is moderated
    MAINTAINERS: add linux-api for review of API/ABI changes
    mm/kmemleak-test.c: use pr_fmt for logging
    fs/dlm/debug_fs.c: replace seq_printf by seq_puts
    fs/dlm/lockspace.c: convert simple_str to kstr
    fs/dlm/config.c: convert simple_str to kstr
    mm: mark remap_file_pages() syscall as deprecated
    mm: memcontrol: remove unnecessary memcg argument from soft limit functions
    mm: memcontrol: clean up memcg zoneinfo lookup
    mm/memblock.c: call kmemleak directly from memblock_(alloc|free)
    mm/mempool.c: update the kmemleak stack trace for mempool allocations
    lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations
    mm: introduce kmemleak_update_trace()
    mm/kmemleak.c: use %u to print ->checksum
    ...

    Linus Torvalds
     

06 Jun, 2014

1 commit

  • This patch allows READ_CAPACITY + SAI_READ_CAPACITY_16 opcode
    processing to occur while the associated ALUA group is in Standby
    access state.

    This is required to avoid host side LUN probe failures during the
    initial scan if an ALUA group has already implicitly changed into
    Standby access state.

    This addresses a bug reported by Chris + Philip using dm-multipath
    + ESX hosts configured with ALUA multipath.

    Reported-by: Chris Boot
    Reported-by: Philip Gaw
    Cc: Chris Boot
    Cc: Philip Gaw
    Cc: Hannes Reinecke
    Cc: stable@vger.kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

18 Apr, 2014

1 commit

  • Mostly scripted conversion of the smp_mb__* barriers.

    Signed-off-by: Peter Zijlstra
    Acked-by: Paul E. McKenney
    Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

14 Mar, 2014

1 commit

  • Building target_core_alua.o triggers a GCC warning:
    drivers/target/target_core_alua.c: In function ‘target_alua_state_check’:
    drivers/target/target_core_alua.c:773:18: warning: ‘alua_ascq’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    cmd->scsi_ascq = alua_ascq;
    ^

    This is a false positive. A little trial and error shows it is
    apparently caused by core_alua_state_lba_dependent(). It must be hard
    for GCC to track the branches of a switch statement, inside a
    list_for_each_entry loop, inside a while loop.

    But if we add a small (inline) helper function we can reorganize the
    code a bit. That also allows to drop alua_ascq which, obviously, gets
    rid of this warning.

    Signed-off-by: Paul Bolle
    Signed-off-by: Nicholas Bellinger

    Paul Bolle
     

13 Feb, 2014

1 commit

  • This patch changes core_alua_state_lba_dependent() to use do_div()
    instead sector_div() to avoid the following link error on 32-bit
    with CONFIG_LBDAF=n as reported by Jim:

    buildlog-1391099072.txt-drivers/built-in.o: In function `target_alua_state_check':
    buildlog-1391099072.txt-(.text+0x928d93): undefined reference to `__umoddi3'
    buildlog-1391099072.txt:make: *** [vmlinux] Error 1 --
    buildlog-1391101753.txt- CC init/version.o
    buildlog-1391101753.txt- LD init/built-in.o
    buildlog-1391101753.txt-drivers/built-in.o: In function `core_alua_state_lba_dependent':
    buildlog-1391101753.txt-/home/jim/linux/drivers/target/target_core_alua.c:503: undefined reference to `__umoddi3'
    buildlog-1391101753.txt:make: *** [vmlinux] Error 1

    Reported-by: Jim Davis
    Cc: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

10 Jan, 2014

3 commits

  • When a writing to a command-provided buffer we need to ensure
    that we're not writing past the end of it.
    At the same time we need to continue processing as typically
    the final data length (ie the required size of the buffer)
    need to be returned.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Hannes Reinecke
     
  • Referrals need an LBA map, which needs to be kept
    consistent across all target port groups. So
    instead of tying the map to the target port groups
    I've implemented a single attribute containing the
    entire map.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Hannes Reinecke
     
  • Add infrastructure for referrals.

    v2 changes:

    - Fix unsigned long long division in core_alua_state_lba_dependent on
    32-bit (Fengguang + Chen + Hannes)
    - Fix compile warning in core_alua_state_lba_dependent (nab)
    - Convert segment_* + sectors variables in core_alua_state_lba_dependent
    to u64 (Hannes)

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Nicholas Bellinger

    Hannes Reinecke
     

18 Dec, 2013

4 commits


21 Nov, 2013

4 commits


11 Sep, 2013

3 commits

  • Update copyright ownership/year information for target-core,
    loopback, iscsi-target, tcm_qla2xx, vhost and iser-target.

    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • 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 0e9b10a90f1c30f25dd6f130130240745ab14010
    Author: Al Viro
    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 459f213ba162bd13e113d6f92a8fa6c780fd67ed
    Author: Andy Grover
    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: Gera Kazakov
    Signed-off-by: Gera Kazakov
    Cc: Al Viro
    Cc: Andy Grover
    Cc: stable@vger.kernel.org # 3.9+
    Signed-off-by: Nicholas Bellinger

    Gera Kazakov
     
  • This patch adds an check for a non-existent port->sep_alua_tg_pt_gp_mem
    within target_alua_state_check(), which is not present for internally
    dispatched EXTENDED_COPY WRITE I/O to the destination target port.

    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Martin Petersen
    Cc: Chris Mason
    Cc: Roland Dreier
    Cc: Zach Brown
    Cc: James Bottomley
    Cc: Nicholas Bellinger
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

13 Aug, 2013

1 commit

  • The usage of strict_strtoul() and strict_strtoull() is not preferred,
    because strict_strtoul() and strict_strtoull() are obsolete. Thus,
    kstrtoul() and kstrtoull() should be used.

    v2: Fix incorrect return in ft_add_tpg (Fengguang)

    Signed-off-by: Jingoo Han
    Signed-off-by: Nicholas Bellinger

    Jingoo Han
     

11 Apr, 2013

1 commit

  • This patch fixes a bug where a handful of informational / control CDBs
    that should be allowed during ALUA access state Standby/Offline/Transition
    where incorrectly returning CHECK_CONDITION + ASCQ_04H_ALUA_TG_PT_*.

    This includes INQUIRY + REPORT_LUNS, which would end up preventing LUN
    registration when LUN scanning occured during these ALUA access states.

    Cc: Hannes Reinecke
    Cc:
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

26 Feb, 2013

1 commit


11 Jan, 2013

1 commit


28 Nov, 2012

1 commit