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


07 Nov, 2012

4 commits

  • Fix a bug introduced with patch "target: pass sense_reason as a return value"
    in for-3.8 code where only target port groups with TPGS_EXPLICT_ALUA set
    need to be allowed to perform explictly ALUA.

    Cc: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • 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 always support ALUA for virtual backends, and never for physical ones. Simplify
    the code to just deal with these two cases and remove the superflous abstractions.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    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

1 commit


08 Sep, 2012

1 commit


13 Jun, 2012

1 commit

  • The error paths in target_emulate_set_target_port_groups() are all
    essentially "rc = -EINVAL; goto out;" but the code at "out:" ignores
    rc and always returns success. This means that even if eg explicit
    ALUA is turned off, the initiator will always see a good SCSI status
    for SET TARGET PORT GROUPS.

    Fix this by returning rc as is intended. It appears this bug was
    added by the following patch:

    commit 05d1c7c0d0db4cc25548d9aadebb416888a82327
    Author: Andy Grover
    Date: Wed Jul 20 19:13:28 2011 +0000

    target: Make all control CDBs scatter-gather

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

    Roland Dreier
     

17 May, 2012

2 commits

  • This patch adds support for ALUA MI_REPORT_TARGET_PGS extended header
    format defined within SPC-4. It changes target core ALUA emulation logic
    within target_emulate_report_target_port_groups() to support both the
    extended and original length only header formats.

    It includes adding a new 'implict_trans_secs' attribute for each ALUA
    target port group to control the value returned to the application client
    for an recommended implict translation timeout in seconds. By default
    this value is currently set to zero, and limited up to 255 by virtue of
    using a single byte in the extended header format.

    This value is used by target_emulate_report_target_port_groups() within
    the extended header logic to set IMPLICIT TRANSITION TIME as defined by
    spc4r30.

    Cc: Hannes Reinecke
    Cc: Rob Evers
    Cc: Christoph Hellwig
    Cc: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • This patch fixes the MAINTENANCE_IN service action type checks to only
    look at the proper lower 5 bits of cdb byte 1. This addresses the case
    where MI_REPORT_TARGET_PGS w/ extended header using the upper three bits of
    cdb byte 1 was not processed correctly in transport_generic_cmd_sequencer,
    as well as the three cases for standby, unavailable, and transition ALUA
    primary access state checks.

    Also add MAINTENANCE_IN to the excluded list in transport_generic_prepare_cdb()
    to prevent the PARAMETER DATA FORMAT bits from being cleared.

    Cc: Hannes Reinecke
    Cc: Rob Evers
    Cc: Christoph Hellwig
    Cc: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

07 May, 2012

1 commit


26 Feb, 2012

1 commit


18 Jan, 2012

1 commit

  • 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
     

14 Dec, 2011

2 commits

  • This reorganized the headers under include/target into:

    - target_core_base.h stays as is with all target-wide data stuctures and defines
    - target_core_backend.h contains the whole interface to I/O backends
    - target_core_fabric.h contains the whole interface to fabric modules

    Except for those only the various configfs macro headers stay around.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Create a new headers, drivers/target/target_core_internal.h that is supposed
    to hold all target_core-internal prototypes. Move all non-exported includes
    from include/target to it, and merge the smaller prototype-only includes
    inside drivers/target into it as well. Mark functions that were found to
    not be called outside their implementation file static.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

06 Dec, 2011

2 commits

  • Some are never used, some are set but never read, dev_hoq_count is
    incremented and decremented, but never read.

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

    Jörn Engel
     
  • This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
    of locations and addresses cases where transport_generic_request_failure()
    was returning the incorrect sense upon CHECK_CONDITION status after the
    v3.1 converson to use errno return codes.

    This includes the conversion of transport_generic_request_failure() to
    process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
    before calling transport_send_check_condition_and_sense() to queue up
    response status. It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
    usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
    for these cases.

    transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
    SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
    all been updated to set se_cmd->scsi_sense_reason and return errno codes
    universally upon failure. This includes cmd->scsi_sense_reason assignment
    in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.

    Finally it updates fabric modules to remove the legacy usage, and for
    TFO->new_cmd_map() callers forwards return values outside of fabric code.
    iscsi-target has also been updated to remove a handful of special cases
    related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()

    (v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
    transport_generic_new_cmd, and re-add missing task->task_error_status
    assignment in transport_complete_task)

    Cc: Christoph Hellwig
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger