Project

General

Profile

Actions

Bug #14528

closed

nvme should return ENOTSUP for ioctls not supported by the hardware

Added by Hans Rosenfeld 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

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.

Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 2042
Actions #2

Updated by Hans Rosenfeld 6 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.

Actions #3

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 1767024ccd62fe7212679d959527eb445767d01a

commit  1767024ccd62fe7212679d959527eb445767d01a
Author: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Date:   2022-03-02T10:19:37.000Z

    14528 nvme should return ENOTSUP for ioctls not supported by the hardware
    Reviewed by: Andrew Giles <agiles@tintri.com>
    Reviewed by: Guy Morrogh <gmorrogh@tintri.com>
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF