[PATCH 07/13] target: remove TF_TIMER_STOP

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

 



TF_TIMER_STOP is useless as it only helps to mitigate a tiny race during
deleting the timer.  But given that we have cleared TF_ACTIVE at this point
we already have another mitigation a few lines down the function.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: lio-core/drivers/target/target_core_transport.c
===================================================================
--- lio-core.orig/drivers/target/target_core_transport.c	2011-10-17 15:15:12.976650295 +0200
+++ lio-core/drivers/target/target_core_transport.c	2011-10-17 15:17:06.675288911 +0200
@@ -2068,10 +2068,6 @@ static void transport_task_timeout_handl
 	pr_debug("transport task timeout fired! task: %p cmd: %p\n", task, cmd);
 
 	spin_lock_irqsave(&cmd->t_state_lock, flags);
-	if (task->task_flags & TF_TIMER_STOP) {
-		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
-		return;
-	}
 	task->task_flags &= ~TF_TIMER_RUNNING;
 
 	/*
@@ -2155,14 +2151,12 @@ void __transport_stop_task_timer(struct
 	if (!(task->task_flags & TF_TIMER_RUNNING))
 		return;
 
-	task->task_flags |= TF_TIMER_STOP;
 	spin_unlock_irqrestore(&cmd->t_state_lock, *flags);
 
 	del_timer_sync(&task->task_timer);
 
 	spin_lock_irqsave(&cmd->t_state_lock, *flags);
 	task->task_flags &= ~TF_TIMER_RUNNING;
-	task->task_flags &= ~TF_TIMER_STOP;
 }
 
 static void transport_stop_all_task_timers(struct se_cmd *cmd)
Index: lio-core/include/target/target_core_base.h
===================================================================
--- lio-core.orig/include/target/target_core_base.h	2011-10-17 15:16:30.920650798 +0200
+++ lio-core/include/target/target_core_base.h	2011-10-17 15:16:32.920648246 +0200
@@ -78,7 +78,6 @@ enum se_task_flags {
 	TF_TIMEOUT		= (1 << 2),
 	TF_REQUEST_STOP		= (1 << 3),
 	TF_TIMER_RUNNING	= (1 << 4),
-	TF_TIMER_STOP		= (1 << 5),
 };
 
 /* Special transport agnostic struct se_cmd->t_states */

--
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


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux