diff options
author | Christoph Hellwig <hch@lst.de> | 2020-08-20 09:31:36 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-10-07 07:56:17 +0200 |
commit | 7fad20dd7c0ab1d2c224755a574576be25f13e03 (patch) | |
tree | f4515f425310f26cd20d5a62a02456dacada890d /drivers/nvme/host/zns.c | |
parent | 6fcd669514794da08ce6bfa272b6ec9b33cb543d (diff) | |
download | linux-7fad20dd7c0ab1d2c224755a574576be25f13e03.tar.gz |
nvme: fix initialization of the zone bitmaps
The removal of the ->revalidate_disk method broke the initialization of
the zone bitmaps, as nvme_revalidate_disk now never gets called during
initialization.
Move the zone related code from nvme_revalidate_disk into a new helper in
zns.c, and call it from nvme_alloc_ns in addition to nvme_validate_ns to
ensure the zone bitmaps are initialized during probe.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'drivers/nvme/host/zns.c')
-rw-r--r-- | drivers/nvme/host/zns.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 53efecb67898..56d708017d06 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -7,6 +7,17 @@ #include <linux/vmalloc.h> #include "nvme.h" +int nvme_revalidate_zones(struct nvme_ns *ns) +{ + struct request_queue *q = ns->queue; + int ret; + + ret = blk_revalidate_disk_zones(ns->disk, NULL); + if (!ret) + blk_queue_max_zone_append_sectors(q, ns->ctrl->max_zone_append); + return ret; +} + static int nvme_set_max_append(struct nvme_ctrl *ctrl) { struct nvme_command c = { }; |