A new feature requests with patches that implement the features.

Mark Ruijter mruijter at primelogic.nl
Fri Aug 21 09:03:40 EDT 2020


Hi Chaitanya,

We worked a while ago on the NVMe target model attribute and the controller id configuration changes which are now all upstream. So I hope you don’t mind that I use you as a first contact for the feature requests I am about to propose.

1. The NVMe target subsystem allows to change a device from readwrite to readonly. However currently, assuming that I understand things right, this needs to be done on the initiator. So for the initiator this works identical to a PCIe connected NVMe drive. However for a NVMe-oF target system it makes sense to be able to set volumes on export to readonly. A good example is exporting snapshots, which are frequently exported readonly. However the use case is not limited to snapshots only. Most of the code to make this work is already present in the Nvmet code. So the only change that I would like to propose is to add “readonly” as a configfs attribute. The example patch that makes this work is readonly.path.

--
With the patch and after setting the namespace to readonly:
namespaces/1 # echo 1 > readonly
namespaces/1 # echo 1 > enable

root at r11i3:~# echo hello >/dev/nvme5n1 
-bash: echo: write error: Operation not permitted
--

2. Currently when an initiator discovers a target portal the kernel will log a line like this:
kernel: [69973.673198] nvmet: creating controller 4 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN nqn.2014-08.org.nvmexpress:uuid:33aa16c0-0d56-4587-b1c2-000000000003.
The patch "fabrics-cmd_log.path" will change the line to look like this:
kernel: [81971.434559] nvmet: creating controller 1 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN nqn.2014-08.org.nvmexpress:uuid:33aa16c0-0d56-4587-b1c2-000000000003 on port 3122 : 192.168.9.10 - 4420

The important part of the change is adding the port number. Why is this important? This information can now be used to not only automatically detect initiators, but also detect which port and protocol is used. Adding the IP and port information is convenient only. However logging the target port is very useful when a target system has multiple physical ports and supports multiple protocols like tcp and rdma.

Hopefully the proposed changes make sense.

--Mark 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fabrics-cmd_log.patch
Type: application/octet-stream
Size: 633 bytes
Desc: fabrics-cmd_log.patch
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20200821/9a0e0ead/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readonly.patch
Type: application/octet-stream
Size: 1305 bytes
Desc: readonly.patch
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20200821/9a0e0ead/attachment-0001.obj>


More information about the Linux-nvme mailing list