]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
[PATCH] CFQ: use irq safe locking in cfq_cic_link()
authorJens Axboe <jens.axboe@oracle.com>
Mon, 30 Oct 2006 18:07:48 +0000 (19:07 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 30 Oct 2006 18:21:58 +0000 (10:21 -0800)
If cfq_set_request() is called for a new process AND a non-fs io
request (so that __GFP_WAIT may not be set), cfq_cic_link() may
use spin_lock_irq() and spin_unlock_irq() with interrupts already
disabled.

Fix is to always use irq safe locking in cfq_cic_link()

Acked-By: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
block/cfq-iosched.c

index d3d76136f53adea6293244f7cd9a9aa07f24b4d0..5c3da894a56c8dc09c061de7a53085f88982f952 100644 (file)
@@ -1362,6 +1362,7 @@ cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc,
        struct rb_node **p;
        struct rb_node *parent;
        struct cfq_io_context *__cic;
+       unsigned long flags;
        void *k;
 
        cic->ioc = ioc;
@@ -1391,9 +1392,9 @@ restart:
        rb_link_node(&cic->rb_node, parent, p);
        rb_insert_color(&cic->rb_node, &ioc->cic_root);
 
-       spin_lock_irq(cfqd->queue->queue_lock);
+       spin_lock_irqsave(cfqd->queue->queue_lock, flags);
        list_add(&cic->queue_list, &cfqd->cic_list);
-       spin_unlock_irq(cfqd->queue->queue_lock);
+       spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
 }
 
 /*