Commit 9a8c28c8 authored by Dmitry Monakhov's avatar Dmitry Monakhov Committed by Jens Axboe

blktrace: perform cleanup after setup error

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: default avatarDmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 9f7cdbc3
...@@ -540,9 +540,10 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, ...@@ -540,9 +540,10 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
if (ret) if (ret)
return 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 -EFAULT;
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(blk_trace_setup); EXPORT_SYMBOL_GPL(blk_trace_setup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment