All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Pankaj Raghav <p.raghav@samsung.com>
Cc: "Javier González" <javier.gonz@samsung.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Sagi Grimberg" <sagi@grimberg.me>,
	"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Adam Manzanares" <a.manzanares@samsung.com>,
	"kanchan Joshi" <joshi.k@samsung.com>,
	"Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
	"Pankaj Raghav" <pankydev8@gmail.com>,
	"Kanchan Joshi" <joshiiitr@gmail.com>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH v2] nvme: Fix zns drives without append support to export correct permissions
Date: Wed, 16 Mar 2022 11:50:16 +0100	[thread overview]
Message-ID: <20220316105016.GA9393@lst.de> (raw)
In-Reply-To: <20220316093423.17906-1-p.raghav@samsung.com>

On Wed, Mar 16, 2022 at 10:34:23AM +0100, Pankaj Raghav wrote:
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 51c08f206cbf..cde33f2a3a5a 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1855,8 +1855,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
>  	blk_queue_max_write_zeroes_sectors(disk->queue,
>  					   ns->ctrl->max_zeroes_sectors);
>  
> -	set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) ||
> -		test_bit(NVME_NS_FORCE_RO, &ns->flags));
> +	set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO));

This will now set a namespace that was read-only due to unsupported ZNS
features writable during revalidation.

>   * Fill in the status and result information from the CQE, and then figure out
>   * if blk-mq will need to use IPI magic to complete the request, and if yes do
> diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c
> index 9f81beb4df4e..4ab685fa02b4 100644
> --- a/drivers/nvme/host/zns.c
> +++ b/drivers/nvme/host/zns.c
> @@ -113,6 +113,7 @@ int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf)
>  	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
>  	blk_queue_max_open_zones(q, le32_to_cpu(id->mor) + 1);
>  	blk_queue_max_active_zones(q, le32_to_cpu(id->mar) + 1);
> +	nvme_set_disk_mode_ro(ns);

And this will set a disk that is read-only due to NVME_NS_ATTR_RO
writable if the controller supports all essential ZNS features.


  parent reply	other threads:[~2022-03-16 10:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220316093439eucas1p27c2a31849e9dec6c6bc217c5f1b26180@eucas1p2.samsung.com>
2022-03-16  9:34 ` [PATCH v2] nvme: Fix zns drives without append support to export correct permissions Pankaj Raghav
2022-03-16  9:54   ` Chaitanya Kulkarni
2022-03-16  9:56     ` Chaitanya Kulkarni
2022-03-16 10:21       ` Pankaj Raghav
2022-03-16 16:50         ` Chaitanya Kulkarni
2022-03-16 18:03           ` Pankaj Raghav
2022-03-16 10:50   ` Christoph Hellwig [this message]
2022-03-16 14:28     ` Pankaj Raghav
2022-03-22  8:39       ` Christoph Hellwig
2022-03-16 16:52   ` Chaitanya Kulkarni
2022-03-16 18:00     ` Pankaj Raghav

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=20220316105016.GA9393@lst.de \
    --to=hch@lst.de \
    --cc=a.manzanares@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=javier.gonz@samsung.com \
    --cc=johannes.thumshirn@wdc.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 \
    --cc=sagi@grimberg.me \
    /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.