提交 aaa2a97e 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] sys_get_robust_list(): don't take tasklist_lock

use rcu locks for find_task_by_pid().
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 d359b549
......@@ -1624,7 +1624,7 @@ sys_get_robust_list(int pid, struct robust_list_head __user **head_ptr,
struct task_struct *p;
ret = -ESRCH;
read_lock(&tasklist_lock);
rcu_read_lock();
p = find_task_by_pid(pid);
if (!p)
goto err_unlock;
......@@ -1633,7 +1633,7 @@ sys_get_robust_list(int pid, struct robust_list_head __user **head_ptr,
!capable(CAP_SYS_PTRACE))
goto err_unlock;
head = p->robust_list;
read_unlock(&tasklist_lock);
rcu_read_unlock();
}
if (put_user(sizeof(*head), len_ptr))
......@@ -1641,7 +1641,7 @@ sys_get_robust_list(int pid, struct robust_list_head __user **head_ptr,
return put_user(head, head_ptr);
err_unlock:
read_unlock(&tasklist_lock);
rcu_read_unlock();
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册