lkml.org 
[lkml]   [2016]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net-next] netfilter: nf_conntrack: remove the unneed check for *bucket
Date
From: Florian Westphal
> Sent: 30 January 2016 21:30
> Weidong Wang <wangweidong1@huawei.com> wrote:
> > In the 'for(...) {}', the *bucket alwasy < net->ct.htable_size,
> > so remove the check
> > @@ -1383,14 +1383,12 @@ get_next_corpse(struct net *net, int (*iter)(struct nf_conn *i, void *data),
> > lockp = &nf_conntrack_locks[*bucket % CONNTRACK_LOCKS];
> > local_bh_disable();
> > spin_lock(lockp);
> > - if (*bucket < net->ct.htable_size) {
>
> AFAIU net->ct.htable_size can shrink between for-test and aquiring
> the bucket lockp, so this additional if-test is needed.

If the table can shrink, can it not also grow - in which case
the references bucket will be incorrect?

David

\
 
 \ /
  Last update: 2016-02-01 18:01    [W:1.689 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site