blktrace: report EBUSY correctly
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 20 Mar 2009 01:49:08 +0000 (09:49 +0800)
committerIngo Molnar <mingo@elte.hu>
Sat, 21 Mar 2009 15:16:54 +0000 (16:16 +0100)
commit15152e448b693fa41de40f1e40ffbe717a3aab88
tree0fec87dd1850aa8e6e8be21bebb3ce0bd3bf148a
parentcbe28296eb1ac441b35cf45804d0ae808add7dd1
blktrace: report EBUSY correctly

blk_trace_remove_queue() returns EINVAL if q->blk_trace == NULL,
but blk_trace_setup_queue() doesn't return EBUSY if
q->blk_trace != NULL.

 # echo 0 > sdaX/trace/enable
 # echo 0 > sdaX/trace/enable
 bash: echo: write error: Invalid argument
 # echo 1 > sdaX/trace/enable
 # echo 1 > sdaX/trace/enable
 (should return EBUSY)

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49C2F614.2010101@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/blktrace.c