diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-03-20 09:48:47 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-21 16:16:37 +0100 |
commit | cbe28296eb1ac441b35cf45804d0ae808add7dd1 (patch) | |
tree | c387d2697ea153cadb629e3d664960bf12b8bc84 /kernel | |
parent | 3c289ba7c320560ee74979a8895141c829046a2d (diff) | |
download | kernel_samsung_tuna-cbe28296eb1ac441b35cf45804d0ae808add7dd1.zip kernel_samsung_tuna-cbe28296eb1ac441b35cf45804d0ae808add7dd1.tar.gz kernel_samsung_tuna-cbe28296eb1ac441b35cf45804d0ae808add7dd1.tar.bz2 |
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')
-rw-r--r-- | kernel/trace/blktrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 223b92e..11e7c8d 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, bt->pid = buts->pid; bt->trace_state = Blktrace_setup; - if (atomic_add_return(1, &blk_probes_ref) == 1) - blk_register_tracepoints(); - ret = -EBUSY; old_bt = xchg(&q->blk_trace, bt); if (old_bt) { @@ -478,6 +475,9 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, goto err; } + if (atomic_add_return(1, &blk_probes_ref) == 1) + blk_register_tracepoints(); + return 0; err: if (bt) { |