[PATCH v3 1/1] nvme : Add ioctl to query nvme attributes
Joel Granados
j.granados at samsung.com
Mon Nov 21 07:51:11 PST 2022
On Fri, Nov 18, 2022 at 03:35:03PM -0700, Keith Busch wrote:
> On Thu, Nov 17, 2022 at 03:13:37PM +0100, Joel Granados wrote:
> > +#define NVME_IOCTL_GET_ATTR _IOWR('N', 0x50, struct nvme_get_attr)
>
> Isn't the ioctl's number derived from the sizeof the parameter? IOW, if
> you add new fields to the struct in the future, the ioctl number will
> change, breaking older applications that were using it. I don't think we
> want to keep adding new ioctl's to support legacy users, so probably
> padding that struct with plenty of reserved space is the way to go.
My bad.
That is NOT supposed to be an '_IOWR' it was meant to be an '_IO'. In
this way we do not have the size of the structure changing the ioctl
number and we handle the extensibility with the first two arguments of
the ioctl. In the same way that it is handled in
https://github.com/torvalds/linux/blob/master/include/uapi/linux/vfio.h.
I'll send another version fixing this.
Thx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20221121/5b170acc/attachment.sig>
More information about the Linux-nvme
mailing list