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
     

13 Feb, 2014

1 commit

  • This patch addresses a >= v3.11 free-after-use regression
    in core_scsi3_emulate_pro_register() that was introduced
    in the following commit:

    commit bc118fe4c4a8cfa453491ba77c0a146a6d0e73e0
    Author: Andy Grover
    Date: Thu May 16 10:41:04 2013 -0700

    target: Further refactoring of core_scsi3_emulate_pro_register()

    To avoid the free-after-use, save an type value before hand, and
    only call core_scsi3_put_pr_reg() with a valid *pr_reg.

    Reported-by: Dan Carpenter
    Cc: Andy Grover
    Cc: #3.11+
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

21 Nov, 2013

1 commit


11 Sep, 2013

2 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
     

04 Jul, 2013

1 commit

  • 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: kbuild test robot
    Cc: Andy Grover
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

14 Jun, 2013

11 commits


26 Feb, 2013

1 commit


11 Jan, 2013

1 commit


28 Nov, 2012

1 commit


08 Nov, 2012

1 commit


07 Nov, 2012

3 commits

  • 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: Christoph Hellwig
    Cc: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    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: Christoph Hellwig

    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: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

18 Sep, 2012

2 commits


08 Sep, 2012

1 commit


17 Jul, 2012

2 commits


22 May, 2012

1 commit

  • Pull scsi-target changes from Nicholas Bellinger:
    "There has been lots of work in existing code in a number of areas this
    past cycle. The major highlights have been:

    * Removal of transport_do_task_sg_chain() from core + fabrics
    (Roland)
    * target-core: Removal of se_task abstraction from target-core and
    enforce hw_max_sectors for pSCSI backends (hch)
    * Re-factoring of iscsi-target tx immediate/response queues (agrover)
    * Conversion of iscsi-target back to using target core memory
    allocation logic (agrover)

    We've had one last minute iscsi-target patch go into for-next to
    address a nasty regression bug related to the target core allocation
    logic conversion from agrover that is not included in friday's
    linux-next build, but has been included in this series.

    On the new fabric module code front for-3.5, here is a brief status
    update for the three currently in flight this round:

    * usb-gadget target driver:

    Sebastian Siewior's driver for supporting usb-gadget target mode
    operation. This will be going out as a separate PULL request from
    target-pending/usb-target-merge with subsystem maintainer ACKs. There
    is one minor target-core patch in this series required to function.

    * sbp ieee-1394/firewire target driver:

    Chris Boot's driver for supportting the Serial Block Protocol (SBP)
    across IEEE-1394 Firewire hardware. This will be going out as a
    separate PULL request from target-pending/sbp-target-merge with two
    additional drivers/firewire/ patches w/ subsystem maintainer ACKs.

    * qla2xxx LLD target mode infrastructure changes + tcm_qla2xxx:

    The Qlogic >= 24xx series HW target mode LLD infrastructure patch-set
    and tcm_qla2xxx fabric driver. Support for FC target mode using
    qla2xxx LLD code has been officially submitted by Qlogic to James
    below, and is currently outstanding but not yet merged into
    scsi.git/for-next..

    [PATCH 00/22] qla2xxx: Updates for scsi "misc" branch
    http://www.spinics.net/lists/linux-scsi/msg59350.html

    Note there are *zero* direct dependencies upon this for-next series
    for the qla2xxx LLD target + tcm_qla2xxx patches submitted above, and
    over the last days the target mode team has been tracking down an
    tcm_qla2xxx specific active I/O shutdown bug that appears to now be
    almost squashed for 3.5-rc-fixes."

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (47 commits)
    iscsi-target: Fix iov_count calculation bug in iscsit_allocate_iovecs
    iscsi-target: remove dead code in iscsi_check_valuelist_for_support
    target: Handle ATA_16 passthrough for pSCSI backend devices
    target: Add MI_REPORT_TARGET_PGS ext. header + implict_trans_secs attribute
    target: Fix MAINTENANCE_IN service action CDB checks to use lower 5 bits
    target: add support for the WRITE_VERIFY command
    target: make target_put_session void
    target: cleanup transport_execute_tasks()
    target: Remove max_sectors device attribute for modern se_task less code
    target: lock => unlock typo in transport_lun_wait_for_tasks
    target: Enforce hw_max_sectors for SCF_SCSI_DATA_SG_IO_CDB
    target: remove the t_se_count field in struct se_cmd
    target: remove the t_task_cdbs_ex_left field in struct se_cmd
    target: remove the t_task_cdbs_left field in struct se_cmd
    target: remove struct se_task
    target: move the state and execute lists to the command
    target: simplify command to task linkage
    target: always allocate a single task
    target: replace ->execute_task with ->execute_cmd
    target: remove the task_sectors field in struct se_task
    ...

    Linus Torvalds
     

15 May, 2012

1 commit

  • 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: Bernhard Kohl
    Cc:
    Signed-off-by: Nicholas Bellinger

    Bernhard Kohl
     

07 May, 2012

1 commit


15 Apr, 2012

1 commit

  • This patch includes the handful of squashed patches for target/iscsi from
    Andy's original series into lio-core/master code:

    *) Make iscsit_add_reject static
    *) Remove unused data_offset_end from iscsi_datain_req
    *) Remove "#if 0" stubs
    *) Rename iscsi_datain_req to cmd_datain_node
    *) Cleanups for built_r2ts_for_cmd()
    *) Cleanups for Cleanup build_sendtargets_response()

    Signed-off-by: Andy Grover
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     

23 Mar, 2012

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "This contains the usual set of updates and bugfixes to target-core +
    existing fabric module code, along with a handful of the patches
    destined for v3.3 stable.

    It also contains the necessary target-core infrastructure pieces
    required to run using tcm_qla2xxx.ko WWPNs with the new Qlogic Fibre
    Channel fabric module currently queued in target-pending/for-next-merge,
    and coming for round 2.

    The highlights for this series include:

    - Add target_submit_tmr() helper function for fabric task management
    (andy)
    - Convert tcm_fc to use target_submit_tmr() (andy)
    - Replace target core various cmd flags with a transport state (hch)
    - Convert loopback to use workqueue submission (hch)
    - Convert target core to use array_zalloc for tpg_lun_list (joern)
    - Convert target core to use array_zalloc for device_list (joern)
    - Add target core support for TMR_ABORT_TASK (nab)
    - Add target core se_sess->sess_kref + get/put helpers (nab)
    - Add target core se_node_acl->acl_kref for ->acl_free_comp usage
    (nab)
    - Convert iscsi-target to use target_put_session + sess_kref (nab)
    - Fix tcm_fc fc_exch memory leak in ft_send_resp_status (nab)
    - Fix ib_srpt srpt_handle_cmd send_ioctx->ioctx_kref leak on
    exception (nab)
    - Fix target core up handling of short INQUIRY buffers (roland)
    - Untangle target-core front-end and back-end meanings of max_sectors
    attribute (roland)
    - Set loopback residual field for SCSI commands (roland)
    - Fix target-core 16-bit target ports for SET TARGET PORT GROUPS
    emulation (roland)

    Thanks again to Andy, Christoph, Joern, Roland, and everyone who has
    contributed this round!"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (64 commits)
    ib_srpt: Fix srpt_handle_cmd send_ioctx->ioctx_kref leak on exception
    loopback: Fix transport_generic_allocate_tasks error handling
    iscsi-target: remove improper externs
    iscsi-target: Remove unused variables in iscsi_target_parameters.c
    target: remove obvious warnings
    target: Use array_zalloc for device_list
    target: Use array_zalloc for tpg_lun_list
    target: Fix sense code for unsupported SERVICE ACTION IN
    target: Remove hack to make READ CAPACITY(10) lie if thin provisioning is enabled
    target: Bump core version to v4.1.0-rc2-ml + fabric versions
    tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
    target: Drop unused legacy target_core_fabric_ops API callers
    iscsi-target: Convert to use target_put_session + sess_kref
    target: Convert se_node_acl->acl_group removal to use ->acl_kref
    target: Add se_node_acl->acl_kref for ->acl_free_comp usage
    target: Add se_node_acl->acl_free_comp for NodeACL release path
    target: Add se_sess->sess_kref + get/put helpers
    target: Convert session_lock to irqsave
    target: Fix typo in drivers/target
    iscsi-target: Fix dynamic -> explict NodeACL pointer reference
    ...

    Linus Torvalds
     

16 Mar, 2012

2 commits

  • Get rid of a bunch of write-only variables. In a number of cases I
    suspect actual bugs to be present, so I left all of those for a second
    look.

    (nab: fix lio-core patch fuzz)

    Signed-off-by: Joern Engel
    Signed-off-by: Nicholas Bellinger

    Jörn Engel
     
  • Turns an order-8 allocation into slab-sized ones, thereby preventing
    allocation failures with memory fragmentation.

    This likely saves memory as well, as the slab allocator can pack objects
    more tightly than the buddy allocator.

    (nab: Fix lio-core patch fuzz)

    Signed-off-by: Joern Engel
    Signed-off-by: Nicholas Bellinger

    Jörn Engel
     

14 Mar, 2012

1 commit

  • 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 eacac00ce5bfde8086cd0615fb53c986f7f970fe
    Author: Christoph Hellwig
    Date: Thu Nov 3 17:50:40 2011 -0400

    target: split core_scsi2_emulate_crh

    Reported-by: Martin Svec
    Cc: Martin Svec
    Cc: Christoph Hellwig
    Cc: stable@vger.kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

26 Feb, 2012

1 commit

  • 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: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Roland Dreier
     

18 Jan, 2012

2 commits

  • We need to handle >1 page control cdbs, so extend the code to do a vmap
    if bigger than 1 page. It seems like kmap() is still preferable if just
    a page, fewer TLB shootdowns(?), so keep using that when possible.

    Rename function pair for their new scope.

    Signed-off-by: Andy Grover
    Cc:
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     
  • Initiators that aren't the active reservation holder should be able to
    do a PERSISTENT RESERVE IN command in all cases, so add it to the list
    of allowed CDBs in core_scsi3_pr_seq_non_holder().

    Signed-off-by: Marco Sanvido
    Signed-off-by: Roland Dreier
    Cc:
    Signed-off-by: Nicholas Bellinger

    Marco Sanvido