All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: william.hua@canonical.com, netdev@vger.kernel.org, tgraf@suug.ch
Subject: Re: rhashtable: Enforce minimum size on initial hash table
Date: Wed, 16 Dec 2015 10:45:08 -0500 (EST)	[thread overview]
Message-ID: <20151216.104508.256133184136757332.davem@davemloft.net> (raw)
In-Reply-To: <20151216101314.GA24928@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 16 Dec 2015 18:13:14 +0800

> William Hua <william.hua@canonical.com> wrote:
>>
>> I wasn't aware there was an enforced minimum size. I simply set the 
>> nelem_hint in the rhastable_params struct to 1, expecting it to grow as
>> needed. This caused a segfault afterwards when trying to insert an
>> element.
> 
> OK we're doing the size computation before we enforce the limit
> on min_size.
> 
> ---8<---
> We need to do the initial hash table size computation after we
> have obtained the correct min_size/max_size parameters.  Otherwise
> we may end up with a hash table whose size is outside the allowed
> envelope.
> 
> Fixes: a998f712f77e ("rhashtable: Round up/down min/max_size to...")
> Reported-by: William Hua <william.hua@canonical.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied and queued up for -stable, thanks!

      reply	other threads:[~2015-12-16 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 22:45 [PATCH] rhashtable: Always allocate at least one bucket lock William Hua
2015-12-16  5:53 ` Herbert Xu
2015-12-16  7:33   ` William Hua
2015-12-16 10:13     ` rhashtable: Enforce minimum size on initial hash table Herbert Xu
2015-12-16 15:45       ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151216.104508.256133184136757332.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    --cc=william.hua@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.