All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Yao <peter@exavio.com.cn>
To: linux-kernel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Subject: smp dead lock of io_request_lock/queue_lock patch
Date: Mon, 12 Jan 2004 16:32:35 +0000	[thread overview]
Message-ID: <4002CC23.6000105@exavio.com.cn> (raw)

Hi,
I found a smp dead lock in io_request_lock/queue_lock patch in redhat's
2.4.18-4 kernel. I don't know how this patch is going on, just put my
fix for it here. :)
The dead lock is for scsi host->lock and scsi q->queue_lock between
scsi_restart_operations@scsi_error.c and scsi_request_fn@scsi_lib.c.


Index: scsi_error.c
===================================================================
RCS file:
/home/cvsroot/ieee1394_driver/linux-2.4.18-3/drivers/scsi/scsi_error.c,v
retrieving revision 1.13
retrieving revision 1.13.8.1
diff -Llinux-2.4.18-3/drivers/scsi/scsi_error.c
-Llinux-2.4.18-3/drivers/scsi/scsi_error.c -u -d -r1.13 -r1.13.8.1
--- linux-2.4.18-3/drivers/scsi/scsi_error.c
+++ linux-2.4.18-3/drivers/scsi/scsi_error.c
@@ -1293,11 +1293,11 @@
 			break;
 		}
 		q = &SDpnt->request_queue;
-		spin_lock(q->queue_lock);
 		spin_unlock(host->lock);
+		spin_lock(q->queue_lock);
 		q->request_fn(q);
-		spin_lock(host->lock);
 		spin_unlock(q->queue_lock);
+		spin_lock(host->lock);
 	}
 	spin_unlock_irqrestore(host->lock, flags);
 }


             reply	other threads:[~2004-01-12  8:30 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-12 16:32 Peter Yao [this message]
2004-01-12  9:08 ` smp dead lock of io_request_lock/queue_lock patch Arjan van de Ven
2004-01-12  9:19   ` Jens Axboe
2004-01-12  9:19     ` Jens Axboe
2004-01-12  9:20       ` Arjan van de Ven
2004-01-12  9:22         ` Jens Axboe
2004-01-12 13:27           ` Doug Ledford
2004-01-15 17:01             ` Bill Davidsen
2004-01-15 17:05               ` Jens Axboe
2004-01-15 17:09               ` Arjan van de Ven
2004-01-15 19:30               ` Doug Ledford
  -- strict thread matches above, loose matches on Subject: below --
2004-01-19 21:36 Martin Peschke3
2004-01-19 21:36 ` Martin Peschke3
2004-03-08 21:25 ` Doug Ledford
     [not found] <1d6yN-6HH-17@gated-at.bofh.it>
     [not found] ` <1dasC-5Ww-5@gated-at.bofh.it>
     [not found]   ` <1ejkf-724-13@gated-at.bofh.it>
     [not found]     ` <1elvB-Jt-25@gated-at.bofh.it>
2004-01-16 15:40       ` Bill Davidsen
2004-01-12 15:07 Martin Peschke3
2004-01-12 15:12 ` Arjan van de Ven
2004-01-12 19:48   ` Christoph Hellwig
2004-01-12 19:51     ` Doug Ledford
2004-01-12 20:03       ` Christoph Hellwig
2004-01-12 21:12         ` Jens Axboe
2004-01-13 20:55       ` Marcelo Tosatti
2004-01-17 13:10         ` Doug Ledford
2004-01-17 16:58           ` Christoph Hellwig
2004-01-17 19:07             ` Doug Ledford
2004-01-17 19:17               ` Christoph Hellwig
2004-01-17 19:21                 ` Doug Ledford
2004-01-17 19:29                   ` Christoph Hellwig
2004-01-17 20:36                     ` Doug Ledford
2004-01-17 20:54                       ` Christoph Hellwig
2004-01-20  7:53               ` Jens Axboe
2004-01-25  0:31           ` Kurt Garloff
2004-01-15 17:17       ` Bill Davidsen
2004-01-17 13:12         ` Doug Ledford
2004-01-17 15:16           ` Bill Davidsen
2004-01-17 16:07             ` Doug Ledford
2004-01-12 14:07 Martin Peschke3
2004-01-12 14:07 ` Martin Peschke3
2004-01-12 14:11 ` Arjan van de Ven
2004-01-12 14:13 ` Jens Axboe
2004-01-12 15:08   ` Doug Ledford
2004-01-12 15:24     ` James Bottomley
2004-01-12 15:43       ` Jens Axboe
2004-01-12 15:52         ` Doug Ledford
2004-01-12 16:04           ` James Bottomley
2004-01-12 16:05             ` Doug Ledford

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=4002CC23.6000105@exavio.com.cn \
    --to=peter@exavio.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.