]> git.proxmox.com Git - mirror_spl.git/commitdiff
Fix delay()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 May 2013 23:20:28 +0000 (16:20 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 May 2013 23:35:47 +0000 (16:35 -0700)
Somewhat amazingly it went unnoticed that the delay() function
doesn't actually cause the task to block.  Since the task state
is never changed from TASK_RUNNING before schedule_timeout() the
scheduler allows to task to continue running without any delay.
Using schedule_timeout_interruptible() resolves the issue by
correctly setting TASK_UNINTERRUPTIBLE.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/timer.h

index 13ef4045247f35450384b0b539b47f07f615f2b6..2542510dd299574a9d4e1138cd58ca1433be871d 100644 (file)
@@ -35,7 +35,7 @@
 #define ddi_get_lbolt()                        ((clock_t)jiffies)
 #define ddi_get_lbolt64()              ((int64_t)get_jiffies_64())
 
-#define delay(ticks)                   schedule_timeout((long)(ticks))
+#define delay(ticks)                   schedule_timeout_uninterruptible(ticks)
 
 #define SEC_TO_TICK(sec)               ((sec) * HZ)
 #define MSEC_TO_TICK(ms)               msecs_to_jiffies(ms)