[PATCH 02/20] nvme: fix initialization of the zone bitmaps

Keith Busch kbusch at kernel.org
Tue Sep 29 17:27:17 EDT 2020


On Mon, Sep 28, 2020 at 02:34:44PM +0200, Christoph Hellwig wrote:
> @@ -4052,7 +4032,9 @@ static void nvme_validate_ns(struct nvme_ctrl *ctrl, unsigned nsid)
>  		return;
>  	}
>  
> -	ret = nvme_revalidate_disk(ns->disk);
> +	ret = _nvme_revalidate_disk(ns->disk);
> +	if (!ret && blk_queue_is_zoned(ns->queue))
> +		ret = nvme_revalidate_zones(ns);

This is a nifty trick: 'nvme_revalidate_zones' is declared but undefined
for !CONFIG_BLK_DEV_ZONED, and the compiler doesn't care because patch 1
makes it known that the symbol is unreachable.

I'll remember that for future use to avoid implementing empty stub
functions.



More information about the Linux-nvme mailing list