[PATCH v2] nvme: Fix zns drives without append support to export correct permissions
Chaitanya Kulkarni
chaitanyak at nvidia.com
Wed Mar 16 09:52:07 PDT 2022
On 3/16/22 02:34, 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.
>
> Add a helper nvme_set_disk_ro that can be called in nvme_update_zone_info
> to set the permission for ZNS drives correctly.
>
> Fixes: 73d90386b559 ("nvme: cleanup zone information initialization")
> Signed-off-by: Pankaj Raghav <p.raghav at samsung.com>
> ---
what kind of testing you have done on this patch ?
do you have blktests which addressed this behavior ?
-ck
More information about the Linux-nvme
mailing list