[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150312133749.GB21620@casper.infradead.org>
Date: Thu, 12 Mar 2015 13:37:49 +0000
From: Thomas Graf <tgraf@...g.ch>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: netdev@...r.kernel.org
Subject: Re: rhashtable: Fix reader/rehash race
On 03/12/15 at 10:07pm, Herbert Xu wrote:
> There is a potential race condition between readers and the rehasher.
> In particular, the rehasher could have started a rehash while the
> reader finishes a scan of the old table but fails to see the new
> table pointer.
>
> This patch closes this window by adding smp_wmb/smp_rmb.
>
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
Are you sure this is sufficient? I think it is still possible
for a rehash to preempt a reader in between:
tbl = rht_dereference_rcu(ht->future_tbl, ht);
if (unlikely(tbl != old_tbl))
in which case old entries will be moved to the new table
without the reader seeing them. I don't see how ensuring order
solves this.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists