]> git.baikalelectronics.ru Git - kernel.git/commit
iscsi-target: Fix reservation conflict -EBUSY response handling bug
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 14 Mar 2012 01:20:11 +0000 (18:20 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 14 Mar 2012 04:43:58 +0000 (21:43 -0700)
commit6e39152f506ae36bd98ff30fbf8e472a1ed5fdf9
treedf8d71a6b9c9239b68d43fc04d57580caf3e4992
parent5d457fc554230bbe0326ca2108f67d0c545472b5
iscsi-target: Fix reservation conflict -EBUSY response handling bug

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 eb0c6d6458a5e65bb48f62cdc231f3d4c2784a2d
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>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c