Skip to content

Commit

Permalink
blktrace: perform cleanup after setup error
Browse files Browse the repository at this point in the history
Currently even if BLKTRACESETUP ioctl has failed user must call
BLKTRACETEARDOWN to be shure what all staff was cleaned, which
is contr-intuitive.
Let's setup ioctl make necessery cleanup by it self.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Dmitry Monakhov authored and Jens Axboe committed Feb 28, 2010
1 parent 9f7cdbc commit 9a8c28c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/trace/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,10 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
if (ret)
return ret;

if (copy_to_user(arg, &buts, sizeof(buts)))
if (copy_to_user(arg, &buts, sizeof(buts))) {
blk_trace_remove(q);
return -EFAULT;

}
return 0;
}
EXPORT_SYMBOL_GPL(blk_trace_setup);
Expand Down

0 comments on commit 9a8c28c

Please sign in to comment.