From: "Andreas Herrmann" <andreas.herrmann3@amd.com>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Swen Schillig <swen.schillig@freenet.de>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] zfcp: Invalid locking order
Date: Thu, 8 Feb 2007 17:18:22 +0100 [thread overview]
Message-ID: <20070208161822.GA1768@alberich.amd.com> (raw)
In-Reply-To: <20070208144003.GC8345@osiris.boeblingen.de.ibm.com>
On Thu, Feb 08, 2007 at 03:40:03PM +0100, Heiko Carstens wrote:
> On Wed, Feb 07, 2007 at 05:06:43PM +0100, Andreas Herrmann wrote:
> > On Wed, Feb 07, 2007 at 01:17:57PM +0100, Swen Schillig wrote:
> > > From: Swen Schillig <swen@vnet.ibm.com>
> > >
> > > Invalid locking order. Kernel hangs after trying to take two locks
> > > which are dependend on each other. Introducing temporary variable
> > > to free requests. Free lock after requests are copied.
> > >
> >
> > I am just curious. You didn't mention which locks are causing the dead
> > lock.
> >
> > I've glanced through the code and it seems that locking order
> > of abort_lock and req_list_lock for adapters is inconsistent.
> > Is that the bug you try to fix?
>
> It's a possible A-B-B-A deadlock on the erp_lock and req_list_lock
> (see output below). The bug was introduced with
> fea9d6c7bcd8ff1d60ff74f27ba483b3820b18a3 and this patch reverts
> parts of it.
>
Pretty good catch.
I might be wrong but the patch seems to fix another potential deadlock:
CPU#0
0: zfcp_fsf_req_dimiss_all()
spin_lock_irqsave(&adapter->req_list_lock, flags);
1: zfcp_fsf_req_dismiss()
2: zfcp_fsf_protstatus_eval()
3: zfcp_fsf_fsfstatus_eval()
4: zfcp_fsf_req_dispatch()
5: zfcp_fsf_send_fcp_command_handler()
6: zfcp_fsf_send_fcp_command_task_handler()
read_lock_irqsave(&fsf_req->adapter->abort_lock, flags);
CPU#1
0: zfcp_scsi_eh_abort_handler()
write_lock_irqsave(&adapter->abort_lock, flags);
spin_lock(&adapter->req_list_lock);
But I currently do not overlook whether zfcp_fsf_req_dimiss_all()
and zfcp_scsi_eh_abort_handler() can run simultaneously for the
same adapter.
However that may be, with Swen's patch this case won't happen.
Regards,
Andreas
--
AMD Saxony, Dresden, Germany
Operating System Research Center
prev parent reply other threads:[~2007-02-08 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-07 12:17 [PATCH] zfcp: Invalid locking order Swen Schillig
2007-02-07 16:06 ` Andreas Herrmann
2007-02-07 16:19 ` Swen Schillig
2007-02-08 14:40 ` Heiko Carstens
2007-02-08 16:18 ` Andreas Herrmann [this message]
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=20070208161822.GA1768@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=swen.schillig@freenet.de \
/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