Re: [PATCH 4/4] Staging: lustre: sparse lock warning fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 20, 2015 at 04:51:59PM +0000, Dilger, Andreas wrote:
> On 2015/05/18, 3:21 PM, "Dan Carpenter" <dan.carpenter@xxxxxxxxxx> 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux