Project

General

Profile

Actions

Bug #14530

closed

nvme should require exclusive open for attach, detach, and format ioctls

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

To prevent messing up driver or device state, the nvme driver should not allow destructive operations such as attaching/detaching namespaces or formatting unless the device node is opened exclusive.

There is a device minor node for each namespace, and one devctl minor node for the whole controller. The devctl node should only be allowed to be opened exclusively if no minor node is open already. When the devctl node has been opened exclusively, the same thread will be able to open any namespace device nodes of the same controller. This is necessary to allow the recursive detaching/attaching of all namespaces by nvmeadm.

Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 2049
Actions #2

Updated by Hans Rosenfeld 4 months ago

Testing: I've verified all the commands that now require exclusive opens still work as expected, on namespaces as well as whole controllers. I also checked that an exclusive open is truly exclusive and prevents other opens.

Actions #3

Updated by Electric Monk 4 months ago

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

git commit 353d89b0745ef752e824c1afc3f0474f66dfbd64

commit  353d89b0745ef752e824c1afc3f0474f66dfbd64
Author: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Date:   2022-04-20T14:41:47.000Z

    14530 nvme should require exclusive open for attach, detach, and format ioctls
    Reviewed by: Andrew Giles <agiles@tintri.com>
    Reviewed by: Guy Morrogh <gmorrogh@tintri.com>
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF