Re: [PATCH] nvme: Allocate memory for xa_store in advance in nvme_get_effects_log

Christoph Hellwig
2024-12-12T06:28:00Z

On Mon, Dec 02, 2024 at 01:42:40PM +0100, Keisuke Nishimura wrote:
> + ret = xa_reserve(&ctrl->cels, csi, GFP_KERNEL);
> + if (ret) {
> + kfree(cel);
> + return ret;
> + }
> +
> ret = nvme_get_log(ctrl, 0x00, NVME_LOG_CMD_EFFECTS, 0, csi,
> cel, sizeof(*cel), 0);

There isn't really any point in doing a xa_reserve here vs simply
handling the xa_store error a bit below.