Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/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
This commit is contained in:
Коммит
72cc129e8d
|
@ -2222,15 +2222,15 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
||||||
ret = ftrace_process_regex(parser->buffer,
|
ret = ftrace_process_regex(parser->buffer,
|
||||||
parser->idx, enable);
|
parser->idx, enable);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out_unlock;
|
||||||
|
|
||||||
trace_parser_clear(parser);
|
trace_parser_clear(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = read;
|
ret = read;
|
||||||
|
out_unlock:
|
||||||
mutex_unlock(&ftrace_regex_lock);
|
mutex_unlock(&ftrace_regex_lock);
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1193,6 +1193,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
|
||||||
atomic_inc(&cpu_buffer->record_disabled);
|
atomic_inc(&cpu_buffer->record_disabled);
|
||||||
synchronize_sched();
|
synchronize_sched();
|
||||||
|
|
||||||
|
spin_lock_irq(&cpu_buffer->reader_lock);
|
||||||
rb_head_page_deactivate(cpu_buffer);
|
rb_head_page_deactivate(cpu_buffer);
|
||||||
|
|
||||||
for (i = 0; i < nr_pages; i++) {
|
for (i = 0; i < nr_pages; i++) {
|
||||||
|
@ -1207,6 +1208,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rb_reset_cpu(cpu_buffer);
|
rb_reset_cpu(cpu_buffer);
|
||||||
|
spin_unlock_irq(&cpu_buffer->reader_lock);
|
||||||
|
|
||||||
rb_check_pages(cpu_buffer);
|
rb_check_pages(cpu_buffer);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче