[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.21.2003110138120.3619@ninjahub.org>
Date: Wed, 11 Mar 2020 01:40:46 +0000 (GMT)
From: Jules Irenge <jbi.octave@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Jules Irenge <jbi.octave@...il.com>, boqun.feng@...il.com,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH 2/8] raw: Add missing annotations to raw_seq_start() and
raw_seq_stop()
On Tue, 10 Mar 2020, Eric Dumazet wrote:
>
>
> On 3/10/20 6:09 PM, Jules Irenge wrote:
> > Sparse reports warnings at raw_seq_start() and raw_seq_stop()
> >
> > warning: context imbalance in raw_seq_start() - wrong count at exit
> > warning: context imbalance in raw_seq_stop() - unexpected unlock
> >
> > The root cause is the missing annotations at raw_seq_start()
> > and raw_seq_stop()
> > Add the missing __acquires(&h->lock) annotation
> > Add the missing __releases(&h->lock) annotation
> >
> > Signed-off-by: Jules Irenge <jbi.octave@...il.com>
> > ---
> > net/ipv4/raw.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
> > index 3183413ebc6c..47665919048f 100644
> > --- a/net/ipv4/raw.c
> > +++ b/net/ipv4/raw.c
> > @@ -1034,6 +1034,7 @@ static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos)
> > }
> >
> > void *raw_seq_start(struct seq_file *seq, loff_t *pos)
> > + __acquires(&h->lock)
>
> I dunno, h variable is not yet defined/declared at this point,
> this looks weird.
>
> > {
> > struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file));
> >
> > @@ -1056,6 +1057,7 @@ void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos)
> > EXPORT_SYMBOL_GPL(raw_seq_next);
> >
> > void raw_seq_stop(struct seq_file *seq, void *v)
> > + __releases(&h->lock)
> > {
> > struct raw_hashinfo *h = PDE_DATA(file_inode(seq->file));
> >
> >
>
Thanks for the feedback,
I think h is a pointer of type struct raw_hashinfo, in which member lock
is initialized on line number 89.
Kind regards
Powered by blists - more mailing lists