Repository navigation
Commit cfb876d
lib/rhashtable: consider param->min_size when setting initial table size
[ Upstream commit 107d01f ]
rhashtable_init() currently does not take into account the user-passed
min_size parameter unless param->nelem_hint is set as well. As such,
the default size (number of buckets) will always be HASH_DEFAULT_SIZE
even if the smallest allowed size is larger than that. Remediate this
by unconditionally calling into rounded_hashtable_size() and handling
things accordingly.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 9f7276c commit cfb876d
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
882 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
883 | 891 | | |
884 | 892 | | |
885 | 893 | | |
| |||
936 | 944 | | |
937 | 945 | | |
938 | 946 | | |
939 | | - | |
940 | | - | |
941 | 947 | | |
942 | 948 | | |
943 | 949 | | |
| |||
964 | 970 | | |
965 | 971 | | |
966 | 972 | | |
967 | | - | |
968 | | - | |
| 973 | + | |
969 | 974 | | |
970 | 975 | | |
971 | 976 | | |
| |||
0 commit comments