[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCD2594@AcuExch.aculab.com>
Date: Mon, 1 Feb 2016 16:39:56 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Florian Westphal' <fw@...len.de>,
Weidong Wang <wangweidong1@...wei.com>
CC: "pablo@...filter.org" <pablo@...filter.org>,
"kaber@...sh.net" <kaber@...sh.net>,
"kadlec@...ckhole.kfki.hu" <kadlec@...ckhole.kfki.hu>,
David Miller <davem@...emloft.net>,
"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
"coreteam@...filter.org" <coreteam@...filter.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] netfilter: nf_conntrack: remove the unneed
check for *bucket
From: Florian Westphal
> Sent: 30 January 2016 21:30
> Weidong Wang <wangweidong1@...wei.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
Powered by blists - more mailing lists