[PATCH v2] nvme: Fix zns drives without append support to export correct permissions
Christoph Hellwig
hch at lst.de
Tue Mar 22 01:39:14 PDT 2022
On Wed, Mar 16, 2022 at 03:28:30PM +0100, Pankaj Raghav wrote:
> Hi Christoph,
>
> On 2022-03-16 11:50, Christoph Hellwig wrote:
> > On Wed, Mar 16, 2022 at 10:34:23AM +0100, Pankaj Raghav wrote:
>
> >> - 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.
>
> >> 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.
> You are right, this is not the right way to fix it.
>
> What do you think about setting the disk permission after the disk info?
> That won't introduce any race and also makes sure all parameters are
> correctly set:
I don't think we really need the nvme_set_disk_mode helper, but we
also need this call for the multipath disk.
Otherwise the approach looks good to me.
More information about the Linux-nvme
mailing list