Exporting NVMe-oF devices read-only enforced on export from the NVMe-oF target.

Mark Ruijter mruijter at primelogic.nl
Tue Sep 29 07:34:53 EDT 2020


Hi all,

Unless I am mistaken the NVMe-oF target driver does currently not support to export a device read-only from the target system.
For exporting readonly snapshot devices I am currently using the attached patch.

Does this change, or a similar change, make sense for upstream?

    --
    With the patch and after setting the namespace to readonly:
    namespaces/1 # echo 1 > readonly
    namespaces/1 # echo 1 > enable
    
On the initiator system writes are now no longer permitted:
    root at r11i3:~# echo hello >/dev/nvme5n1 
    -bash: echo: write error: Operation not permitted
    --

Thanks,

Mark Ruijter


-------------- 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/20200929/b9eba743/attachment.obj>


More information about the Linux-nvme mailing list