Messages in this thread | | | Date | Fri, 24 Feb 2012 13:37:42 -0800 | From | Dave Hansen <> | Subject | Re: [RFC][PATCH] fix move/migrate_pages() race on task struct |
| |
On 02/24/2012 09:32 AM, Christoph Lameter wrote: > @@ -1318,10 +1318,10 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pi > rcu_read_lock(); > task = pid ? find_task_by_vpid(pid) : current; > if (!task) { > - rcu_read_unlock(); > err = -ESRCH; > goto out; > } ... > + put_task_struct(task); > + task = NULL; > err = do_migrate_pages(mm, old, new, > capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); > out: > + if (task) > + put_task_struct(task); > + > if (mm) > mmput(mm); > NODEMASK_SCRATCH_FREE(scratch);
Man, patch did not like this for some reason. I kept throwing most of the mempolicy.c hunks away. I've never seen anything like it.
Anyway... This looks fine except I think that rcu_read_unlock() need to stay. There's currently no release of it after out:.
| |