nvme should return ENOTSUP for ioctls not supported by the hardware
Currently nvme doesn't even check whether firmware operations are supported by the hardware, relying on the failure of the firmware commands to return an appropriate error code. Instead of just sending unknown commands to the hardware, the driver should really check whether firmware operations are supported and return ENOTSUP if not.
The format ioctl has a similar problem, return EINVAL when it should return ENOTSUP instead.
Updated by Hans Rosenfeld 7 months ago
Testing: Not much, I suppose, besides building it.
I did a lot of testing with the previous changes to the nvmeadm error reporting, where I had included this one. But I'm not sure I even have access to devices which lack support for formatting or firmware updates, so I never could verify I could get ENOTSUP. But then, the change is trivial enough that I don't see what could possibly go wrong.
Updated by Electric Monk 7 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 1767024ccd62fe7212679d959527eb445767d01a Author: Hans Rosenfeld <firstname.lastname@example.org> Date: 2022-03-02T10:19:37.000Z 14528 nvme should return ENOTSUP for ioctls not supported by the hardware Reviewed by: Andrew Giles <email@example.com> Reviewed by: Guy Morrogh <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>