diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index da4a6a10d088..5bcfc739bb7c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -870,6 +870,7 @@ static int copy_io(unsigned long clone_flags, struct task_struct *tsk) | |||
870 | { | 870 | { |
871 | #ifdef CONFIG_BLOCK | 871 | #ifdef CONFIG_BLOCK |
872 | struct io_context *ioc = current->io_context; | 872 | struct io_context *ioc = current->io_context; |
873 | struct io_context *new_ioc; | ||
873 | 874 | ||
874 | if (!ioc) | 875 | if (!ioc) |
875 | return 0; | 876 | return 0; |
@@ -881,11 +882,12 @@ static int copy_io(unsigned long clone_flags, struct task_struct *tsk) | |||
881 | if (unlikely(!tsk->io_context)) | 882 | if (unlikely(!tsk->io_context)) |
882 | return -ENOMEM; | 883 | return -ENOMEM; |
883 | } else if (ioprio_valid(ioc->ioprio)) { | 884 | } else if (ioprio_valid(ioc->ioprio)) { |
884 | tsk->io_context = alloc_io_context(GFP_KERNEL, -1); | 885 | new_ioc = get_task_io_context(tsk, GFP_KERNEL, NUMA_NO_NODE); |
885 | if (unlikely(!tsk->io_context)) | 886 | if (unlikely(!new_ioc)) |
886 | return -ENOMEM; | 887 | return -ENOMEM; |
887 | 888 | ||
888 | tsk->io_context->ioprio = ioc->ioprio; | 889 | new_ioc->ioprio = ioc->ioprio; |
890 | put_io_context(new_ioc); | ||
889 | } | 891 | } |
890 | #endif | 892 | #endif |
891 | return 0; | 893 | return 0; |