summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-04-23 12:13:27 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-24 08:54:22 +0200
commit26a2ac009c2b07e1959c8864ca23486c1c485587 (patch)
treef3c0ae95578cd454f04dc48226b3b6f1ebd1d345 /block
parentblock: fix intermittent dm timeout based oops (diff)
downloadlinux-26a2ac009c2b07e1959c8864ca23486c1c485587.tar.xz
linux-26a2ac009c2b07e1959c8864ca23486c1c485587.zip
cfq-iosched: clear ->prio_trees[] on cfqd alloc
Not strictly needed, but we should make it clear that we init the rbtree roots here. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 7e13f04b5ed4..20a54b8e03e1 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2446,12 +2446,22 @@ static void cfq_exit_queue(struct elevator_queue *e)
static void *cfq_init_queue(struct request_queue *q)
{
struct cfq_data *cfqd;
+ int i;
cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node);
if (!cfqd)
return NULL;
cfqd->service_tree = CFQ_RB_ROOT;
+
+ /*
+ * Not strictly needed (since RB_ROOT just clears the node and we
+ * zeroed cfqd on alloc), but better be safe in case someone decides
+ * to add magic to the rb code
+ */
+ for (i = 0; i < CFQ_PRIO_LISTS; i++)
+ cfqd->prio_trees[i] = RB_ROOT;
+
INIT_LIST_HEAD(&cfqd->cic_list);
cfqd->queue = q;