Messages in this thread | | | Date | Thu, 3 Jun 2021 09:16:54 +0200 | From | Christoph Hellwig <> | Subject | Re: [PATCH] nvme: verify MNAN value if ANA is enabled |
| |
> @@ -2972,6 +2972,16 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl) > if (ret < 0) > goto out_free; > > +#ifdef CONFIG_NVME_MULTIPATH > + if (ctrl->ana_log_buf && (!ctrl->max_namespaces || > + ctrl->max_namespaces > le32_to_cpu(id->nn))) { > + dev_err(ctrl->device, > + "Invalid MNAN value %u\n", ctrl->max_namespaces); > + ret = -EINVAL; > + goto out_free; > + } > +#endif
Please move the check into nvme_mpath_init_identify, where we can avoid the ifdef and the ana_log_buf check, which won't trigger for the first initialization.
| |