Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: NeilBrown <neilb@suse.de>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	 Chris Mi <chrism@mellanox.com>,
	Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: [PATCH] Fix termination state for idr_for_each_entry_ul()
Date: Thu, 26 Oct 2023 09:22:07 +0200	[thread overview]
Message-ID: <5436a58dc63d7e7cc2cb2fbda722f0c0406e88bf.camel@redhat.com> (raw)
In-Reply-To: <169810161336.20306.1410058490199370047@noble.neil.brown.name>

On Tue, 2023-10-24 at 09:53 +1100, NeilBrown wrote:
> The comment for idr_for_each_entry_ul() states
> 
>   after normal termination @entry is left with the value NULL
> 
> This is not correct in the case where UINT_MAX has an entry in the idr.
> In that case @entry will be non-NULL after termination.
> No current code depends on the documentation being correct, but to
> save future code we should fix it.
> 
> Also fix idr_for_each_entry_continue_ul().  While this is not documented
> as leaving @entry as NULL, the mellanox driver appears to depend on
> it doing so.  So make that explicit in the documentation as well as in
> the code.
> 
> Fixes: e33d2b74d805 ("idr: fix overflow case for idr_for_each_entry_ul()")
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Chris Mi <chrism@mellanox.com>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: NeilBrown <neilb@suse.de>

Since the affected user is in the netdev tree, I think we can take this
patch. But this is also a sort of gray area of the tree... @Matthew are
you ok with that?

Thanks,

Paolo


  reply	other threads:[~2023-10-26  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 22:53 [PATCH] Fix termination state for idr_for_each_entry_ul() NeilBrown
2023-10-26  7:22 ` Paolo Abeni [this message]
2023-11-03  9:20 ` patchwork-bot+netdevbpf

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=5436a58dc63d7e7cc2cb2fbda722f0c0406e88bf.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=chrism@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=xiyou.wangcong@gmail.com \
    /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