* [patch] cciss: unlock on error path
@ 2010-04-01 15:54 Dan Carpenter
2010-04-01 16:33 ` scameron
2010-04-02 6:39 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-04-01 15:54 UTC (permalink / raw)
To: Mike Miller
Cc: Jens Axboe, Stephen M. Cameron, Andrew Morton, iss_storagedev,
linux-kernel, kernel-janitors
We take the spin_lock again in fail_all_cmds() so we need to unlock
here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This was found by a static checker and I don't have the hardware myself.
Please review carefully.
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 9e3af30..eb5ff05 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3341,6 +3341,7 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id)
printk(KERN_WARNING
"cciss: controller cciss%d failed, stopping.\n",
h->ctlr);
+ spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
fail_all_cmds(h->ctlr);
return IRQ_HANDLED;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] cciss: unlock on error path
2010-04-01 15:54 [patch] cciss: unlock on error path Dan Carpenter
@ 2010-04-01 16:33 ` scameron
2010-04-02 6:39 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: scameron @ 2010-04-01 16:33 UTC (permalink / raw)
To: Dan Carpenter, Mike Miller, Jens Axboe, Andrew Morton,
iss_storagedev, linux-kernel, kernel-janitors
On Thu, Apr 01, 2010 at 06:54:04PM +0300, Dan Carpenter wrote:
> We take the spin_lock again in fail_all_cmds() so we need to unlock
> here.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> This was found by a static checker and I don't have the hardware myself.
> Please review carefully.
>
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 9e3af30..eb5ff05 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -3341,6 +3341,7 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id)
> printk(KERN_WARNING
> "cciss: controller cciss%d failed, stopping.\n",
> h->ctlr);
> + spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
> fail_all_cmds(h->ctlr);
> return IRQ_HANDLED;
> }
Looks ok to me. (Seems like I've seen this patch before).
It's pretty much a paranoid "never happen" case anyway.
To hit this, the hardware would have to return a tag that was marked as
containing an index, and then the index would have to be out of bounds,
so either, it would have to be broken driver, broken firmware or
broken hardware.
Really, one of these days, the interrupt handler should probably be
cleaned up to be more like what's in the hpsa driver.
-- steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] cciss: unlock on error path
2010-04-01 15:54 [patch] cciss: unlock on error path Dan Carpenter
2010-04-01 16:33 ` scameron
@ 2010-04-02 6:39 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2010-04-02 6:39 UTC (permalink / raw)
To: Dan Carpenter
Cc: Mike Miller, Stephen M. Cameron, Andrew Morton, iss_storagedev,
linux-kernel, kernel-janitors
On Thu, Apr 01 2010, Dan Carpenter wrote:
> We take the spin_lock again in fail_all_cmds() so we need to unlock
> here.
Thanks Dan, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-02 6:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 15:54 [patch] cciss: unlock on error path Dan Carpenter
2010-04-01 16:33 ` scameron
2010-04-02 6:39 ` Jens Axboe
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).