lkml.org 
[lkml]   [2013]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch] blk-mq: zero out ctx_map during initialization
Date
Hi,

ctx_map may contain random garbage, leading to (potentially chronic but
harmless) false positives in blk_mq_hctx_has_pending.

Note: I have not observed this in practice, just by code inspection.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 923e9e1..e9be5ed 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1197,7 +1197,7 @@ static int blk_mq_init_hw_queues(struct request_queue *q,
break;

num_maps = ALIGN(nr_cpu_ids, BITS_PER_LONG) / BITS_PER_LONG;
- hctx->ctx_map = kmalloc_node(num_maps * sizeof(unsigned long),
+ hctx->ctx_map = kzalloc_node(num_maps * sizeof(unsigned long),
GFP_KERNEL, node);
if (!hctx->ctx_map)
break;

\
 
 \ /
  Last update: 2013-10-21 20:21    [W:0.023 / U:2.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site