Re: [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

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

 



On Mon, Jul 10, 2023 at 07:59:24PM -0700, Yi Liu wrote:

> +static inline long vfio_df_ioctl_bind_iommufd(struct vfio_device_file *df,
> +					      struct vfio_device_bind_iommufd __user *arg)
> +{
> +	return -EOPNOTSUPP;
> +}

This should be -ENOTTY

> @@ -1149,6 +1151,9 @@ static long vfio_device_fops_unl_ioctl(struct file *filep,
>  	void __user *uptr = (void __user *)arg;
>  	int ret;
>  
> +	if (cmd == VFIO_DEVICE_BIND_IOMMUFD)
> +		return vfio_df_ioctl_bind_iommufd(df, uptr);
> +

And this function has a mistake too:

	default:
		if (unlikely(!device->ops->ioctl))
			ret = -EINVAL;

Should also be -ENOTTY

All the implementations of the ops already return -ENOTTY

However, I think this is all slightly not quite right, the proper
return code is supposed to be ENOIOCTLCMD which vfs_ioctl() then
translates into ENOTTY for some reason..

It looks Ok otherwise

Jason



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux