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