aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-03-19 21:48:47 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-21 11:16:37 -0400
commitcbe28296eb1ac441b35cf45804d0ae808add7dd1 (patch)
treec387d2697ea153cadb629e3d664960bf12b8bc84 /kernel/trace
parent3c289ba7c320560ee74979a8895141c829046a2d (diff)
blktrace: don't increase blk_probes_ref if failed to setup blk trace
do_blk_trace_setup() may return EBUSY, but the current code doesn't decrease blk_probes_ref in this case. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <49C2F5FF.80002@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/blktrace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 223b92e77b3f..11e7c8d9d222 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -468,9 +468,6 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
468 bt->pid = buts->pid; 468 bt->pid = buts->pid;
469 bt->trace_state = Blktrace_setup; 469 bt->trace_state = Blktrace_setup;
470 470
471 if (atomic_add_return(1, &blk_probes_ref) == 1)
472 blk_register_tracepoints();
473
474 ret = -EBUSY; 471 ret = -EBUSY;
475 old_bt = xchg(&q->blk_trace, bt); 472 old_bt = xchg(&q->blk_trace, bt);
476 if (old_bt) { 473 if (old_bt) {
@@ -478,6 +475,9 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
478 goto err; 475 goto err;
479 } 476 }
480 477
478 if (atomic_add_return(1, &blk_probes_ref) == 1)
479 blk_register_tracepoints();
480
481 return 0; 481 return 0;
482err: 482err:
483 if (bt) { 483 if (bt) {