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 443f5125f11e..f3fa18887cc9 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -873,6 +873,7 @@ static int copy_io(unsigned long clone_flags, struct task_struct *tsk) | |||
| 873 | { | 873 | { |
| 874 | #ifdef CONFIG_BLOCK | 874 | #ifdef CONFIG_BLOCK |
| 875 | struct io_context *ioc = current->io_context; | 875 | struct io_context *ioc = current->io_context; |
| 876 | struct io_context *new_ioc; | ||
| 876 | 877 | ||
| 877 | if (!ioc) | 878 | if (!ioc) |
| 878 | return 0; | 879 | return 0; |
| @@ -884,11 +885,12 @@ static int copy_io(unsigned long clone_flags, struct task_struct *tsk) | |||
| 884 | if (unlikely(!tsk->io_context)) | 885 | if (unlikely(!tsk->io_context)) |
| 885 | return -ENOMEM; | 886 | return -ENOMEM; |
| 886 | } else if (ioprio_valid(ioc->ioprio)) { | 887 | } else if (ioprio_valid(ioc->ioprio)) { |
| 887 | tsk->io_context = alloc_io_context(GFP_KERNEL, -1); | 888 | new_ioc = get_task_io_context(tsk, GFP_KERNEL, NUMA_NO_NODE); |
| 888 | if (unlikely(!tsk->io_context)) | 889 | if (unlikely(!new_ioc)) |
| 889 | return -ENOMEM; | 890 | return -ENOMEM; |
| 890 | 891 | ||
| 891 | tsk->io_context->ioprio = ioc->ioprio; | 892 | new_ioc->ioprio = ioc->ioprio; |
| 893 | put_io_context(new_ioc, NULL); | ||
| 892 | } | 894 | } |
| 893 | #endif | 895 | #endif |
| 894 | return 0; | 896 | return 0; |
