summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2010-02-27 20:35:13 +0300
committerJens Axboe <jens.axboe@oracle.com>2010-02-28 19:47:19 +0100
commit9a8c28c8311e30ba97499447d5a11662f5aea094 (patch)
treeb0260ab00c6e24fb02ca1cb3c147350e933c79ba /kernel/trace
parent9f7cdbc33f36d28e57eaba0093f68f0d14c38c5b (diff)
downloadop-kernel-dev-9a8c28c8311e30ba97499447d5a11662f5aea094.zip
op-kernel-dev-9a8c28c8311e30ba97499447d5a11662f5aea094.tar.gz
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: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/blktrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index d9d6206..07f945a9 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -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);
OpenPOWER on IntegriCloud