]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.12/0039-iscsi-target-Fix-reservation-conflict-EBUSY-response.patch
linux-ti33x-psp 3.2: update to 3.2.13
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.12 / 0039-iscsi-target-Fix-reservation-conflict-EBUSY-response.patch
1 From 68cefddd17e9b4f4600a64b0351acff4bb250419 Mon Sep 17 00:00:00 2001
2 From: Nicholas Bellinger <nab@linux-iscsi.org>
3 Date: Tue, 13 Mar 2012 18:20:11 -0700
4 Subject: [PATCH 39/42] iscsi-target: Fix reservation conflict -EBUSY response
5  handling bug
7 commit 00fdc6bbef77844ce397a7de7acfaf25e8e2e4eb upstream.
9 This patch addresses a iscsi-target specific bug related to reservation conflict
10 handling in iscsit_handle_scsi_cmd() that has been causing reservation conflicts
11 to complete and not fail as expected due to incorrect errno checking.  The problem
12 occured with the change to return -EBUSY from transport_generic_cmd_sequencer() ->
13 transport_generic_allocate_tasks() failures, that broke iscsit_handle_scsi_cmd()
14 checking for -EINVAL in order to invoke a non GOOD status response.
16 This was manifesting itself as data corruption with legacy SPC-2 reservations,
17 but also effects iscsi-target LUNs with SPC-3 persistent reservations.
19 This bug was originally introduced in lio-core commit:
21 commit 03e98c9eb916f3f0868c1dc344dde2a60287ff72
22 Author: Nicholas Bellinger <nab@linux-iscsi.org>
23 Date:   Fri Nov 4 02:36:16 2011 -0700
25     target: Address legacy PYX_TRANSPORT_* return code breakage
27 Reported-by: Martin Svec <martin.svec@zoner.cz>
28 Cc: Martin Svec <martin.svec@zoner.cz>
29 Cc: Christoph Hellwig <hch@lst.de>
30 Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 ---
33  drivers/target/iscsi/iscsi_target.c |    2 +-
34  1 file changed, 1 insertion(+), 1 deletion(-)
36 diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
37 index 0c1d5c73..03d3528 100644
38 --- a/drivers/target/iscsi/iscsi_target.c
39 +++ b/drivers/target/iscsi/iscsi_target.c
40 @@ -1029,7 +1029,7 @@ done:
41                 return iscsit_add_reject_from_cmd(
42                                 ISCSI_REASON_BOOKMARK_NO_RESOURCES,
43                                 1, 1, buf, cmd);
44 -       } else if (transport_ret == -EINVAL) {
45 +       } else if (transport_ret < 0) {
46                 /*
47                  * Unsupported SAM Opcode.  CHECK_CONDITION will be sent
48                  * in iscsit_execute_cmd() during the CmdSN OOO Execution
49 -- 
50 1.7.9.4