add a check before allocate resource for blk_trace, if it's in use. Signed-off-by: weiping zhang <zhangweiping@xxxxxxxxxxxxxxx> --- kernel/trace/blktrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 987d9a9a..16c0000 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -491,6 +491,9 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, struct dentry *dir = NULL; int ret; + if (unlikely(q->blk_trace)) + return -EBUSY; + if (!buts->buf_size || !buts->buf_nr) return -EINVAL; -- 2.9.4