All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Mark Lord <liml@rtr.ca>
Cc: Arjan van de Ven <arjan@infradead.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	mingo@elte.hu
Subject: Re: 2.6.19-rc3-git7: scsi_device_unbusy: inconsistent lock state
Date: Mon, 30 Oct 2006 19:52:14 +0100	[thread overview]
Message-ID: <20061030185214.GH14055@kernel.dk> (raw)
In-Reply-To: <454644C1.4080702@rtr.ca>

On Mon, Oct 30 2006, Mark Lord wrote:
> (gdb) l *cfq_set_request+0x33e
> 0xc021780e is in cfq_set_request (block/cfq-iosched.c:1224).
> 1219            if (unlikely(!cfqd))
> 1220                    return;
> 1221
> 1222            spin_lock(cfqd->queue->queue_lock);
> 1223
> 1224            cfqq = cic->cfqq[ASYNC];
> 1225            if (cfqq) {
> 1226                    struct cfq_queue *new_cfqq;
> 1227                    new_cfqq = cfq_get_queue(cfqd, CFQ_KEY_ASYNC, 
> cic->ioc->task,
> 1228                                             GFP_ATOMIC);

Bingo, that's a lot better! So that's the real bug, I'm guessing this
got introduced when the ioprio stuff got juggled around recently. Pretty
straight forward, this should fix it for you.


diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d3d7613..25c4e7e 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1215,11 +1215,12 @@ static inline void changed_ioprio(struct
 {
 	struct cfq_data *cfqd = cic->key;
 	struct cfq_queue *cfqq;
+	unsigned long flags;
 
 	if (unlikely(!cfqd))
 		return;
 
-	spin_lock(cfqd->queue->queue_lock);
+	spin_lock_irqsave(cfqd->queue->queue_lock, flags);
 
 	cfqq = cic->cfqq[ASYNC];
 	if (cfqq) {
@@ -1236,7 +1237,7 @@ static inline void changed_ioprio(struct
 	if (cfqq)
 		cfq_mark_cfqq_prio_changed(cfqq);
 
-	spin_unlock(cfqd->queue->queue_lock);
+	spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
 }
 
 static void cfq_ioc_set_ioprio(struct io_context *ioc)

-- 
Jens Axboe


  parent reply	other threads:[~2006-10-30 18:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-30 14:33 2.6.19-rc3-git7: scsi_device_unbusy: inconsistent lock state Mark Lord
2006-10-30 14:43 ` Jens Axboe
2006-10-30 14:57   ` Arjan van de Ven
2006-10-30 15:44     ` Jens Axboe
2006-10-30 16:16       ` Arjan van de Ven
2006-10-30 16:26         ` Jens Axboe
2006-10-30 16:31           ` Arjan van de Ven
2006-10-30 17:52             ` Jens Axboe
2006-10-30 17:54               ` Ingo Molnar
2006-10-30 18:03                 ` Jens Axboe
2006-10-30 17:54               ` Mark Lord
2006-10-30 18:11                 ` Mark Lord
2006-10-30 18:16                   ` Jens Axboe
2006-10-30 18:30                     ` Mark Lord
2006-10-30 18:35                       ` Mark Lord
2006-10-30 18:45                       ` Arjan van de Ven
2006-10-30 18:56                         ` Jens Axboe
2006-10-30 18:52                       ` Jens Axboe [this message]
2006-10-30 18:59                         ` Mark Lord
2006-10-30 19:04                           ` Jens Axboe
2006-10-30 18:20                   ` Mark Lord
2006-10-30 17:56               ` Arjan van de Ven
2006-10-30 17:57                 ` Ingo Molnar

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=20061030185214.GH14055@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=arjan@infradead.org \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.