lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nlwn4yodlo54hdbyil3kyxhaqgg5dmmdfvizsyj77oczgzezt2@m3qbtep3fhln>
Date: Fri, 27 Sep 2024 20:11:06 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Dave Chinner <david@...morbit.com>, 
	Linus Torvalds <torvalds@...ux-foundation.org>, linux-bcachefs@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Dave Chinner <dchinner@...hat.com>, Thomas Graf <tgraf@...g.ch>, 
	netdev@...r.kernel.org
Subject: Re: [GIT PULL] bcachefs changes for 6.12-rc1

On Fri, Sep 27, 2024 at 08:48:14AM GMT, Herbert Xu wrote:
> On Tue, Sep 24, 2024 at 10:48:07PM -0400, Kent Overstreet wrote:
> >
> > I've been noticing rhashtable resize is surprisingly heavy (the default
> > parameters don't ever shrink the table, which is why it's not seen as
> > much).
> 
> Most rhashtable users enable automatic shrinking.
> 
> > And, when I was torture testing that code I tripped over what appeared
> > to be an infinite loop in rht_bucket() when a rehsah is in progress,
> > which I worked around in
> > 
> >   a592cdf5164d bcachefs: don't use rht_bucket() in btree_key_cache_scan()
> 
> You must not walk the rhashtable internal data structures by hand.
> If you need to iterate through the whole table, use the provided
> walking mechanism.

I was just doing rht_for_each_entry_rcu() (open coded because you don't
provide a safe version).

> However, as rhashtable is dynamic, walking it during a resize may
> cause you to see some elements twice.  If you want to avoid that,
> set up your own linked list of all elements for a completely stable
> walk.

Yeah that's fine, but like I said, I was seeing an infinite loop inside
rht_bucket(). That would be an rhashtable bug...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ