Re: [PATCH] Support HDIO_GETGEO on device-mapper volumes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Darrick J. Wong" <djwong@xxxxxxxxxx> wrote:
>
> The attached patch implements a simple ioctl handler that supplies a 
> compatible geometry when HDIO_GETGEO is called against a device-mapper 
> device.

block_device_operations now has a standalone `getgeo' method.

> ...
> +static int dm_blk_ioctl(struct inode * inode, struct file * filp,
> +			unsigned int cmd, unsigned long arg)
> +{
> +	struct block_device *bdev = inode->i_bdev;
> +	struct hd_geometry __user *loc = (void __user *)arg;
> +	struct mapped_device *md;
> +	int diskinfo[4];
> +
> +	if (cmd == HDIO_GETGEO) {
> +		if (!arg)
> +			return -EINVAL;

I don't think we need that check?  The -EFAULT should suffice.

--

dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux