From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Dilger, Andreas" <andreas.dilger@intel.com>
Cc: Adrian Remonda <adrianremonda@gmail.com>,
"open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
"moderated list:STAGING - LUSTRE..." <HPDD-discuss@ml01.01.org>,
Greg Donald <gdonald@gmail.com>,
open list <linux-kernel@vger.kernel.org>,
"Drokin, Oleg" <oleg.drokin@intel.com>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Joe Perches <joe@perches.com>
Subject: Re: [PATCH 4/4] Staging: lustre: sparse lock warning fix
Date: Wed, 20 May 2015 22:29:25 +0300 [thread overview]
Message-ID: <20150520192924.GS22558@mwanda> (raw)
In-Reply-To: <D18216B5.F1936%andreas.dilger@intel.com>
On Wed, May 20, 2015 at 04:51:59PM +0000, Dilger, Andreas wrote:
> On 2015/05/18, 3:21 PM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>
> >On Mon, May 18, 2015 at 08:34:51PM +0200, Adrian Remonda wrote:
> >> Fixed sparse warning: context imbalance in 'nrs_resource_put_safe' -
> >> 'different lock contexts for basic block' by releasing the lock on each
> >> iteration of the for loop.
> >>
> >
> >That changelog doesn't sound correct at all. That's not a correct
> >motivation or explanation.
> >
> >I reviewed the patch and it's likely going to cause dead locks. The code
> >is trying to take the spinlock for the first pointer in the array and
> >release it at the end. Now it takes the first pointer's spinlock a
> >bunch of times (dead lock) and releases it once (will not happen because
> >we are already dead).
>
> It isn't clear to me what the checkpatch complaint actually means? Is it
> that the spin_lock() and spin_unlock() calls have different amounts of
> indentation?
>
It's not a checkpatch.pl warning, it's a Sparse warning. Sparse is
crappy at reporting locking bugs. It's mostly false positives.
I think it's saying that some paths lock and unlock some don't.
Smatch is also fairly crappy at finding locking bugs, unfortunately.
I need to re-write it using modern features and cross function analysis.
regards,
dan carpenter
next prev parent reply other threads:[~2015-05-20 19:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1431974091-26363-1-git-send-email-adrianremonda@gmail.com>
2015-05-18 18:34 ` [PATCH 1/4] Staging: lustre: sparse static warning fix Adrian Remonda
2015-05-18 18:34 ` [PATCH 2/4] " Adrian Remonda
2015-05-18 18:34 ` [PATCH 3/4] Staging: lustre: Fixed typo Adrian Remonda
2015-05-18 18:34 ` [PATCH 4/4] Staging: lustre: sparse lock warning fix Adrian Remonda
2015-05-18 21:21 ` Dan Carpenter
2015-05-20 16:51 ` Dilger, Andreas
2015-05-20 19:29 ` Dan Carpenter [this message]
2015-05-20 19:42 ` Dan Carpenter
2015-05-20 22:51 ` Dilger, Andreas
2015-05-22 13:38 ` Dan Carpenter
2015-05-21 8:15 ` AdrianRemonda
2015-05-21 15:12 ` Dan Carpenter
2015-05-21 15:33 ` Drokin, Oleg
2015-05-22 1:11 ` Nikitas Angelinas
2015-05-18 21:23 ` [PATCH 1/4] Staging: lustre: sparse static " Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150520192924.GS22558@mwanda \
--to=dan.carpenter@oracle.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=Julia.Lawall@lip6.fr \
--cc=adrianremonda@gmail.com \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gdonald@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox