hw_breakpoint fix
Ingo,
Please pull the perf/urgent branch that can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/urgent
Thanks,
Frederic
---
Mahesh Salgaonkar (1):
hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
kernel/hw_breakpoint.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
---
commit b23ff0e9330e4b11e18af984d50573598e10e7f9
Author: Mahesh Salgaonkar <[email protected]> Date: Thu Jan 21 18:25:16 2010 +0530
hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
On a given architecture, when hardware breakpoint registration fails due to un-supported access type (read/write/execute), we lose the bp slot since register_perf_hw_breakpoint() does not release the bp slot on failure.
Hence, any subsequent hardware breakpoint registration starts failing with 'no space left on device' error.
This patch introduces error handling in register_perf_hw_breakpoint() function and releases bp slot on error.
LKML-Reference: <[email protected]>
kernel/hw_breakpoint.c +4 -0
@@ -296,6 +296,10 @@ int register_perf_hw_breakpoint(struct perf_event *bp)if (!bp->attr.disabled || !bp->overflow_handler) ret =arch_validate_hwbkpt_settings (bp, bp->ctx->task); +/* if arch_validate_hwbkpt_settings() fails then release bp slot */ +if (ret) +release_bp_slot (bp); +return ret; }
Quoted 11 lines · Frederic Weisbecker
Ingo,
Please pull the perf/urgent branch that can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/urgentThanks,
Frederic
---
Quoted 6 lines
Mahesh Salgaonkar (1):
hw_breakpoints: Release the bp slot ifarch_validate_hwbkpt_settings()fails.kernel/hw_breakpoint.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Pulled, thanks Frederic!
Ingo