[PATCH] Add a parameter for NVME_IOCTL_ID to get Namespaces ID
Christoph Hellwig
hch at infradead.org
Sun May 21 01:34:10 PDT 2017
On Thu, May 18, 2017 at 03:14:23PM +0800, Zouming (IT) wrote:
> The problem trying to solve is below:
> 1、According to nvme spec, the possible range of Namespaces ID is form 1 to FFFFFFFe
> 2、When use NVME_IOCTL_ID IOCTL cmd to get namespaces ID,if return error before function nvme_ioctl,
> How can user distinguish the return value is valid namespaces ID or error value。
>
> Do you think this situation exsits or there will never fail when use NVME_IOCTL_ID cmd?
NVME_IOCTL_ID can't fail in the NVMe driver itself, but it can fail
because the device isn't a NVMe device or a security module rejected it.
So you'd have to add a new ioctl additional ioctl that copies it out.
Or just use the sysfs file..
More information about the Linux-nvme
mailing list