[PATCH 2/2] nvmet: implement persistent read-only namespace feature

Hannes Reinecke hare at suse.de
Fri Apr 4 02:36:50 PDT 2025


On 4/4/25 08:26, Christoph Hellwig wrote:
> On Thu, Apr 03, 2025 at 04:47:47PM +0200, Hannes Reinecke wrote:
>> Per default we try to open the 'device_path' read-write, which might
>> fail if the device is read-only. So retry with opening read-only, and
>> implement a new 'persistent_ro' flag if we did so.
>> And map that flag onto the 'Permanently Write Protect' setting in the
>> write protection feature.
> 
> This sounds like a really horrible interface, but maybe there is logic
> for it so explain why we don't require the explicit read-only attribute
> to open read only.
> 
I do agree, interface needs to be reworked.
But while playing around I found that apparently 'filp_open()'
ignores the file mode; I can easily call 'filp_open()' with
O_RDWR on a file with mode 0444.
Expected?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list