* context imbalance false positive sparse warnings
@ 2008-08-19 21:47 Steve French
2008-08-19 22:00 ` Stalin Kenny
0 siblings, 1 reply; 5+ messages in thread
From: Steve French @ 2008-08-19 21:47 UTC (permalink / raw)
To: linux-sparse
Just building one directory of the kernel (./fs/*.c), ie "make bzImage
C=1" generates more than 200 sparse warnings similar to
warning: context imbalance in 'set_task_ioprio': wrong count at exit
Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
static void put_super(struct super_block *sb)
{
spin_lock(&sb_lock);
__put_super(sb);
spin_unlock(&sb_lock);
}
It doesn't look like sparse has been fixed in a few months, unless the
sparse tool repository has moved from the
/pub/scm / devel/sparse/sparse.git
directory on git.kernel.org
Is there a way to turn just this warning off (the thousands of context
imbalance messages generated by the kernel build make it harder to see
real errors which sparse could catch)?
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: context imbalance false positive sparse warnings
2008-08-19 21:47 context imbalance false positive sparse warnings Steve French
@ 2008-08-19 22:00 ` Stalin Kenny
2008-08-19 22:22 ` Steve French
0 siblings, 1 reply; 5+ messages in thread
From: Stalin Kenny @ 2008-08-19 22:00 UTC (permalink / raw)
To: Steve French; +Cc: linux-sparse
> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
>
> static void put_super(struct super_block *sb)
> {
> spin_lock(&sb_lock);
> __put_super(sb);
> spin_unlock(&sb_lock);
> }
What is the sparse error when you call this function ?
On 8/19/08, Steve French <smfrench@gmail.com> wrote:
> Just building one directory of the kernel (./fs/*.c), ie "make bzImage
> C=1" generates more than 200 sparse warnings similar to
> warning: context imbalance in 'set_task_ioprio': wrong count at exit
>
> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
>
> static void put_super(struct super_block *sb)
> {
> spin_lock(&sb_lock);
> __put_super(sb);
> spin_unlock(&sb_lock);
> }
>
>
> It doesn't look like sparse has been fixed in a few months, unless the
> sparse tool repository has moved from the
> /pub/scm / devel/sparse/sparse.git
> directory on git.kernel.org
>
> Is there a way to turn just this warning off (the thousands of context
> imbalance messages generated by the kernel build make it harder to see
> real errors which sparse could catch)?
>
>
> --
> Thanks,
>
> Steve
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: context imbalance false positive sparse warnings
2008-08-19 22:00 ` Stalin Kenny
@ 2008-08-19 22:22 ` Steve French
2008-08-19 22:26 ` Harvey Harrison
0 siblings, 1 reply; 5+ messages in thread
From: Steve French @ 2008-08-19 22:22 UTC (permalink / raw)
To: Stalin Kenny; +Cc: linux-sparse
On Tue, Aug 19, 2008 at 5:00 PM, Stalin Kenny <stalinlinux@gmail.com> wrote:
>> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
>>
>> static void put_super(struct super_block *sb)
>> {
>> spin_lock(&sb_lock);
>> __put_super(sb);
>> spin_unlock(&sb_lock);
>> }
>
> What is the sparse error when you call this function ?
CHECK fs/super.c
fs/super.c:164:2: warning: context imbalance in 'put_super': wrong count at exit
fs/super.c:164:2: context 'lock': wanted 0, got 1
>
> On 8/19/08, Steve French <smfrench@gmail.com> wrote:
>> Just building one directory of the kernel (./fs/*.c), ie "make bzImage
>> C=1" generates more than 200 sparse warnings similar to
>> warning: context imbalance in 'set_task_ioprio': wrong count at exit
>>
>> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
>>
>> static void put_super(struct super_block *sb)
>> {
>> spin_lock(&sb_lock);
>> __put_super(sb);
>> spin_unlock(&sb_lock);
>> }
>>
>>
>> It doesn't look like sparse has been fixed in a few months, unless the
>> sparse tool repository has moved from the
>> /pub/scm / devel/sparse/sparse.git
>> directory on git.kernel.org
>>
>> Is there a way to turn just this warning off (the thousands of context
>> imbalance messages generated by the kernel build make it harder to see
>> real errors which sparse could catch)?
>>
>>
>> --
>> Thanks,
>>
>> Steve
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: context imbalance false positive sparse warnings
2008-08-19 22:22 ` Steve French
@ 2008-08-19 22:26 ` Harvey Harrison
2008-09-10 7:47 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Harvey Harrison @ 2008-08-19 22:26 UTC (permalink / raw)
To: Steve French; +Cc: Stalin Kenny, linux-sparse, Johannes Berg
On Tue, 2008-08-19 at 17:22 -0500, Steve French wrote:
> On Tue, Aug 19, 2008 at 5:00 PM, Stalin Kenny <stalinlinux@gmail.com> wrote:
> >> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
> >>
> >> static void put_super(struct super_block *sb)
> >> {
> >> spin_lock(&sb_lock);
> >> __put_super(sb);
> >> spin_unlock(&sb_lock);
> >> }
> >
> > What is the sparse error when you call this function ?
> CHECK fs/super.c
> fs/super.c:164:2: warning: context imbalance in 'put_super': wrong count at exit
> fs/super.c:164:2: context 'lock': wanted 0, got 1
>
>
Johannes Berg had a 9-patch series that improved this somewhat, but they had
some bugs in them (crashes). But I've been running with them anyway as they
do improve cases like this significantly.
Harvey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: context imbalance false positive sparse warnings
2008-08-19 22:26 ` Harvey Harrison
@ 2008-09-10 7:47 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-09-10 7:47 UTC (permalink / raw)
To: Harvey Harrison; +Cc: Steve French, Stalin Kenny, linux-sparse
[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]
On Tue, 2008-08-19 at 15:26 -0700, Harvey Harrison wrote:
> On Tue, 2008-08-19 at 17:22 -0500, Steve French wrote:
> > On Tue, Aug 19, 2008 at 5:00 PM, Stalin Kenny <stalinlinux@gmail.com> wrote:
> > >> Even the simplest use cases throw this error e.g. fs/super.c line 162-164:
> > >>
> > >> static void put_super(struct super_block *sb)
> > >> {
> > >> spin_lock(&sb_lock);
> > >> __put_super(sb);
> > >> spin_unlock(&sb_lock);
> > >> }
> > >
> > > What is the sparse error when you call this function ?
> > CHECK fs/super.c
> > fs/super.c:164:2: warning: context imbalance in 'put_super': wrong count at exit
> > fs/super.c:164:2: context 'lock': wanted 0, got 1
> >
> >
>
> Johannes Berg had a 9-patch series that improved this somewhat, but they had
> some bugs in them (crashes). But I've been running with them anyway as they
> do improve cases like this significantly.
I've just sent out a fixed version and with it I get no errors on
fs/super.c when I apply this small fixup:
diff --git a/fs/super.c b/fs/super.c
index e931ae9..6810845 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -201,7 +201,7 @@ EXPORT_SYMBOL(deactivate_super);
* success, 0 if we had failed (superblock contents was already dead or
* dying when grab_super() had been called).
*/
-static int grab_super(struct super_block *s) __releases(sb_lock)
+static int grab_super(struct super_block *s) __releases(&sb_lock)
{
s->s_count++;
spin_unlock(&sb_lock);
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-10 7:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 21:47 context imbalance false positive sparse warnings Steve French
2008-08-19 22:00 ` Stalin Kenny
2008-08-19 22:22 ` Steve French
2008-08-19 22:26 ` Harvey Harrison
2008-09-10 7:47 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).