Skip to contentSkip to conversation

target: lock => unlock typo

PATCH Applied Dan Carpenter 3 participants 3 messages May 8, 2012 – May 9, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: lock => unlock typo

target_stop_cmd() returns with the lock held and IRQs disabled. The intent was to unlock here.

drivers/target/target_core_transport.c +1 -1
index 0d838ab..8bd9ffe 100644
@@ -3769,7 +3769,7 @@ static int transport_lun_wait_for_tasks(struct se_cmd *cmd, struct se_lun *lun)
 	    (cmd->transport_state & CMD_T_SENT)) {
 		if (!target_stop_cmd(cmd, &flags))
 			ret++;
-		spin_lock_irqsave(&cmd->t_state_lock, flags);
+		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
 	} else {
 		spin_unlock_irqrestore(&cmd->t_state_lock,
 				flags);
#2 lore raw
In reply to Dan Carpenter
Quoted 10 lines · Dan Carpenter

target_stop_cmd() returns with the lock held and IRQs disabled. The intent was to unlock here.

drivers/target/target_core_transport.c +0 -0
index 0d838ab..8bd9ffe 100644

drivers/target/target_core_transport.c static int transport_lun_wait_for_tasks(struct se_cmd *cmd, struct se_lun *lun)

Quoted 9 lines
drivers/target/target_core_transport.c +1 -2
@@ -3769,7 +3769,7 @@ static int transport_lun_wait_for_tasks(struct se_cmd *cmd, struct se_lun *lun)
 	    (cmd->transport_state & CMD_T_SENT)) {
 		if (!target_stop_cmd(cmd, &flags))
 			ret++;
-		spin_lock_irqsave(&cmd->t_state_lock, flags);
+		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
 	} else {
 		spin_unlock_irqrestore(&cmd->t_state_lock,
 				flags);
--

Applied to lio-core, and folding into hch's original commit that introduced the bug in for-next.

Thanks Dan!

--nab