lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2021-06-03 09:17    [W:0.066 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site