Re: [GIT PULL] bcachefs changes for 6.12-rc1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 27, 2024 at 08:11:06PM -0400, Kent Overstreet wrote:
>
> > > 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).

I'm talking about the commit a592cd above.  You were doing this:

	for (i = 0; i < tbl->size; i++)
		rht_for_each_entry_rcu(ck, pos, tbl, i, hash) {

This is absolutely not allowed.  The rhashtable must only be accessed
through the published API and not iterated over directly.  This is
guaranteed to break during a resize/rehash.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux