From: Keisuke Nishimura <keisuke.nishimura@inria.fr>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: Add error path for xa_store in nvme_init_effects
Date: Mon, 16 Dec 2024 16:32:08 +0100 [thread overview]
Message-ID: <1db56eee-5d64-43f2-8595-4af98e54095a@inria.fr> (raw)
In-Reply-To: <20241212062852.GB5718@lst.de>
On 12/12/2024 07:28, Christoph Hellwig wrote:
> On Mon, Dec 02, 2024 at 04:39:22PM +0100, Keisuke Nishimura wrote:
>> if (!ctrl->effects) {
>> + struct nvme_effects_log *effects, *old;
>> +
>> + effects = kzalloc(sizeof(*effects), GFP_KERNEL);
>> + if (effects)
>> return -ENOMEM;
>> +
>> + old = xa_store(&ctrl->cels, NVME_CSI_NVM, effects, GFP_KERNEL);
>> + if (xa_is_err(old)) {
>> + kfree(effects);
>> + return xa_err(old);
>> + }
>> + ctrl->effects = effects;
>
> Please split this into a helper now that is becoming rather complex.
>
> Otherwise this looks fine to me.
Thank you for the review. I will send the new version soon.
Keisuke
prev parent reply other threads:[~2024-12-16 15:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 15:39 [PATCH] nvme: Add error path for xa_store in nvme_init_effects Keisuke Nishimura
2024-12-12 6:28 ` Christoph Hellwig
2024-12-16 15:32 ` Keisuke Nishimura [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1db56eee-5d64-43f2-8595-4af98e54095a@inria.fr \
--to=keisuke.nishimura@inria.fr \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox