Re: [PATCH 01/15] dm: support ioctls on mapped devices

From: Alasdair G Kergon
Date: Thu Jun 22 2006 - 11:16:13 EST


On Thu, Jun 22, 2006 at 01:29:57AM -0700, Andrew Morton wrote:
> OK. I do think dm needs to remember /dev/sda's file* to get this right
> though. That's where the ->ioctl methods are.

> Oh dear. raw_open() doesn't have a file* for the device.

Similar with device-mapper: in normal usage dm only sees major:minor.

Yes, the filp dm passes along is incorrect:

- return blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk, cmd, arg);
+ return blkdev_driver_ioctl(bdev->bd_inode, NULL, bdev->bd_disk, cmd, arg);

But should unlocked_ioctl become ?

- long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
+ long (*unlocked_ioctl) (struct inode *, struct file *, unsigned, unsigned long);

so it can be used for block devices?

See also block/scsi_ioctl.c:201 verify_command() [scsi_cmd_ioctl]
* file can be NULL from ioctl_by_bdev()...

Or should we be working towards eliminating interfaces that use device numbers?

Alasdair
--
agk@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/