05 Aug, 2020

1 commit


29 Jul, 2020

2 commits

  • Target core is modified to call an optional backend callback function if a
    TMR is received or commands are aborted implicitly after a PR command was
    received. The backend function takes as parameters the se_dev, the type of
    the TMR, and the list of aborted commands. If no commands were aborted, an
    empty list is supplied.

    Link: https://lore.kernel.org/r/20200726153510.13077-3-bstroesser@ts.fujitsu.com
    Reviewed-by: Mike Christie
    Signed-off-by: Bodo Stroesser
    Signed-off-by: Martin K. Petersen

    Bodo Stroesser
     
  • iscsi_target_sk_data_ready() could be invoked indirectly by
    iscsi_target_do_login_rx() from the workqueue like this:

    iscsi_target_do_login_rx()
    iscsi_target_do_login()
    iscsi_target_do_tx_login_io()
    iscsit_put_login_tx()
    iscsi_login_tx_data()
    tx_data()
    sock_sendmsg_nosec()
    tcp_sendmsg()
    release_sock()
    sk_backlog_rcv()
    tcp_v4_do_rcv()
    tcp_data_ready()
    iscsi_target_sk_data_ready()

    At that time LOGIN_FLAGS_READ_ACTIVE is not cleared and
    iscsi_target_sk_data_ready will not read data from the socket. Some iscsi
    initiators (libiscsi) will wait forever for a reply.

    LOGIN_FLAGS_READ_ACTIVE should be cleared early just after doing the
    receive and before writing to the socket in iscsi_target_do_login_rx.

    Unfortunately, LOGIN_FLAGS_READ_ACTIVE is also used by sk_state_change to
    do login cleanup if a socket was closed at login time. It is supposed to be
    cleared after the login PDU is successfully processed and replied.

    Introduce another flag, LOGIN_FLAGS_WRITE_ACTIVE, to cover the transmit
    part.

    Link: https://lore.kernel.org/r/20200716100212.4237-2-houpu@bytedance.com
    Reviewed-by: Mike Christie
    Signed-off-by: Hou Pu
    Signed-off-by: Martin K. Petersen

    Hou Pu
     

10 Jun, 2020

3 commits

  • This commit also removes the unused argument, cdb, that was passed to this
    function.

    Link: https://lore.kernel.org/r/1591559913-8388-5-git-send-email-sudhakar.panneerselvam@oracle.com
    Reviewed-by: Mike Christie
    Signed-off-by: Sudhakar Panneerselvam
    Signed-off-by: Martin K. Petersen

    Sudhakar Panneerselvam
     
  • Initialization of orig_fe_lun is moved to transport_init_se_cmd() from
    transport_lookup_cmd_lun(). This helps for the cases where the SCSI request
    fails before the call to transport_lookup_cmd_lun() so that
    trace_target_cmd_complete() can print the LUN information to the trace
    buffer. Due to this change, the lun parameter is removed from
    transport_lookup_cmd_lun() and transport_lookup_tmr_lun().

    Link: https://lore.kernel.org/r/1591559913-8388-3-git-send-email-sudhakar.panneerselvam@oracle.com
    Reviewed-by: Mike Christie
    Signed-off-by: Sudhakar Panneerselvam
    Signed-off-by: Martin K. Petersen

    Sudhakar Panneerselvam
     
  • target_setup_cmd_from_cdb() is called after a successful call to
    transport_lookup_cmd_lun(). The new helper factors out the code that can be
    called before the call to transport_lookup_cmd_lun(). This helper will be
    used in an upcoming commit to address NULL pointer dereference.

    Link: https://lore.kernel.org/r/1591559913-8388-2-git-send-email-sudhakar.panneerselvam@oracle.com
    Reviewed-by: Mike Christie
    Signed-off-by: Sudhakar Panneerselvam
    Signed-off-by: Martin K. Petersen

    Sudhakar Panneerselvam
     

08 May, 2020

3 commits

  • Currently in tcmu reservation commands are handled by core's pr
    implementation (default) or completely rejected (emulate_pr set to 0). We
    additionally want to be able to do full reservation handling in
    userspace. Therefore we need a way to set TRANSPORT_FLAG_PASSTHROUGH_PGR.

    The inverted flag is displayed by attribute pgr_support. Since we moved
    the flag from transport/backend to se_device in the previous commit, we now
    can make it changeable per device by allowing to write the attribute. The
    new field transport_flags_changeable in transport/backend is used to reject
    writing if not allowed for a backend.

    Regarding ALUA we also want to be able to passthrough commands to userspace
    in tcmu. Therefore we need TRANSPORT_FLAG_PASSTHROUGH_ALUA to be
    changeable, because by setting it we can switch off all ALUA checks in
    core. So we also set TRANSPORT_FLAG_PASSTHROUGH_ALUA in tcmu's
    transport_flags_changeable.

    Of course, ALUA and reservation handling in userspace will work only, if
    session/nexus information is sent to userspace along with every
    command. This will be object of a patch series announced by Mike Christie.

    Link: https://lore.kernel.org/r/20200427150823.15350-5-bstroesser@ts.fujitsu.com
    Reviewed-by: Mike Christie
    Signed-off-by: Bodo Stroesser
    Signed-off-by: Martin K. Petersen

    Bodo Stroesser
     
  • pgr_support and alua_support device attributes show the inverted value of
    the transport_flags:

    * TRANSPORT_FLAG_PASSTHROUGH_PGR
    * TRANSPORT_FLAG_PASSTHROUGH_ALUA

    These attributes are per device, while the flags are per backend. Rename
    the transport_flags in backend/transport to transport_flags_default and use
    this value to initialize the new transport_flags field in the se_device
    structure.

    Now data and attribute both are per se_device.

    Link: https://lore.kernel.org/r/20200427150823.15350-4-bstroesser@ts.fujitsu.com
    Reviewed-by: Mike Christie
    Signed-off-by: Bodo Stroesser
    Signed-off-by: Martin K. Petersen

    Bodo Stroesser
     
  • tcmu has not set TRANSPORT_FLAG_PASSTHROUGH_PGR. Therefore the in-core pr
    emulation is active by default, but there are some attributes for
    configuration missing. Add them.

    Link: https://lore.kernel.org/r/20200427150823.15350-3-bstroesser@ts.fujitsu.com
    Reviewed-by: Mike Christie
    Signed-off-by: Bodo Stroesser
    Signed-off-by: Martin K. Petersen

    Bodo Stroesser
     

25 Apr, 2020

1 commit


27 Mar, 2020

1 commit

  • A number of hangs have been reported against the target driver; they are
    due to the fact that multiple threads may try to destroy the iscsi session
    at the same time. This may be reproduced for example when a "targetcli
    iscsi/iqn.../tpg1 disable" command is executed while a logout operation is
    underway.

    When this happens, two or more threads may end up sleeping and waiting for
    iscsit_close_connection() to execute "complete(session_wait_comp)". Only
    one of the threads will wake up and proceed to destroy the session
    structure, the remaining threads will hang forever.

    Note that if the blocked threads are somehow forced to wake up with
    complete_all(), they will try to free the same iscsi session structure
    destroyed by the first thread, causing double frees, memory corruptions
    etc...

    With this patch, the threads that want to destroy the iscsi session will
    increase the session refcount and will set the "session_close" flag to 1;
    then they wait for the driver to close the remaining active connections.
    When the last connection is closed, iscsit_close_connection() will wake up
    all the threads and will wait for the session's refcount to reach zero;
    when this happens, iscsit_close_connection() will destroy the session
    structure because no one is referencing it anymore.

    INFO: task targetcli:5971 blocked for more than 120 seconds.
    Tainted: P OE 4.15.0-72-generic #81~16.04.1
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    targetcli D 0 5971 1 0x00000080
    Call Trace:
    __schedule+0x3d6/0x8b0
    ? vprintk_func+0x44/0xe0
    schedule+0x36/0x80
    schedule_timeout+0x1db/0x370
    ? __dynamic_pr_debug+0x8a/0xb0
    wait_for_completion+0xb4/0x140
    ? wake_up_q+0x70/0x70
    iscsit_free_session+0x13d/0x1a0 [iscsi_target_mod]
    iscsit_release_sessions_for_tpg+0x16b/0x1e0 [iscsi_target_mod]
    iscsit_tpg_disable_portal_group+0xca/0x1c0 [iscsi_target_mod]
    lio_target_tpg_enable_store+0x66/0xe0 [iscsi_target_mod]
    configfs_write_file+0xb9/0x120
    __vfs_write+0x1b/0x40
    vfs_write+0xb8/0x1b0
    SyS_write+0x5c/0xe0
    do_syscall_64+0x73/0x130
    entry_SYSCALL_64_after_hwframe+0x3d/0xa2

    Link: https://lore.kernel.org/r/20200313170656.9716-3-mlombard@redhat.com
    Reported-by: Matt Coleman
    Tested-by: Matt Coleman
    Tested-by: Rahul Kundu
    Signed-off-by: Maurizio Lombardi
    Signed-off-by: Martin K. Petersen

    Maurizio Lombardi
     

17 Mar, 2020

1 commit

  • Move the get_unaligned_be24(), get_unaligned_le24() and
    put_unaligned_le24() definitions from various drivers into
    include/linux/unaligned/generic.h. Add a put_unaligned_be24()
    implementation.

    Link: https://lore.kernel.org/r/20200313203102.16613-4-bvanassche@acm.org
    Cc: Keith Busch
    Cc: Sagi Grimberg
    Cc: Jens Axboe
    Cc: Harvey Harrison
    Cc: Martin K. Petersen
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Andrew Morton
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Andy Shevchenko
    Reviewed-by: Greg Kroah-Hartman # For drivers/usb
    Reviewed-by: Felipe Balbi # For drivers/usb/gadget
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

22 Feb, 2020

3 commits

  • The emulate_ua_intlck_ctrl device attribute accepts values of 0, 1 or 2 via
    ConfigFS, which map to unit attention interlocks control codes in the MODE
    SENSE control Mode Page. Use an enum to track these values so that it's
    clear that, unlike the remaining emulate_X attributes,
    emulate_ua_intlck_ctrl isn't boolean.

    Link: https://marc.info/?l=target-devel&m=158227825428798
    Suggested-by: Bart Van Assche
    Signed-off-by: David Disseldorp
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     
  • This should harden us against configfs API regressions similar to the one
    fixed by the previous commit.

    Link: https://marc.info/?l=target-devel&m=158211731505174
    Signed-off-by: David Disseldorp
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     
  • The LIO unmap_zeroes_data device attribute is mapped to the LBPRZ flag in
    the READ CAPACITY(16) and Thin Provisioning VPD INQUIRY responses.

    The unmap_zeroes_data attribute is exposed via configfs, where any write
    value is correctly validated via strtobool(). However, when initialised via
    target_configure_unmap_from_queue() it takes the value of the device's
    max_write_zeroes_sectors queue limit, which is non-boolean.

    A non-boolean value can be read from configfs, but attempting to write the
    same value back results in -EINVAL, causing problems for configuration
    utilities such as targetcli.

    Link: https://marc.info/?l=target-devel&m=158213354011309
    Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
    Reviewed-by: Bart Van Assche
    Signed-off-by: David Disseldorp
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     

04 Oct, 2019

1 commit

  • Maintaining tpg_list without ever iterating over it is not useful. Hence
    remove tpg_list. This patch does not change the behavior of the SCSI target
    code.

    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Nicholas Bellinger
    Link: https://lore.kernel.org/r/20190930232224.58980-1-bvanassche@acm.org
    Signed-off-by: Bart Van Assche
    Reviewed-by: Mike Christie
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

13 Apr, 2019

2 commits

  • Since target_alloc_sgl() and iscsit_allocate_iovecs() allocate buffer space
    for se_cmd.data_length bytes and since that number can be smaller than the
    iSCSI Expected Data Transfer Length (EDTL), ensure that the iSCSI target
    driver does not attempt to receive more bytes than what fits in the receive
    buffer. Always receive the full immediate data buffer such that the iSCSI
    target driver does not attempt to parse immediate data as an iSCSI PDU.

    Note: the current code base only calls iscsit_get_dataout() if the size of
    the immediate data buffer does not exceed the buffer size derived from the
    SCSI CDB. See also target_cmd_size_check().

    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Nicholas Bellinger
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Instead of tracking the initiator that established an SPC-2 reservation,
    track the session through which the SPC-2 reservation has been
    established. This patch does not change any functionality.

    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Nicholas Bellinger
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

05 Feb, 2019

5 commits

  • Having both a function and a function pointer member with the same
    name (iscsit_release_cmd) is confusing. Hence rename the function pointer
    member.

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Change "unsoliticed" into "unsolicited".

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Sagi Grimberg
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Introduce a function that sends the SCSI status "BUSY" back to the
    initiator. The next patch will add a call to this function in the srpt
    target driver.

    Reviewed-by: Hannes Reinecke
    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Whether or not a session is being torn down does not affect whether or not
    SCSI commands are in the task set. Hence remove the "tearing down" checks
    from the TMF code. The TRANSPORT_ISTATE_PROCESSING check is left out
    because it is now safe to wait for a command that is in that state. The
    CMD_T_PRE_EXECUTE is left out because abort processing is postponed until
    after commands have left the pre-execute state since the patch that makes
    TMF processing synchronous.

    See also commit 1c21a48055a6 ("target: Avoid early CMD_T_PRE_EXECUTE
    failures during ABORT_TASK").

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Due to the patch that makes TMF handling synchronous the
    write_pending_status() callback function is no longer called. Hence remove
    it.

    Acked-by: Felipe Balbi
    Reviewed-by: Sagi Grimberg
    Reviewed-by: Andy Grover
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Bryant G. Ly
    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Himanshu Madhani
    Cc: Quinn Tran
    Cc: Saurav Kashyap
    Cc: Michael S. Tsirkin
    Cc: Juergen Gross
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

08 Dec, 2018

8 commits

  • In preparation for supporting user provided vendor strings, add an extra
    byte to the vendor, model and revision arrays in struct t10_wwn. This
    ensures that the full INQUIRY data can be carried in the arrays along with
    a null-terminator.

    Change a number of array readers and writers so that they account for
    explicit null-termination:

    - The pscsi_set_inquiry_info() and emulate_model_alias_store() codepaths
    don't currently explicitly null-terminate; fix this.

    - Existing t10_wwn field dumps use for-loops which step over
    null-terminators for right-padding.
    + Use printf with width specifiers instead.

    Signed-off-by: David Disseldorp
    Reviewed-by: Roman Bolshakov
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     
  • Instead of invoking target driver callback functions from the context that
    handles an abort or LUN RESET task management function, only set the abort
    flag from that context and perform the actual abort handling from the
    context of the regular command processing flow. This approach has the
    advantage that the task management code becomes much easier to read and to
    verify since the number of potential race conditions against the command
    processing flow is strongly reduced.

    This patch has been tested by running the following two shell commands
    concurrently for about ten minutes for both the iSCSI and the SRP target
    drivers ($dev is an initiator device node connected with storage provided
    by the target driver under test):

    * fio with data verification enabled on a filesystem mounted on top of
    $dev.

    * while true; do sg_reset -d $dev; echo -n .; sleep .1; done

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • The TASK ABORTED STATUS (TAS) bit is defined as follows in SAM:
    "TASK_ABORTED: this status shall be returned if a command is aborted by a
    command or task management function on another I_T nexus and the control
    mode page TAS bit is set to one". TAS handling is spread over the target
    core and the iSCSI target driver. If a LUN RESET is received, the target
    core will send the TASK_ABORTED response for all commands for which such a
    response has to be sent. If an ABORT TASK is received, only the iSCSI
    target driver will send the TASK_ABORTED response for the commands for
    which that response has to be sent. That is a bug since all target drivers
    have to honor the TAS bit. Fix this by moving the code that handles TAS
    from the iSCSI target driver into the target core. Additionally, if a
    command has been aborted, instead of sending the TASK_ABORTED status from
    the context that processes the SCSI command send it from the context of the
    ABORT TMF. The core_tmr_abort_task() change in this patch causes the
    CMD_T_TAS flag to be set if a TASK_ABORTED status has to be sent back to
    the initiator that submitted the command. If that flag has been set
    transport_cmd_finish_abort() will send the TASK_ABORTED response.

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Instead of allowing the code that aborts a SCSI command to finish before
    all iSCSI data frames have been received, make that code wait until all
    iSCSI data frames have been received. Introduce a new member variable in
    the target driver template to communicate that information from the iSCSI
    target driver to the target core. This change allows to leave out the check
    whether or not it is already safe to send the TASK_ABORTED reply from
    transport_send_task_abort().

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • This patch does not change any functionality but makes the patch that makes
    TMF handling synchronous easier to read.

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • A quote from SAM-5: "The order in which task management requests are
    processed is not specified by the SCSI architecture model. The SCSI
    architecture model does not require in-order delivery of such task
    management requests or processing by the task manager in the order
    received. To guarantee the processing order of task management requests
    referencing sent to a specific logical unit, an application client should
    not have more than one such task management request pending to that logical
    unit." This means that it is safe to use the system workqueues instead of
    tmr_wq for processing TMFs. An intended side effect of this patch is that
    it enables concurrent processing of TMFs.

    Reviewed-by: Christoph Hellwig
    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • A session must only be released after all code that accesses the session
    structure has finished. Make sure that this is the case by introducing a
    new command counter per session that is only decremented after the
    .release_cmd() callback has finished. This patch fixes the following crash:

    BUG: KASAN: use-after-free in do_raw_spin_lock+0x1c/0x130
    Read of size 4 at addr ffff8801534b16e4 by task rmdir/14805
    CPU: 16 PID: 14805 Comm: rmdir Not tainted 4.18.0-rc2-dbg+ #5
    Call Trace:
    dump_stack+0xa4/0xf5
    print_address_description+0x6f/0x270
    kasan_report+0x241/0x360
    __asan_load4+0x78/0x80
    do_raw_spin_lock+0x1c/0x130
    _raw_spin_lock_irqsave+0x52/0x60
    srpt_set_ch_state+0x27/0x70 [ib_srpt]
    srpt_disconnect_ch+0x1b/0xc0 [ib_srpt]
    srpt_close_session+0xa8/0x260 [ib_srpt]
    target_shutdown_sessions+0x170/0x180 [target_core_mod]
    core_tpg_del_initiator_node_acl+0xf3/0x200 [target_core_mod]
    target_fabric_nacl_base_release+0x25/0x30 [target_core_mod]
    config_item_release+0x9c/0x110 [configfs]
    config_item_put+0x26/0x30 [configfs]
    configfs_rmdir+0x3b8/0x510 [configfs]
    vfs_rmdir+0xb3/0x1e0
    do_rmdir+0x262/0x2c0
    do_syscall_64+0x77/0x230
    entry_SYSCALL_64_after_hwframe+0x49/0xbe

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     
  • Since transport_clear_lun_ref() already waits until the percpu-refcount
    .release() method is called, it is not necessary to wait first until
    percpu_ref_kill_and_confirm() has finished transitioning the refcount into
    atomic mode. Remove the code that waits for percpu_ref_kill_and_confirm()
    to complete and also the completion object that is used by that code. This
    patch does not change the behavior of the SCSI target code.

    Cc: Nicholas Bellinger
    Cc: Mike Christie
    Cc: Christoph Hellwig
    Cc: David Disseldorp
    Cc: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

29 Nov, 2018

3 commits

  • iscsi_target_mod is the only LIO fabric where fabric_ops.name differs from
    the fabric_ops.fabric_name string. fabric_ops.name is used when matching
    target/$fabric ConfigFS create paths, so rename it .fabric_alias and
    fallback to target/$fabric vs .fabric_name comparison if .fabric_alias
    isn't initialised. iscsi_target_mod is the only fabric module to set
    .fabric_alias . All other fabric modules rely on .fabric_name matching and
    can drop the duplicate string.

    Signed-off-by: David Disseldorp
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     
  • All fabrics return a const string. In all cases *except* iSCSI the
    get_fabric_name() string matches fabric_ops.name.

    Both fabric_ops.get_fabric_name() and fabric_ops.name are user-facing, with
    the former being used for PR/ALUA state and the latter for ConfigFS
    (config/target/$name), so we unfortunately need to keep both strings around
    for now. Replace the useless .get_fabric_name() accessor function with a
    const string fabric_name member variable.

    Signed-off-by: David Disseldorp
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     
  • On write, the pi_prot_format configfs attribute invokes the device
    format_prot() callback if present. Read dumps the contents of
    se_dev_attrib.pi_prot_format which is always zero. Make the configfs
    attribute write-only, and drop the always zero se_dev_attrib.pi_prot_format
    storage.

    Signed-off-by: David Disseldorp
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     

22 Nov, 2018

1 commit

  • The new emulate_pr backstore attribute allows for Persistent Reservation
    and SCSI2 RESERVE/RELEASE support to be completely disabled. This can be
    useful for scenarios such as:

    - Ensuring ATS (Compare & Write) usage on recent VMware ESXi initiators.

    - Allowing clustered (e.g. tcm-user) backends to block such requests,
    avoiding the multi-node reservation state propagation.

    When explicitly disabled, PR and RESERVE/RELEASE requests receive Invalid
    Command Operation Code response sense data.

    Signed-off-by: David Disseldorp
    Reviewed-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    David Disseldorp
     

16 Oct, 2018

2 commits


03 Aug, 2018

3 commits

  • This adds a function to remove a session which should be used by drivers
    that use target_setup_session. The next patches will convert the target
    drivers to use this new function.

    Signed-off-by: Mike Christie
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Chris Boot
    Cc: Bryant G. Ly
    Cc: Michael Cyr
    Cc:
    Cc: Johannes Thumshirn
    Cc: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Andrzej Pietrasiewicz
    Cc: Michael S. Tsirkin
    Cc: Juergen Gross
    Signed-off-by: Martin K. Petersen

    Mike Christie
     
  • Rename target_alloc_session to target_setup_session to avoid confusion with
    the other transport session allocation function that only allocates the
    session and because the target_alloc_session does so much more. It
    allocates the session, sets up the nacl and registers the session.

    The next patch will then add a remove function to match the setup in this
    one, so it should make sense for all drivers, except iscsi, to just call
    those 2 functions to setup and remove a session.

    iscsi will continue to be the odd driver.

    Signed-off-by: Mike Christie
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Chris Boot
    Cc: Bryant G. Ly
    Cc: Michael Cyr
    Cc:
    Cc: Johannes Thumshirn
    Cc: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Andrzej Pietrasiewicz
    Cc: Michael S. Tsirkin
    Cc: Juergen Gross
    Signed-off-by: Martin K. Petersen

    Mike Christie
     
  • transport_init_session_tags is only called from target_core_transport.c so
    make it static.

    Signed-off-by: Mike Christie
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Mike Christie