[PATCH] Add a parameter for NVME_IOCTL_ID to get Namespaces ID

Christoph Hellwig hch at infradead.org
Wed May 17 23:38:08 PDT 2017


On Thu, May 18, 2017 at 04:17:41AM +0000, Zou Ming wrote:
> For distinguish return value,add a parameter for NVME_IOCTL_ID to get Namespaces ID.
> ---
>  drivers/nvme/host/core.c        | 3 +--
>  include/uapi/linux/nvme_ioctl.h | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3818ff6..886a031 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -769,8 +769,7 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,
>  
>  	switch (cmd) {
>  	case NVME_IOCTL_ID:
> -		force_successful_syscall_return();
> -		return ns->ns_id;
> +		return put_user(ns->ns_id, (__u32 __user *)arg);

This break any existing user.  I also don't really understand the
problem you're trying to solve..



More information about the Linux-nvme mailing list