x86, bts: fix unlock problem in ds.c
PATCH 1/1 x86, bts: fix unlock problem in ds.c
Fix a problem where ds_request() returned an error without releasing the ds lock.
---
arch/x86/kernel/ds.c +2 -1
@@ -384,8 +384,9 @@spin_lock (&ds_lock); + error = -EPERM ;if (!check_tracer (task)) -return -EPERM ; + goto out_unlock; error = -ENOMEM ; context =ds_alloc_context (task);
Ingo Molnar
AppliedQuoted 5 lines · Markus Metzger
Fix a problem where
ds_request()returned an error without releasing the ds lock.Reported-by Stephane Eranian <[email protected]>Signed-off-by Markus Metzger <[email protected]>
applied to tip/x86/urgent, thanks Markus!
i also reviewed the other locking branches there and they seem to be fine.
Ingo
Markus,
I think this patch is not quite right. You don't want to go out via out_unlock because you're going to call ds_put_context)() when you did not invoke the matching ds_get_context() (hidden in ds_alloc_context). It happens later in the ds_request() function.
Quoted 25 lines · Markus Metzger
Fix a problem where
ds_request()returned an error without releasing the ds lock.Reported-by Stephane Eranian <[email protected]>Signed-off-by Markus Metzger <[email protected]>---
Index:
gits/arch/x86/kernel/ds.c
===================================================================arch/x86/kernel/ds.c 2008-11-15 10:53:43.000000000 +0100 renamed from arch/x86/kernel/ds.c 2008-11-15 10:51:51.000000000 +0100 +2
-1@@ -384,8 +384,9 @@ spin_lock(&ds_lock); + error = -EPERM; if (!check_tracer(task)) - return -EPERM; + goto out_unlock; error = -ENOMEM; context = ds_alloc_context(task);
Quoted 6 lines · stephane eranian
Markus,
I think this patch is not quite right. You don't want to go out via
out_unlockbecause you're going to call ds_put_context)() when you did not invoke the matchingds_get_context()(hidden inds_alloc_context). It happens later in theds_request()function.
i noticed that, and fixed it via:
10db4ef: x86, PEBS/DS: fix code flow in ds_request()
can you still see problems with it?
Ingo
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · stephane eranian
Markus,
I think this patch is not quite right. You don't want to go out via
out_unlockbecause you're going to call ds_put_context)() when you did not invoke the matchingds_get_context()(hidden inds_alloc_context). It happens later in theds_request()function.
Quoted 6 lines
i noticed that, and fixed it via:
10db4ef: x86, PEBS/DS: fix code flow in
ds_request()can you still see problems with it?
Well, I have lots of problems with ds.c so I have heavily modified the code therefore I have not pulled from
any public tree in several days.