diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2006-10-30 13:07:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-30 13:21:58 -0500 |
commit | 0261d6886eb5822867a5310dc1e4479b940a1942 (patch) | |
tree | e1abc43a23dce3a2250eed8732e68fd6e8a92053 /block/cfq-iosched.c | |
parent | 209ad53bc19667a128d9c51beba873a5c62bff6e (diff) |
[PATCH] CFQ: use irq safe locking in cfq_cic_link()
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>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index d3d76136f53a..5c3da894a56c 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1362,6 +1362,7 @@ cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc, | |||
1362 | struct rb_node **p; | 1362 | struct rb_node **p; |
1363 | struct rb_node *parent; | 1363 | struct rb_node *parent; |
1364 | struct cfq_io_context *__cic; | 1364 | struct cfq_io_context *__cic; |
1365 | unsigned long flags; | ||
1365 | void *k; | 1366 | void *k; |
1366 | 1367 | ||
1367 | cic->ioc = ioc; | 1368 | cic->ioc = ioc; |
@@ -1391,9 +1392,9 @@ restart: | |||
1391 | rb_link_node(&cic->rb_node, parent, p); | 1392 | rb_link_node(&cic->rb_node, parent, p); |
1392 | rb_insert_color(&cic->rb_node, &ioc->cic_root); | 1393 | rb_insert_color(&cic->rb_node, &ioc->cic_root); |
1393 | 1394 | ||
1394 | spin_lock_irq(cfqd->queue->queue_lock); | 1395 | spin_lock_irqsave(cfqd->queue->queue_lock, flags); |
1395 | list_add(&cic->queue_list, &cfqd->cic_list); | 1396 | list_add(&cic->queue_list, &cfqd->cic_list); |
1396 | spin_unlock_irq(cfqd->queue->queue_lock); | 1397 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); |
1397 | } | 1398 | } |
1398 | 1399 | ||
1399 | /* | 1400 | /* |