[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140923214021.GA4206@salvia>
Date: Tue, 23 Sep 2014 23:40:21 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Ben Hutchings <ben.hutchings@...ethink.co.uk>
Cc: Rob Jones <rob.jones@...ethink.co.uk>, davem@...emloft.net,
coreteam@...filter.org, netdev@...r.kernel.org,
linux-kernel@...ethink.co.uk, linux-kernel@...r.kernel.org,
netfilter@...r.kernel.org, netfilter-devel@...r.kernel.org
Subject: Re: [PATCH v2] net/netfilter/x_tables.c: use
__seq_open_private()
On Tue, Sep 23, 2014 at 06:46:27PM +0100, Ben Hutchings wrote:
> On Tue, 2014-09-23 at 18:05 +0100, Rob Jones wrote:
> > Reduce boilerplate code by using __seq_open_private() instead of seq_open()
> > in xt_match_open() and xt_target_open().
> >
> > Signed-off-by: Rob Jones <rob.jones@...ethink.co.uk>
> > ---
> >
> > This patch uses an existing variant of seq_open() to reduce the kernel code
> > size.
> >
> > The only significant variation from the pre-existing code is the fact that
> > __seq_open_private() calls kzalloc() rather than kmalloc(), which could
> > conceivably have an impact on timing.
> >
> > This version 2 incorporates a minor initialisation simplification (resulting
> > from kzalloc() being used) requested by netfilter-devel@...r.kernel.org
> [...]
> > --- a/net/netfilter/x_tables.c
> > +++ b/net/netfilter/x_tables.c
> > @@ -1080,7 +1080,6 @@ static void *xt_mttg_seq_start(struct seq_file *seq, loff_t *pos,
> > struct nf_mttg_trav *trav = seq->private;
> > unsigned int j;
> >
> > - trav->class = MTTG_TRAV_INIT;
> > for (j = 0; j < *pos; ++j)
> > if (xt_mttg_seq_next(seq, NULL, NULL, is_target) == NULL)
> > return NULL;
> [...]
>
> I'm fairly sure this simplification is wrong, as xt_mttg_seq_start() is
> potentially called multiple times on the same file handle.
Right. I'm going to take v1 of this patch instead, sorry for the
inconvenience Rob.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists