• Herbert Xu's avatar
    inet: frags: Remove unnecessary smp_store_release/READ_ONCE · 32707c4d
    Herbert Xu authored
    The smp_store_release call in fqdir_exit cannot protect the setting
    of fqdir->dead as claimed because its memory barrier is only
    guaranteed to be one-way and the barrier precedes the setting of
    fqdir->dead.
    
    IOW it doesn't provide any barriers between fq->dir and the following
    hash table destruction.
    
    In fact, the code is safe anyway because call_rcu does provide both
    the memory barrier as well as a guarantee that when the destruction
    work starts executing all RCU readers will see the updated value for
    fqdir->dead.
    
    Therefore this patch removes the unnecessary smp_store_release call
    as well as the corresponding READ_ONCE on the read-side in order to
    not confuse future readers of this code.  Comments have been added
    in their places.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    32707c4d
inet_fragment.c 14.6 KB