Skip to content

Commit

Permalink
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: Fix unmatched locking in ftrace_regex_write()
  ring-buffer: Synchronize resizing buffer with reader lock
  • Loading branch information
Linus Torvalds committed Nov 5, 2009
2 parents 411094a + ed146b2 commit 72cc129
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2222,15 +2222,15 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
ret = ftrace_process_regex(parser->buffer,
parser->idx, enable);
if (ret)
goto out;
goto out_unlock;

trace_parser_clear(parser);
}

ret = read;

out_unlock:
mutex_unlock(&ftrace_regex_lock);
out:

return ret;
}

Expand Down
2 changes: 2 additions & 0 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
atomic_inc(&cpu_buffer->record_disabled);
synchronize_sched();

spin_lock_irq(&cpu_buffer->reader_lock);
rb_head_page_deactivate(cpu_buffer);

for (i = 0; i < nr_pages; i++) {
Expand All @@ -1207,6 +1208,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
return;

rb_reset_cpu(cpu_buffer);
spin_unlock_irq(&cpu_buffer->reader_lock);

rb_check_pages(cpu_buffer);

Expand Down

0 comments on commit 72cc129

Please sign in to comment.