[PATCH] nvme: Fix zns drives without append support to export correct permissions

Christoph Hellwig hch at lst.de
Mon Mar 14 01:44:49 PDT 2022


On Mon, Mar 14, 2022 at 09:36:35AM +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 creates a race window during revalidation where the zone will be
set writable here only to be set read-only again a little later.



More information about the Linux-nvme mailing list