[PATCH 0/2] nvmet: improve 'read-only' handling

Hannes Reinecke hare at kernel.org
Thu Apr 3 07:47:45 PDT 2025


Hi all,

there was a request (Hi Lennart) to implement 'readonly' handling
for nvme target. Turns out to be relatively easy as we already have
a 'readonly' flag for the namespace.
So all what's left is to make this flag settable via a new configfs
attribute. And while at it we can as well check if the underlying
device/file is read-only, and implement a 'persistent_ro' flag to
mark them as persistently read-only.

As usual, comments and reviews are welcome.

Hannes Reinecke (2):
  nvmet: make 'readonly' setting configurable
  nvmet: implement persistent read-only namespace feature

 drivers/nvme/target/admin-cmd.c   | 15 +++++++++++----
 drivers/nvme/target/configfs.c    | 32 +++++++++++++++++++++++++++++++
 drivers/nvme/target/core.c        |  2 ++
 drivers/nvme/target/io-cmd-bdev.c | 11 +++++++++++
 drivers/nvme/target/io-cmd-file.c | 21 ++++++++++++++++----
 drivers/nvme/target/nvmet.h       |  1 +
 6 files changed, 74 insertions(+), 8 deletions(-)

-- 
2.35.3




More information about the Linux-nvme mailing list