lkml.org 
[lkml]   [2023]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Fix termination state for idr_for_each_entry_ul()
From
Date
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

\
 
 \ /
  Last update: 2023-10-26 09:23    [W:1.187 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site