• Herbert Xu's avatar
    rhashtable: Fix walker behaviour during rehash · eddee5ba
    Herbert Xu authored
    Previously whenever the walker encountered a resize it simply
    snaps back to the beginning and starts again.  However, this only
    works if the rehash started and completed while the walker was
    idle.
    
    If the walker attempts to restart while the rehash is still ongoing,
    we may miss objects that we shouldn't have.
    
    This patch fixes this by making the walker walk the old table
    followed by the new table just like all other readers.  If a
    rehash is detected we will still signal our caller of the fact
    so they can prepare for duplicates but we will simply continue
    the walk onto the new table after the old one is finished either
    by us or by the rehasher.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    eddee5ba
rhashtable.h 12.2 KB