From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
Oleksii Kurochko <olkuroch@cisco.com>,
Sagi Grimberg <sagi@grimberg.me>,
Mike Snitzer <snitzer@redhat.com>,
Ilya Dryomov <idryomov@gmail.com>,
Dongsheng Yang <dongsheng.yang@easystack.cn>,
ceph-devel@vger.kernel.org, dm-devel@redhat.com,
linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH 6/6] nvme: allow revalidate to set a namespace read-only
Date: Tue, 8 Dec 2020 17:49:19 +0100 [thread overview]
Message-ID: <59794c03-e907-f265-2358-b2271b46ec2b@suse.de> (raw)
In-Reply-To: <20201208162829.2424563-7-hch@lst.de>
On 12/8/20 5:28 PM, Christoph Hellwig wrote:
> Unconditionally call set_disk_ro now that it only updates the hardware
> state. This allows to properly set up the Linux devices read-only when
> the controller turns a previously writable namespace read-only.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Keith Busch <kbusch@kernel.org>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
> drivers/nvme/host/core.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index ce1b6151944131..3a0557ccc9fc5d 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2114,9 +2114,8 @@ static void nvme_update_disk_info(struct gendisk *disk,
> nvme_config_discard(disk, ns);
> nvme_config_write_zeroes(disk, ns);
>
> - if ((id->nsattr & NVME_NS_ATTR_RO) ||
> - test_bit(NVME_NS_FORCE_RO, &ns->flags))
> - set_disk_ro(disk, true);
> + set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) ||
> + test_bit(NVME_NS_FORCE_RO, &ns->flags));
> }
>
> static inline bool nvme_first_scan(struct gendisk *disk)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
next prev parent reply other threads:[~2020-12-08 16:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 16:28 split hard read-only vs read-only policy v3 Christoph Hellwig
2020-12-08 16:28 ` [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only Christoph Hellwig
2020-12-08 16:28 ` [PATCH 2/6] block: remove the NULL bdev check in bdev_read_only Christoph Hellwig
2020-12-08 16:45 ` Hannes Reinecke
2020-12-08 16:28 ` [PATCH 3/6] block: add a hard-readonly flag to struct gendisk Christoph Hellwig
2020-12-08 16:28 ` [PATCH 4/6] block: propagate BLKROSET on the whole device to all partitions Christoph Hellwig
2020-12-08 16:47 ` Hannes Reinecke
2020-12-09 2:51 ` Ming Lei
2020-12-08 16:28 ` [PATCH 5/6] rbd: remove the ->set_read_only method Christoph Hellwig
2020-12-09 2:52 ` Ming Lei
2020-12-08 16:28 ` [PATCH 6/6] nvme: allow revalidate to set a namespace read-only Christoph Hellwig
2020-12-08 16:49 ` Hannes Reinecke [this message]
2020-12-09 2:54 ` Ming Lei
-- strict thread matches above, loose matches on Subject: below --
2021-01-09 10:42 split hard read-only vs read-only policy v3 (resend) Christoph Hellwig
2021-01-09 10:42 ` [PATCH 6/6] nvme: allow revalidate to set a namespace read-only Christoph Hellwig
2021-01-09 20:27 ` Chaitanya Kulkarni
2021-01-10 15:01 ` Hannes Reinecke
2020-12-07 13:19 split hard read-only vs read-only policy v2 Christoph Hellwig
2020-12-07 13:19 ` [PATCH 6/6] nvme: allow revalidate to set a namespace read-only Christoph Hellwig
2020-12-07 18:13 ` Keith Busch
2020-12-08 5:29 ` Martin K. Petersen
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=59794c03-e907-f265-2358-b2271b46ec2b@suse.de \
--to=hare@suse.de \
--cc=axboe@kernel.dk \
--cc=ceph-devel@vger.kernel.org \
--cc=dm-devel@redhat.com \
--cc=dongsheng.yang@easystack.cn \
--cc=hch@lst.de \
--cc=idryomov@gmail.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=olkuroch@cisco.com \
--cc=sagi@grimberg.me \
--cc=snitzer@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).