Skip to content
  • Shaohua Li's avatar
    block: don't delay blk_run_queue_async · 3ec717b7
    Shaohua Li authored
    
    
    Let's check a scenario:
    1. blk_delay_queue(q, SCSI_QUEUE_DELAY);
    2. blk_run_queue_async();
    the second one will became a noop, because q->delay_work already has
    WORK_STRUCT_PENDING_BIT set, so the delayed work will still run after
    SCSI_QUEUE_DELAY. But blk_run_queue_async actually hopes the delayed
    work runs immediately.
    
    Fix this by doing a cancel on potentially pending delayed work
    before queuing an immediate run of the workqueue.
    
    Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
    Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
    3ec717b7