Re: [PATCH 2/3] nvme-core: don't check non-mdts for disc ctrl

Christoph Hellwig
2022-04-11T12:12:33Z

On Mon, Apr 11, 2022 at 12:09:31PM +0000, Chaitanya Kulkarni wrote:
> - ret = nvme_init_non_mdts_limits(ctrl);
> - if (ret < 0)
> - return ret;
> + if (ctrl->cntrltype == NVME_CTRL_IO) {
> + ret = nvme_init_non_mdts_limits(ctrl);
> + if (ret < 0)
> + return ret;
> + }

This looks better, but I don't think it will actually work as-is.
The CNTRLTYPE field is never than discovry controllers. We
special case them in nvme_init_subsystem, which should move to
nvme_init_identify instead so that ctrl->cntrltype is always valid
after that.