From: Christoph Hellwig <hch@infradead.org>
To: Gilles BULOZ <gilles.buloz@kontron.com>
Cc: Jonathan Derrick <jonathan.derrick@linux.dev>,
Christoph Hellwig <hch@infradead.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: NVMe write protection support
Date: Mon, 19 Sep 2022 07:59:05 -0700 [thread overview]
Message-ID: <YyiDufvEa+dEtziJ@infradead.org> (raw)
In-Reply-To: <e49c0b48-cf93-9247-6362-c3f2efd40ee0@kontron.com>
On Tue, Sep 13, 2022 at 07:17:57PM +0200, Gilles BULOZ wrote:
> But in my case the WP pin when enabled would make the initial state of the
> namespace at the time of its creation be "Write Protect". Or I could
> simulate a transition from "No Write Protect" to "Write Protect" but this
> would be without "Set Features" command.
> In both cases I would be out of specs.
I don't think you need that. Just set bit 0 of the NSATTR field in
the Identify Namespace stucture to 1 and ignore the Set/Get Features
parts. If your pin can be chaned at runtime, make sure that the bit
is updated based on it and that the Namespace Attribute Changed
AEN is sent when that happens.
> Also if the implementation is correct in the NVMe, and assuming the kernel
> already supports this case gracefully, what king of kernel message would I
> get (in dmesg) in case of a write to a protected device ?
Opening a block devie that was set to read only before will return
-EACCES. If it is set to read-only after it was opened there is no
special handling and you'll get a good old -EIO.
next prev parent reply other threads:[~2022-09-19 14:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 8:36 NVMe write protection support Gilles Buloz
2022-08-01 10:01 ` Chao Leng
2022-08-01 12:41 ` Gilles BULOZ
2022-08-01 16:39 ` Keith Busch
2022-08-01 18:34 ` Christoph Hellwig
2022-08-02 9:20 ` Gilles Buloz
2022-08-06 8:35 ` Christoph Hellwig
2022-08-25 8:26 ` Gilles Buloz
2022-08-26 19:39 ` Jonathan Derrick
2022-08-26 19:40 ` Jonathan Derrick
2022-09-13 17:17 ` Gilles BULOZ
2022-09-19 14:59 ` Christoph Hellwig [this message]
2022-09-30 17:49 ` Gilles BULOZ
2022-10-03 6:24 ` Christoph Hellwig
2022-10-20 17:31 ` Gilles BULOZ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YyiDufvEa+dEtziJ@infradead.org \
--to=hch@infradead.org \
--cc=gilles.buloz@kontron.com \
--cc=jonathan.derrick@linux.dev \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox