aboutsummaryrefslogtreecommitdiffstats
path: root/block/compat_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/compat_ioctl.c')
-rw-r--r--block/compat_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index cae0a852619e..b73373216b0e 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -545,6 +545,7 @@ static int compat_blk_trace_setup(struct block_device *bdev, char __user *arg)
545 struct blk_user_trace_setup buts; 545 struct blk_user_trace_setup buts;
546 struct compat_blk_user_trace_setup cbuts; 546 struct compat_blk_user_trace_setup cbuts;
547 struct request_queue *q; 547 struct request_queue *q;
548 char b[BDEVNAME_SIZE];
548 int ret; 549 int ret;
549 550
550 q = bdev_get_queue(bdev); 551 q = bdev_get_queue(bdev);
@@ -554,6 +555,8 @@ static int compat_blk_trace_setup(struct block_device *bdev, char __user *arg)
554 if (copy_from_user(&cbuts, arg, sizeof(cbuts))) 555 if (copy_from_user(&cbuts, arg, sizeof(cbuts)))
555 return -EFAULT; 556 return -EFAULT;
556 557
558 strcpy(b, bdevname(bdev, b));
559
557 buts = (struct blk_user_trace_setup) { 560 buts = (struct blk_user_trace_setup) {
558 .act_mask = cbuts.act_mask, 561 .act_mask = cbuts.act_mask,
559 .buf_size = cbuts.buf_size, 562 .buf_size = cbuts.buf_size,
@@ -565,7 +568,7 @@ static int compat_blk_trace_setup(struct block_device *bdev, char __user *arg)
565 memcpy(&buts.name, &cbuts.name, 32); 568 memcpy(&buts.name, &cbuts.name, 32);
566 569
567 mutex_lock(&bdev->bd_mutex); 570 mutex_lock(&bdev->bd_mutex);
568 ret = do_blk_trace_setup(q, bdev, &buts); 571 ret = do_blk_trace_setup(q, b, bdev->bd_dev, &buts);
569 mutex_unlock(&bdev->bd_mutex); 572 mutex_unlock(&bdev->bd_mutex);
570 if (ret) 573 if (ret)
571 return ret; 574 return ret;