Permalink
Commits on Feb 15, 2012
  1. firewire-sbp-target: Add to target Kconfig and Makefile

    bootc committed Feb 10, 2012
    This commit also adds an entry to the MAINTAINERS file.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  2. firewire-sbp-target: Add sbp_scsi_cmnd.{c,h}

    bootc committed Feb 10, 2012
    Miscellaneous functions for dealing with SCSI commands, status, sense
    data and data read/write. This is where the real grunt work of pushing
    data in and out of the FireWire bus happens.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  3. firewire-sbp-target: Add sbp_target_agent.{c,h}

    bootc committed Feb 10, 2012
    This implements the SBP-2 Command Block Agent, or Target Agent. This is
    what receives SCSI commands and forwards them to the target framework.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  4. firewire-sbp-target: Add sbp_login.{c,h}

    bootc committed Feb 10, 2012
    This file contains the implementation of the login, reconnect and logout
    management ORBs in SBP-2.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  5. firewire-sbp-target: add sbp_management_agent.{c,h}

    bootc committed Feb 10, 2012
    This code implements the SBP-2 Management Agent. This is the first of
    two firewire address handlers that are used to communicate with the
    target. The Management Agent is used to handle login, reconnect and
    logout to a SCSI LUN as well as task management functions.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  6. firewire-sbp-target: Add sbp_fabric.{c,h}

    bootc committed Feb 15, 2012
    This serves as further glue between the target framework and SBP-2, in
    this case dealing with SCSI command submission and data in/out.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  7. firewire-sbp-target: Add sbp_configfs.c

    bootc committed Feb 10, 2012
    This is used to glue the target framework's configfs code to the target
    code, and what is used to create targets and link them to LUNs to
    export. The code to create the FireWire unit directory to advertise
    targets on the FireWire bus is also in here.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  8. firewire-sbp-target: Add sbp_base.h header

    bootc committed Feb 10, 2012
    This header contains defines and structures that are common to many of
    the modules of the target code. This includes SBP-2 protocol structures
    and constants as well as a few structs for setting up the target, LUN
    login information and session setup.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  9. firewire-sbp-target: Add Kconfig, Makefile and TODO

    bootc committed Feb 10, 2012
    The FireWire SBP-2 Target is a driver for using an IEEE-1394 connection
    as a SCSI transport. This module uses the SCSI Target framework to
    expose LUNs to other machines attached to a FireWire bus, in effect
    acting as a FireWire hard disk similar to FireWire Target Disk mode on
    many Apple computers.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Andy Grover <agrover@redhat.com>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  10. firewire: Move fw_card kref functions into linux/firewire.h

    bootc committed Feb 1, 2012
    When writing a firewire driver that doesn't deal with struct fw_device
    objects (e.g. it only publishes FireWire units and doesn't subscribe to
    them), you likely need to keep referenced to struct fw_card objects so
    that you can send messages to other nodes. This patch moves
    fw_card_put(), fw_card_get() and fw_card_release() into the public
    include/linux/firewire.h header instead of drivers/firewire/core.h, and
    adds EXPORT_SYMBOL_GPL(fw_card_release).
    
    The firewire-sbp-target module requires these so it can keep a reference
    to the fw_card object in order that it can fetch ORBs to execute and
    read/write related data and status information.
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Cc: Clemens Ladisch <clemens@ladisch.de>
    Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
  11. firewire: Add function to get speed from opaque struct fw_request

    bootc committed Feb 6, 2012
    Sometimes it's useful to know the FireWire speed of the request that has
    just come in to a fw_address_handler callback. As struct fw_request is
    opaque we can't peek inside to get the speed out of the struct fw_packet
    that's just inside. For example, the SBP-2 spec says:
    
    "The speed at which the block write request to the MANAGEMENT_AGENT
    register is received shall determine the speed used by the target for
    all subsequent requests to read the initiator’s configuration ROM, fetch
    ORB’s from initiator memory or store status at the initiator’s
    status_FIFO. Command block ORB’s separately specify the speed for
    requests addressed to the data buffer or page table."
    
    [ ANSI T10/1155D Revision 4 page 53/54 ]
    
    Signed-off-by: Chris Boot <bootc@bootc.net>
    Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
    Cc: Clemens Ladisch <clemens@ladisch.de>
Commits on Feb 11, 2012
  1. target/usb-gadget: clean up command on error

    Sebastian Andrzej Siewior authored and nablio3000 committed Feb 10, 2012
    On normal processing the target framwork does the other put. In this
    case we have to do it on our own.
    
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. target/usb-gadget: free status req & cmd

    Sebastian Andrzej Siewior authored and nablio3000 committed Feb 10, 2012
    Those should be free() among with the others on cleanup
    
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  3. tcm_qla2xxx: Fix tcm_qla2xxx_do_rsp check condition cmd_kref leak

    nablio3000 committed Feb 11, 2012
    This patch fixes a bug in tcm_qla2xxx_do_rsp() where the direct call to
    transport_send_check_condition_and_sense() is leaking se_cmd->cmd_kref,
    and causing hangs during session shutdown.
    
    Change this to transport_generic_request_failure() so that target-core
    makes the proper callbacks into TFO->check_stop_free() ->
    tcm_qla2xxx_check_stop_free() -> target_put_sess_cmd()
    
    Reported-by: Roland Dreier <roland@purestorage.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  4. target: Export transport_generic_request_failure symbol

    nablio3000 committed Feb 11, 2012
    transport_generic_request_failure() is a wrapper around calling
    transport_send_check_condition_and_sense() that is required once
    an se_cmd->cmd_kref has been obtained via target_submit_cmd() ->
    target_get_sess_cmd().
    
    tcm_qla2xxx currently requires this, and since it's necessary for
    other callers using target_submit_cmd() make it exportable now.
    
    Reported-by: Roland Dreier <roland@purestorage.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Feb 9, 2012
  1. libfc.h: Remove left-over conflict marker

    nablio3000 committed Feb 9, 2012
    Reported-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. target: Cleanup transport_kunmap_data_sg()

    agrover authored and nablio3000 committed Feb 9, 2012
    This code isn't broken per se, but it's scary to look at! It looks like
    in the t_data_nents==1 case we're doing both a kunmap and a vunmap,
    what's saving us is that t_data_vmap in this case is 0, so vunmap
    doesn't do anything.
    
    Return after kunmap, so the handling of the three cases does not overlap.
    
    Signed-off-by: Andy Grover <agrover@redhat.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Feb 8, 2012
  1. qla2xxx: Set cmd->sess / ->loop_id when creating session

    rolandd authored and nablio3000 committed Feb 8, 2012
    Commit 401b01a ("qla2xxx: Remove duplicate assignments from
    qla_tgt_do_work") removed setting cmd->sess and cmd->loop_id, which is
    usually OK, except when we end up creating a new session in
    qla_tgt_do_work(), when it leads to dropping the command with the
    message from tcm_qla2xxx_handle_cmd():
    
        Unable to locate struct qla_tgt_sess from qla_tgt_cmd
    
    Re-add the needed assignments.
    
    Longer term it seems we may want to move the looking up of sessions
    into qla_tgt_do_work(), where it will be easier to avoid raciness that
    leads to creating multiple local sessions when a burst of commands
    comes in.
    
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Feb 7, 2012
  1. target: Fix unsupported WRITE_SAME sense payload

    Martin Svec authored and nablio3000 committed Feb 7, 2012
    This patch fixes a bug in target-core where unsupported WRITE_SAME ops
    from a target_check_write_same_discard() failure was incorrectly
    returning CHECK_CONDITION w/ TCM_INVALID_CDB_FIELD sense data.
    This was causing some clients to not properly fall back, so go ahead
    and use the correct TCM_UNSUPPORTED_SCSI_OPCODE sense for this case.
    
    Reported-by: Martin Svec <martin.svec@zoner.cz>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. iscsi: use IP_FREEBIND socket option

    dkelson authored and nablio3000 committed Feb 4, 2012
    Use IP_FREEBIND socket option so that iscsi portal configuration with
    explicit IP addresses can happen during boot, before network interfaces
    have been assigned IPs.
    
    This is especially important on systemd based Linux boxes where system
    boot happens asynchronously and non-trivial configuration must be done
    to get targetcli.service to start synchronously after the network is
    configured.
    
    Reference:
    http://lists.fedoraproject.org/pipermail/devel/2011-October/158025.html
    
    Signed-off-by: Dax Kelson <dkelson@gurulabs.com>
    Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
    Cc: "Andy Grover" <agrover@redhat.com>
    Cc: "Lennart Poettering" <lennart@poettering.net>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  3. tcm_fc: Convert call_rcu() to kfree_rcu(), drop ft_tport_rcu_free()

    Paul E. McKenney authored and nablio3000 committed Feb 4, 2012
    The call_rcu() in ft_tport_delete() invokes ft_tport_rcu_free(),
    which just does a kfree().  So convert the call_rcu() to kfree_rcu(),
    allowing ft_tport_rcu_free() to be eliminated.
    
    Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
    Cc: Jiri Kosina <jkosina@suse.cz>
    Cc: Jesper Juhl <jj@chaosbits.net>
    Cc: linux-scsi@vger.kernel.org
    Cc: target-devel@vger.kernel.org
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Feb 4, 2012
  1. tcm_loop: switch to using transport_handle_cdb_direct

    Christoph Hellwig authored and nablio3000 committed Feb 2, 2012
    Now that we use a workqueue for I/O submission there is no need to use
    transport_generic_handle_cdb_map any more.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. tcm_loop: defer all command submissions to workqueue

    Christoph Hellwig authored and nablio3000 committed Feb 2, 2012
    Apply the qla2xxx model of submitting all commands from a workqueue.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  3. tcm_loop: kill tcm_loop_allocate_core_cmd

    Christoph Hellwig authored and nablio3000 committed Feb 2, 2012
    This function makes little sense as a separate abstraction as it's deeply
    interwinded with the control flow of its only caller.  Merged it into
    tcm_loop_queuecommand after factoring out a helper to convert the task
    attribute representation.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  4. iblock: fix handling of large requests

    Christoph Hellwig authored and nablio3000 committed Feb 2, 2012
    Requesting to many bvecs upsets bio_alloc_bioset, so limit the number we ask
    for to the amount it can handle.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  5. target: handle empty string writes in sysfs

    Dan Carpenter authored and nablio3000 committed Jan 27, 2012
    These are root only and we're not likely to hit the problem in practise,
    but it makes the static checkers happy.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  6. [PATCH] iscsi_target: in_aton needs linux/inet.h

    Stephen Rothwell authored and nablio3000 committed Jan 23, 2012
    Fixes this error after a recent nfs cleanup:
    
    drivers/target/iscsi/iscsi_target_configfs.c: In function 'lio_target_call_addnptotpg':
    drivers/target/iscsi/iscsi_target_configfs.c:214:3: error: implicit declaration of function 'in6_pton' [-Werror=implicit-function-declaration]
    drivers/target/iscsi/iscsi_target_configfs.c:239:3: error: implicit declaration of function 'in_aton' [-Werror=implicit-function-declaration]
    
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Jan 26, 2012
  1. qla2xxx: Drop legacy target mode MODIFY_LUN_TYPE usage

    nablio3000 committed Jan 26, 2012
    This patch removes remaining legacy IOCB Type Code MODIFY_LUN_TYPE 0x0C
    and it's usage in qla_tgt_response_pkt() and other reponse handling.
    Also drop modify_lun_t and other related defines.
    
    Reported-by: Christoph Hellwig <hch@lst.de>
    Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
    Cc: Madhuranath Iyengar <mni@risingtidesystems.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. qla2xxx: Drop legacy pre 24xx target mode support

    nablio3000 committed Jan 26, 2012
    This patch removes qla2xxx LLD target mode support for pre 24xx
    (PCI-X) legacy hardware, and makes qla_target.c only support
    >= QLA 24xx (PCI-E) adapters for mainline target LLD code.
    
    Reported-by: Christoph Hellwig <hch@lst.de>
    Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
    Cc: Madhuranath Iyengar <mni@risingtidesystems.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Jan 24, 2012
  1. target: Make target_submit_cmd lookup lun failures avoid se_device

    nablio3000 committed Jan 24, 2012
    This patch makes transport_lookup_cmd_lun() failures in
    target_submit_cmd() use transport_send_check_condition_and_sense() and
    target_put_sess_cmd() directly to avoid se_cmd->se_dev reference in
    transport_generic_request_failure() handling.
    
    It also drops the out_check_cond: label and use direct reference for
    allocate task failures, and per-se_device queue_full handling is
    currently not supported for transport_lookup_cmd_lun() failure
    descriptors due to se_device dependency.
    
    Reported-by: Roland Dreier <roland@purestorage.com>
    Cc: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Jan 21, 2012
  1. target: Fix iblock se_dev_attrib.unmap_granularity

    Marco Sanvido authored and nablio3000 committed Jan 20, 2012
    The block layer keeps q->limits.discard_granularity in bytes, but iblock
    (and the SCSI Block Limits VPD page) keep unmap_granularity in blocks.
    Report the correct value when exporting block devices by dividing to
    convert bytes to blocks.
    
    Signed-off-by: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. target: Fix target_submit_cmd() exception path kref_put leak

    nablio3000 committed Jan 21, 2012
    This patch fixes a bug in target_submit_cmd() where the direct call
    to transport_send_check_condition_and_sense() was not calling the
    final target_put_sess_cmd() release callback.
    
    Use proper transport_generic_request_failure() wrapper instead around
    transport_send_check_condition_and_sense() to handle kref_put() along
    with potential internal queue full response processing.
    
    Reported-by: Roland Dreier <roland@purestorage.com>
    Cc: Roland Dreier <roland@purestorage.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  3. target: Change target_submit_cmd() to return void

    agrover authored and nablio3000 committed Jan 19, 2012
    Retval not very useful, and may even be harmful. Once submitted, fabrics
    should expect a sense error if anything goes wrong. All fabrics checking
    of this retval are useless or broken:
    
    fc checks it just to emit more debug output.
    ib_srpt trickles retval up, then it is ignored.
    qla2xxx trickles it up, which then causes a bug because the abort goto
    in qla_target.c thinks cmd hasn't been sent to target.
    
    Just returning nothing is best.
    
    (nab: Fix up usb-gadget usage with target_submit_cmd)
    
    Signed-off-by: Andy Grover <agrover@redhat.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Commits on Jan 20, 2012
  1. target/fc: Use target_submit_tmr()

    agrover authored and nablio3000 committed Jan 19, 2012
    Make use of the new helper function to submit a TMR.
    
    Signed-off-by: Andy Grover <agrover@redhat.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  2. target: Add target_submit_tmr helper function

    agrover authored and nablio3000 committed Jan 19, 2012
    Similar to target_submit_cmd, this function lets fabrics call one function
    (albeit with a lot of parameters) instead of 3 or more.
    
    Signed-off-by: Andy Grover <agrover@redhat.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>