lkml.org 
[lkml]   [2012]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 39/41] iscsi-target: Fix reservation conflict -EBUSY response handling bug
    3.2-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Nicholas Bellinger <nab@linux-iscsi.org>

    commit 00fdc6bbef77844ce397a7de7acfaf25e8e2e4eb upstream.

    This patch addresses a iscsi-target specific bug related to reservation conflict
    handling in iscsit_handle_scsi_cmd() that has been causing reservation conflicts
    to complete and not fail as expected due to incorrect errno checking. The problem
    occured with the change to return -EBUSY from transport_generic_cmd_sequencer() ->
    transport_generic_allocate_tasks() failures, that broke iscsit_handle_scsi_cmd()
    checking for -EINVAL in order to invoke a non GOOD status response.

    This was manifesting itself as data corruption with legacy SPC-2 reservations,
    but also effects iscsi-target LUNs with SPC-3 persistent reservations.

    This bug was originally introduced in lio-core commit:

    commit 03e98c9eb916f3f0868c1dc344dde2a60287ff72
    Author: Nicholas Bellinger <nab@linux-iscsi.org>
    Date: Fri Nov 4 02:36:16 2011 -0700

    target: Address legacy PYX_TRANSPORT_* return code breakage

    Reported-by: Martin Svec <martin.svec@zoner.cz>
    Cc: Martin Svec <martin.svec@zoner.cz>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/target/iscsi/iscsi_target.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/target/iscsi/iscsi_target.c
    +++ b/drivers/target/iscsi/iscsi_target.c
    @@ -1029,7 +1029,7 @@ done:
    return iscsit_add_reject_from_cmd(
    ISCSI_REASON_BOOKMARK_NO_RESOURCES,
    1, 1, buf, cmd);
    - } else if (transport_ret == -EINVAL) {
    + } else if (transport_ret < 0) {
    /*
    * Unsupported SAM Opcode. CHECK_CONDITION will be sent
    * in iscsit_execute_cmd() during the CmdSN OOO Execution



    \
     
     \ /
      Last update: 2012-03-17 00:45    [W:2.209 / U:0.752 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site