mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
cbe28296eb
commit
15152e448b
1 changed files with 3 additions and 6 deletions
|
@ -1260,12 +1260,10 @@ static int blk_trace_remove_queue(struct request_queue *q)
|
|||
static int blk_trace_setup_queue(struct request_queue *q, dev_t dev)
|
||||
{
|
||||
struct blk_trace *old_bt, *bt = NULL;
|
||||
int ret;
|
||||
|
||||
ret = -ENOMEM;
|
||||
bt = kzalloc(sizeof(*bt), GFP_KERNEL);
|
||||
if (!bt)
|
||||
goto err;
|
||||
return -ENOMEM;
|
||||
|
||||
bt->dev = dev;
|
||||
bt->act_mask = (u16)-1;
|
||||
|
@ -1276,11 +1274,10 @@ static int blk_trace_setup_queue(struct request_queue *q, dev_t dev)
|
|||
if (old_bt != NULL) {
|
||||
(void)xchg(&q->blk_trace, old_bt);
|
||||
kfree(bt);
|
||||
ret = -EBUSY;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return 0;
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue