alistair23-linux/include
Herbert Xu 6d684e5469 rhashtable: Cap total number of entries to 2^31
When max_size is not set or if it set to a sufficiently large
value, the nelems counter can overflow.  This would cause havoc
with the automatic shrinking as it would then attempt to fit a
huge number of entries into a tiny hash table.

This patch fixes this by adding max_elems to struct rhashtable
to cap the number of elements.  This is set to 2^31 as nelems is
not a precise count.  This is sufficiently smaller than UINT_MAX
that it should be safe.

When max_size is set max_elems will be lowered to at most twice
max_size as is the status quo.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-27 11:48:24 -04:00
..
acpi
asm-generic vmlinux.lds: add missing VMLINUX_SYMBOL macros 2017-04-08 00:47:48 -07:00
clocksource
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-04-18 09:03:50 -07:00
drm
dt-bindings
keys
kvm KVM: arm64: Ensure LRs are clear when they should be 2017-04-04 14:33:58 +02:00
linux rhashtable: Cap total number of entries to 2^31 2017-04-27 11:48:24 -04:00
math-emu
media
memory
misc
net tcp: do not pass timestamp to tcp_rack_advance() 2017-04-26 14:44:38 -04:00
pcmcia
ras
rdma
rxrpc
scsi
soc
sound
target
trace bpf: map_get_next_key to return first key on NULL 2017-04-25 11:57:45 -04:00
uapi net: Generic XDP 2017-04-25 13:33:49 -04:00
video
xen
Kbuild