[PATCH 6/7] nvme: also return I/O command effects from nvme_command_effects

Christoph Hellwig hch at lst.de
Tue Dec 13 23:58:03 PST 2022


On Tue, Dec 13, 2022 at 12:18:47PM -0700, Keith Busch wrote:
> +	if (!ctrl->effects) {
> +		if (id->lpa & NVME_CTRL_LPA_CMD_EFFECTS_LOG) {
> +			ret = nvme_get_effects_log(ctrl, NVME_CSI_NVM,
> +						   &ctrl->effects);
> +			if (ret < 0)
> +				goto out_free;
> +		} else {
> +			ctrl->effects = kzalloc(sizeof(*ctrl->effects),
> +						GFP_KERNEL);
> +			if (!ctrl->effects) {
> +				ret = -ENOMEM;
> +				goto out_free;
> +			}
> +		}
> +		nvme_init_known_nvm_effects(ctrl);

I'd probably move this entire block into a helper, but otherwise
this looks reasonable.




More information about the Linux-nvme mailing list