All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: "Pankaj Raghav" <p.raghav@samsung.com>,
	"Javier González" <javier.gonz@samsung.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
	"Johannes Thumshirn" <johannes.thumshirn@edc.com>,
	"Chaitanya Kulkarni" <chaitanya.kulkarni@wdc.com>,
	"Jens Axboe" <axboe@kernel.dk>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Adam Manzanares <a.manzanares@samsung.com>,
	kanchan Joshi <joshi.k@samsung.com>,
	Pankaj Raghav <pankydev8@gmail.com>,
	Kanchan Joshi <joshiiitr@gmail.com>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: Fix zns drives without append support to export correct permissions
Date: Sun, 13 Mar 2022 15:15:08 +0200	[thread overview]
Message-ID: <1bbc81a0-19f0-433b-28c2-b22d28176e37@grimberg.me> (raw)
In-Reply-To: <20220311201608.275384-1-p.raghav@samsung.com>



On 3/11/22 22:16, Pankaj Raghav wrote:
> This commit 2f4c9ba23b88 ("nvme: export zoned namespaces without Zone
> Append support read-only") exported zoned namespaces without append support
> to be marked as ro. It does it by setting NVME_NS_FORCE_RO to the
> ns->flags in nvme_update_zone_info and later nvme_update_disk_info will
> check for this flag and set the disk as ro.
> 
> But later this commit 73d90386b559 ("nvme: cleanup zone information
> initialization") rearranged nvme_update_disk_info to be called before
> nvme_update_zone_info thereby not marking the disk as ro. The call order
> cannot be just reverted because nvme_update_zone_info sets certain queue
> parameters such as zone_write_granularity that depend on the prior call
> to nvme_update_disk_info.
> 
> Call nvme_update_disk_info after nvme_update_zone_info again so that the
> permission for ZNS drives are marked correctly.
> 
> Fixes: 73d90386b559 ("nvme: cleanup zone information initialization")
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>   drivers/nvme/host/core.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 51c08f206cbf..67a78653b07c 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1913,6 +1913,11 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
>   		ret = nvme_update_zone_info(ns, lbaf);
>   		if (ret)
>   			goto out_unfreeze;
> +		/* nvme_update_zone_info might set the namespace to be marked
> +		 * as read-only. Call nvme_update_disk_info so that the disk
> +		 * is updated with the appropriate permission.
> +		 */
> +		nvme_update_disk_info(ns->disk, ns, id);

There is a call just above this, why add another call?


  parent reply	other threads:[~2022-03-13 13:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220311201638eucas1p18b9c5ecb3442b5a53bba233591d34db0@eucas1p1.samsung.com>
2022-03-11 20:16 ` [PATCH] nvme: Fix zns drives without append support to export correct permissions Pankaj Raghav
2022-03-11 20:49   ` Adam Manzanares
2022-03-12  8:14   ` Damien Le Moal
2022-03-14  8:36     ` Pankaj Raghav
2022-03-14  8:44       ` Christoph Hellwig
2022-03-14  9:21         ` Damien Le Moal
2022-03-14 10:19         ` Pankaj Raghav
2022-03-13 13:15   ` Sagi Grimberg [this message]
2022-03-14  6:21     ` Christoph Hellwig

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=1bbc81a0-19f0-433b-28c2-b22d28176e37@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=a.manzanares@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=hch@lst.de \
    --cc=javier.gonz@samsung.com \
    --cc=johannes.thumshirn@edc.com \
    --cc=joshi.k@samsung.com \
    --cc=joshiiitr@gmail.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=pankydev8@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.