[PATCH] loopback: Fix transport_generic_allocate_tasks error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

This patch addresses a tcm_loop bug with transport_generic_allocate_tasks()
return checking in tcm_loop_submission_work() where other non zero return
codes (including -EBUSY for reservation conflicts) are incorrectly falling
through to transport_generic_map_mem_to_cmd() -> transport_handle_cdb_direct().

This bug was introduced into lio-core with the following for-3.4 commit:

commit 7e374ec15ec05e3eb88e87d90ccfc6c5c872f6df
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Thu Feb 2 17:04:42 2012 -0500

    tcm_loop: switch to using transport_handle_cdb_direct

Cc: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
 drivers/target/loopback/tcm_loop.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 859f81a..484a253 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -233,8 +233,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
 		transport_generic_free_cmd(se_cmd, 0);
-	}
-	if (ret == -EINVAL) {
+	} else if (ret < 0) {
 		if (se_cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT)

To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photos]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux