blk-mq: Use proper cpumask iterator
BugLink: http://bugs.launchpad.net/bugs/1572630 queue_for_each_ctx() iterates over per_cpu variables under the assumption that the possible cpu mask cannot have holes. That's wrong as all cpumasks can have holes. In case there are holes the iteration ends up accessing uninitialized memory and crashing as a result. Replace the macro by a proper for_each_possible_cpu() loop and drop the unused macro blk_ctx_sum() which references queue_for_each_ctx(). Reported-by: Xiong Zhou <jencce.kernel@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jens Axboe <axboe@fb.com> (back ported from commit 897bb0c7) Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Conflicts: block/blk-mq-sysfs.c Acked-by: Chris J Arges <chris.j.arges@canonical.com>
Showing
Please register or sign in to comment