Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38084
b: refs/heads/master
c: e90dae1
h: refs/heads/master
v: v3
  • Loading branch information
Milan Broz authored and Linus Torvalds committed Oct 3, 2006
1 parent 44a548e commit 0fe7272
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7006f6eca874cd44d37ccb8cfeb8bed04e3bff22
refs/heads/master: e90dae1f58d475b71bcc4eebf6d4fd5217ed85c7
8 changes: 7 additions & 1 deletion trunk/drivers/md/dm-linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@ static int linear_ioctl(struct dm_target *ti, struct inode *inode,
{
struct linear_c *lc = (struct linear_c *) ti->private;
struct block_device *bdev = lc->dev->bdev;
struct file fake_file = {};
struct dentry fake_dentry = {};

return blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk, cmd, arg);
fake_file.f_mode = lc->dev->mode;
fake_file.f_dentry = &fake_dentry;
fake_dentry.d_inode = bdev->bd_inode;

return blkdev_driver_ioctl(bdev->bd_inode, &fake_file, bdev->bd_disk, cmd, arg);
}

static struct target_type linear_target = {
Expand Down
13 changes: 10 additions & 3 deletions trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,15 +1273,22 @@ static int multipath_ioctl(struct dm_target *ti, struct inode *inode,
struct multipath *m = (struct multipath *) ti->private;
struct block_device *bdev = NULL;
unsigned long flags;
struct file fake_file = {};
struct dentry fake_dentry = {};
int r = 0;

fake_file.f_dentry = &fake_dentry;

spin_lock_irqsave(&m->lock, flags);

if (!m->current_pgpath)
__choose_pgpath(m);

if (m->current_pgpath)
if (m->current_pgpath) {
bdev = m->current_pgpath->path.dev->bdev;
fake_dentry.d_inode = bdev->bd_inode;
fake_file.f_mode = m->current_pgpath->path.dev->mode;
}

if (m->queue_io)
r = -EAGAIN;
Expand All @@ -1290,8 +1297,8 @@ static int multipath_ioctl(struct dm_target *ti, struct inode *inode,

spin_unlock_irqrestore(&m->lock, flags);

return r ? : blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk,
cmd, arg);
return r ? : blkdev_driver_ioctl(bdev->bd_inode, &fake_file,
bdev->bd_disk, cmd, arg);
}

/*-----------------------------------------------------------------
Expand Down

0 comments on commit 0fe7272

Please sign in to comment.