lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061030185214.GH14055@kernel.dk>
Date:	Mon, 30 Oct 2006 19:52:14 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Mark Lord <liml@....ca>
Cc:	Arjan van de Ven <arjan@...radead.org>,
	IDE/ATA development list <linux-ide@...r.kernel.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>, mingo@...e.hu
Subject: Re: 2.6.19-rc3-git7: scsi_device_unbusy: inconsistent lock state

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ