From: Nicholas Bellinger Date: Sun, 18 Mar 2012 00:40:23 +0000 (-0700) Subject: loopback: Fix transport_generic_allocate_tasks error handling X-Git-Tag: v3.12-rc1~3633^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee9b866a3696ae434418348e2f499c41841366d4;p=kernel%2Fkernel-generic.git loopback: Fix transport_generic_allocate_tasks error handling 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 target-pending/for-next-merge with the following for-3.4 commit: commit 16786454acec0e0e55e32d508b3058b32c1f23f3 Author: Christoph Hellwig Date: Thu Feb 2 17:04:42 2012 -0500 tcm_loop: switch to using transport_handle_cdb_direct Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 22f4fe7..a9b4eee 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) TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); transport_generic_free_cmd(se_cmd, 0); return; - } - if (ret == -EINVAL) { + } else if (ret < 0) { if (se_cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT) tcm_loop_queue_status(se_cmd); else