linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH v2] nvmet-rdma: fix possible bogus dereference under heavy load
Date: Wed, 5 Sep 2018 19:16:32 +0200	[thread overview]
Message-ID: <20180905171632.GA31569@lst.de> (raw)
In-Reply-To: <f7d0cba7-f363-0216-75c6-0be0723974d8@grimberg.me>

On Wed, Sep 05, 2018@08:14:07AM -0700, Sagi Grimberg wrote:
>
>>> -	rsp = list_first_entry(&queue->free_rsps,
>>> +	rsp = list_first_entry_or_null(&queue->free_rsps,
>>>   				struct nvmet_rdma_rsp, free_list);
>>> -	list_del(&rsp->free_list);
>>> +	if (likely(rsp)) {
>>> +		list_del(&rsp->free_list);
>>> +		rsp->allocated = false;
>>
>> Given that we never set allocated to true for something we got from
>> the freelist, and the structures were allocated using kcalloc I don't
>> ?ee why we need to set it to false here.
>
> I have no problem removing it, should I send a new spin?

I can fix it up.

      reply	other threads:[~2018-09-05 17:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 10:47 [PATCH v2] nvmet-rdma: fix possible bogus dereference under heavy load Sagi Grimberg
2018-09-04 19:06 ` Christoph Hellwig
2018-09-05 15:14   ` Sagi Grimberg
2018-09-05 17:16     ` Christoph Hellwig [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=20180905171632.GA31569@lst.de \
    --to=hch@lst.de \
    /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;
as well as URLs for NNTP newsgroup(s).