Patch "target: Use complete_all for se_cmd->t_transport_stop_comp" has been added to the 3.15-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    target: Use complete_all for se_cmd->t_transport_stop_comp

to the 3.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     target-use-complete_all-for-se_cmd-t_transport_stop_comp.patch
and it can be found in the queue-3.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From a95d6511303b848da45ee27b35018bb58087bdc6 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Date: Mon, 9 Jun 2014 23:36:51 +0000
Subject: target: Use complete_all for se_cmd->t_transport_stop_comp

From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

commit a95d6511303b848da45ee27b35018bb58087bdc6 upstream.

This patch fixes a bug where multiple waiters on ->t_transport_stop_comp
occurs due to a concurrent ABORT_TASK and session reset both invoking
transport_wait_for_tasks(), while waiting for the associated se_cmd
descriptor backend processing to complete.

For this case, complete_all() should be invoked in order to wake up
both waiters in core_tmr_abort_task() + transport_generic_free_cmd()
process contexts.

Cc: Thomas Glanzmann <thomas@xxxxxxxxxxxx>
Cc: Charalampos Pournaris <charpour@xxxxxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/target/target_core_transport.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -562,7 +562,7 @@ static int transport_cmd_check_stop(stru
 
 		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
 
-		complete(&cmd->t_transport_stop_comp);
+		complete_all(&cmd->t_transport_stop_comp);
 		return 1;
 	}
 
@@ -687,7 +687,7 @@ void target_complete_cmd(struct se_cmd *
 	if (cmd->transport_state & CMD_T_ABORTED &&
 	    cmd->transport_state & CMD_T_STOP) {
 		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
-		complete(&cmd->t_transport_stop_comp);
+		complete_all(&cmd->t_transport_stop_comp);
 		return;
 	} else if (!success) {
 		INIT_WORK(&cmd->work, target_complete_failure_work);
@@ -1761,7 +1761,7 @@ void target_execute_cmd(struct se_cmd *c
 			cmd->se_tfo->get_task_tag(cmd));
 
 		spin_unlock_irq(&cmd->t_state_lock);
-		complete(&cmd->t_transport_stop_comp);
+		complete_all(&cmd->t_transport_stop_comp);
 		return;
 	}
 


Patches currently in stable-queue which might be from nab@xxxxxxxxxxxxxxx are

queue-3.15/target-report-correct-response-length-for-some-commands.patch
queue-3.15/target-iser-fix-a-wrong-dereference-in-case-discovery-session-is-over-iser.patch
queue-3.15/target-iser-fix-hangs-in-connection-teardown.patch
queue-3.15/target-iscsi-fix-sendtargets-response-pdu-for-iser-transport.patch
queue-3.15/target-iser-bail-from-accept_np-if-np_thread-is-trying-to-close.patch
queue-3.15/target-use-complete_all-for-se_cmd-t_transport_stop_comp.patch
queue-3.15/libiscsi-iser-adjust-data_length-to-include-protection-information.patch
queue-3.15/target-set-cmd_t_active-bit-for-task-management-requests.patch
queue-3.15/target-iser-wait-for-proper-cleanup-before-unloading.patch
queue-3.15/target-sbc-loopback-adjust-command-data-length-in-case-pi-exists-on-the-wire.patch
queue-3.15/target-iser-gracefully-reject-t10-pi-enabled-connect-request-if-not-supported.patch
queue-3.15/scsi_cmnd-introduce-scsi_transfer_length-helper.patch
queue-3.15/target-iser-improve-cm-events-handling.patch
queue-3.15/iscsi-target-fix-abort_task-connection-reset-iscsi_queue_req-memory-leak.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]