blk-mq: make sure that correct hctx->dispatch_from is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Author: huhai <huhai@xxxxxxxxxx>
Date:   Fri May 18 17:09:56 2018 +0800

    blk-mq: make sure that correct hctx->dispatch_from is set
    
    When the number of hardware queues is changed, the drivers will call
    blk_mq_update_nr_hw_queues() to remap hardware queues, and then
    the ctx mapped on hctx will also change, but the current code forgets to
    make sure that correct hctx->dispatch_from is set, and hctx->dispatch_from
    may point to a ctx that does not belong to the current hctx.
    
    Signed-off-by: huhai <huhai@xxxxxxxxxx>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 2545081..55d8a3d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2214,6 +2214,8 @@ static void blk_mq_map_swqueue(struct request_queue *q)
                hctx->tags = set->tags[i];
                WARN_ON(!hctx->tags);
 
+               hctx->dispatch_from = NULL;
+
                /*
                 * Set the map size to the number of mapped software queues.
                 * This is more accurate and more efficient than looping




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux