Re: [PATCH v6] mmc: Add mmc CMD+ACMD passthrough ioctl

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

 



Hi Michał,

On Wed, 20 Apr 2011, Michał Mirosław wrote:
> Hmm. This might be even better:
> 
> static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode,
> unsigned int cmd, unsigned long arg)
> {
>   struct mmc_ioc_cmd blk;
> 
>   if (cmd != MMC_IOC_CMD)
>     return -EINVAL;
> 
>   copy_from_user((void __user *)arg, &blk) ...
> 
> #ifdef CONFIG_COMPAT
>   if (is_compat_task())
>     blk.data_ptr = compat_ptr(*(u32 *)&blk.data_ptr);
> #endif
> 
>   return mmc_blk_ioctl_cmd(bdev, &blk);
> }
> 
> [no compat_ioctl needed]
> 

I'm okay with the anon union + ``compat_ptr(*(u32 *))`` part of your
solution.  If everyone else thinks it is reasonable, I'll submit a v7
with it.

However, I still think it should be implemented in compat_ioctl()
because compat_blkdev_ioctl() expects it.  Either that, or I add to the
big switch in compat_blkdev_driver_ioctl(), and spreading this change
out to block/compat_ioctl.c does not seem like The Right Thing to me.

John

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux