rhashtable: Wait for RCU readers after final unzip work
authorThomas Graf <tgraf@suug.ch>
Thu, 5 Feb 2015 01:03:33 +0000 (02:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Feb 2015 23:18:34 +0000 (15:18 -0800)
We need to wait for all RCU readers to complete after the last bit of
unzipping has been completed. Otherwise the old table is freed up
prematurely.

Fixes: 7e1e77636e36 ("lib: Resizable, Scalable, Concurrent Hash Table")
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c

index cea4244e032bd0d6028a20eca07140f85c2b4cd0..fd1033d518c6268dc3bf84fb23fa4d604b54dda3 100644 (file)
@@ -392,6 +392,8 @@ int rhashtable_expand(struct rhashtable *ht)
                }
        }
 
+       synchronize_rcu();
+
        bucket_table_free(old_tbl);
        return 0;
 }