block: Fix io_context leak after failure of clone with CLONE_IO
[safe/jmp/linux-2.6] / block / blk-ioc.c
index dcd0412..cbdabb0 100644 (file)
@@ -66,14 +66,14 @@ static void cfq_exit(struct io_context *ioc)
 }
 
 /* Called by the exitting task */
-void exit_io_context(void)
+void exit_io_context(struct task_struct *task)
 {
        struct io_context *ioc;
 
-       task_lock(current);
-       ioc = current->io_context;
-       current->io_context = NULL;
-       task_unlock(current);
+       task_lock(task);
+       ioc = task->io_context;
+       task->io_context = NULL;
+       task_unlock(task);
 
        if (atomic_dec_and_test(&ioc->nr_tasks)) {
                if (ioc->aic && ioc->aic->exit)