Skip to content

Commit ce8d786

Browse files
author
Christoph Hellwig
committed
nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH
Start warning about exposing a namespace as multiple block devices, and set a fixed deprecation release. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org>
1 parent e559398 commit ce8d786

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/block/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,7 @@ static void loop_remove(struct loop_device *lo)
20922092
del_gendisk(lo->lo_disk);
20932093
blk_cleanup_disk(lo->lo_disk);
20942094
blk_mq_free_tag_set(&lo->tag_set);
2095+
20952096
mutex_lock(&loop_ctl_mutex);
20962097
idr_remove(&loop_index_idr, lo->lo_number);
20972098
mutex_unlock(&loop_ctl_mutex);

drivers/nvme/host/core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3855,6 +3855,14 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
38553855
nsid);
38563856
goto out_put_ns_head;
38573857
}
3858+
3859+
if (!multipath && !list_empty(&head->list)) {
3860+
dev_warn(ctrl->device,
3861+
"Found shared namespace %d, but multipathing not supported.\n",
3862+
nsid);
3863+
dev_warn_once(ctrl->device,
3864+
"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0\n.");
3865+
}
38583866
}
38593867

38603868
list_add_tail_rcu(&ns->siblings, &head->list);

0 commit comments

Comments
 (0)