diff options
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index c681d5e5f45c..d85c65a46433 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -1400,13 +1400,10 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, | |||
1400 | { | 1400 | { |
1401 | struct multipath *m = (struct multipath *) ti->private; | 1401 | struct multipath *m = (struct multipath *) ti->private; |
1402 | struct block_device *bdev = NULL; | 1402 | struct block_device *bdev = NULL; |
1403 | fmode_t mode = 0; | ||
1403 | unsigned long flags; | 1404 | unsigned long flags; |
1404 | struct file fake_file = {}; | ||
1405 | struct dentry fake_dentry = {}; | ||
1406 | int r = 0; | 1405 | int r = 0; |
1407 | 1406 | ||
1408 | fake_file.f_path.dentry = &fake_dentry; | ||
1409 | |||
1410 | spin_lock_irqsave(&m->lock, flags); | 1407 | spin_lock_irqsave(&m->lock, flags); |
1411 | 1408 | ||
1412 | if (!m->current_pgpath) | 1409 | if (!m->current_pgpath) |
@@ -1414,8 +1411,7 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, | |||
1414 | 1411 | ||
1415 | if (m->current_pgpath) { | 1412 | if (m->current_pgpath) { |
1416 | bdev = m->current_pgpath->path.dev->bdev; | 1413 | bdev = m->current_pgpath->path.dev->bdev; |
1417 | fake_dentry.d_inode = bdev->bd_inode; | 1414 | mode = m->current_pgpath->path.dev->mode; |
1418 | fake_file.f_mode = m->current_pgpath->path.dev->mode; | ||
1419 | } | 1415 | } |
1420 | 1416 | ||
1421 | if (m->queue_io) | 1417 | if (m->queue_io) |
@@ -1425,8 +1421,7 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, | |||
1425 | 1421 | ||
1426 | spin_unlock_irqrestore(&m->lock, flags); | 1422 | spin_unlock_irqrestore(&m->lock, flags); |
1427 | 1423 | ||
1428 | return r ? : blkdev_driver_ioctl(bdev->bd_inode, &fake_file, | 1424 | return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg); |
1429 | bdev->bd_disk, cmd, arg); | ||
1430 | } | 1425 | } |
1431 | 1426 | ||
1432 | /*----------------------------------------------------------------- | 1427 | /*----------------------------------------------------------------- |