* [PATCH linux-next] mm: fix rcu-lock/unlock balance in vm_is_stack()
@ 2012-03-20 20:54 Konstantin Khlebnikov
2012-03-20 21:03 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2012-03-20 20:54 UTC (permalink / raw)
To: Siddhesh Poyarekar, Andrew Morton; +Cc: linux-next, linux-kernel
Fix bug introduced in "procfs: mark thread stack correctly in proc/<pid>/maps"
(patch in mm/linux-next)
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/memory.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index ee85fc4..cc08b86 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3932,13 +3932,12 @@ pid_t vm_is_stack(struct task_struct *task,
while_each_thread(task, t) {
if (vm_is_stack_for_task(t, vma)) {
ret = t->pid;
- goto done;
+ break;
}
}
+ rcu_read_unlock();
}
-done:
- rcu_read_unlock();
return ret;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] mm: fix rcu-lock/unlock balance in vm_is_stack()
2012-03-20 20:54 [PATCH linux-next] mm: fix rcu-lock/unlock balance in vm_is_stack() Konstantin Khlebnikov
@ 2012-03-20 21:03 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2012-03-20 21:03 UTC (permalink / raw)
To: Konstantin Khlebnikov; +Cc: Siddhesh Poyarekar, linux-next, linux-kernel
On Wed, 21 Mar 2012 00:54:55 +0400
Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:
> Fix bug introduced in "procfs: mark thread stack correctly in proc/<pid>/maps"
> (patch in mm/linux-next)
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
> mm/memory.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index ee85fc4..cc08b86 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3932,13 +3932,12 @@ pid_t vm_is_stack(struct task_struct *task,
> while_each_thread(task, t) {
> if (vm_is_stack_for_task(t, vma)) {
> ret = t->pid;
> - goto done;
> + break;
> }
> }
> + rcu_read_unlock();
> }
>
> -done:
> - rcu_read_unlock();
> return ret;
> }
>
Appears to have been fixed in v3:
pid_t vm_is_stack(struct task_struct *task,
struct vm_area_struct *vma, int in_group)
{
pid_t ret = 0;
if (vm_is_stack_for_task(task, vma))
return task->pid;
if (in_group) {
struct task_struct *t;
rcu_read_lock();
if (!pid_alive(task))
goto done;
t = task;
do {
if (vm_is_stack_for_task(t, vma)) {
ret = t->pid;
goto done;
}
} while_each_thread(task, t);
done:
rcu_read_unlock();
}
return ret;
}
I'm working on getting a -next update sent to Stephen today.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-20 21:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 20:54 [PATCH linux-next] mm: fix rcu-lock/unlock balance in vm_is_stack() Konstantin Khlebnikov
2012-03-20 21:03 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).