From: Minwoo Im <minwoo.im.dev@xxxxxxxxx> Keep rejecting the hidden device access via open, but allow cases through the nvme-generic char device. Signed-off-by: Minwoo Im <minwoo.im.dev@xxxxxxxxx> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index d4884105ad95..0d0522bd4c2f 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1885,7 +1885,7 @@ static int nvme_ns_open(struct nvme_ns *ns) { #ifdef CONFIG_NVME_MULTIPATH /* should never be called due to GENHD_FL_HIDDEN */ - if (WARN_ON_ONCE(ns->head->disk)) + if (WARN_ON_ONCE(!nvme_ns_is_generic(ns) && ns->head->disk)) goto fail; #endif if (!kref_get_unless_zero(&ns->kref)) -- 2.17.1