NVMe write protection support

Gilles Buloz Gilles.Buloz at kontron.com
Tue Aug 2 02:20:02 PDT 2022


Sorry Christoph, I'm completely newbie in NVMe and don't know what "Namespace Write Protection Config" means.
What I mean is that all the NVMe content seen by the user is write protected.
Our NVMe manufacturer partner has dedicated a pin of the module for global write protection. If the pin is high it is not possible to change even a single byte of the data stored by the user in the NVMe storage.
But if we enable this protection and attempt a write (we should not), we get a "critical medium error" which seems a bit brutal for a disk that is still valid but just write protected. So I would like to make sure the NVMe manufacturer has used the right method/status to report this write protection, and if possible get a less fatal error feedback.
Thanks 

> De : Christoph Hellwig <hch at infradead.org>
> Envoyé : lundi 1 août 2022 20:34
> À : Gilles Buloz <Gilles.Buloz at kontron.com>
> Cc : linux-nvme at lists.infradead.org <linux-nvme at lists.infradead.org>
> Objet : Re: NVMe write protection support 
 > 
> On Mon, Aug 01, 2022 at 08:36:12AM +0000, Gilles Buloz wrote:
> > Dear developers,
> > In case an NVMe module has a write protection feature,
> 
> Do you mean the "Namespace Write Protection Config", Feature Identifier
> 84h?  In that case you need to set bit 0 in the NSATTR field in the Identify
> Namespace data structure(s) and the kernel will mark the namespace read only.
> 
> If you mean something else, please clarify.


More information about the Linux-nvme mailing list