Current might change at schedule_timeout() -ck --- kernel/sched/bfs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) Index: linux-4.0-ck1/kernel/sched/bfs.c =================================================================== --- linux-4.0-ck1.orig/kernel/sched/bfs.c 2015-05-05 09:08:30.000000000 +1000 +++ linux-4.0-ck1/kernel/sched/bfs.c 2015-05-05 09:14:56.033654995 +1000 @@ -4823,22 +4823,21 @@ EXPORT_SYMBOL_GPL(yield_to); long __sched io_schedule_timeout(long timeout) { - struct task_struct *curr = current; - int old_iowait = curr->in_iowait; + int old_iowait = current->in_iowait; struct rq *rq; long ret; - curr->in_iowait = 1; + current->in_iowait = 1; if (old_iowait) - blk_schedule_flush_plug(curr); + blk_schedule_flush_plug(current); else - blk_flush_plug(curr); + blk_flush_plug(current); delayacct_blkio_start(); rq = raw_rq(); atomic_inc(&rq->nr_iowait); ret = schedule_timeout(timeout); - curr->in_iowait = old_iowait; + current->in_iowait = old_iowait; atomic_dec(&rq->nr_iowait); delayacct_blkio_end();