From: Jiufei Xue jiufei.xue@linux.alibaba.com
hulk inclusion category: feature bugzilla: 38688 CVE: NA
---------------------------
ioc_rqos_throttle() may called inside queue_lock, the lock should be unlocked before sleep.
Signed-off-by: Jiufei Xue jiufei.xue@linux.alibaba.com Reviewed-by: Joseph Qi joseph.qi@linux.alibaba.com
Conflict: block/blk-iocost.c Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- block/blk-iocost.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index b8d258e82073d..8aa5a79a8fa06 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1678,6 +1678,8 @@ static u64 calc_vtime_cost(struct bio *bio, struct ioc_gq *iocg, bool is_merge)
static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio, spinlock_t *lock) + __releases(lock) + __acquires(lock) { struct ioc *ioc = rqos_to_ioc(rqos); struct request_queue *q = rqos->q; @@ -1814,7 +1816,14 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio, set_current_state(TASK_UNINTERRUPTIBLE); if (wait.committed) break; - io_schedule(); + + if (lock) { + spin_unlock_irq(lock); + io_schedule(); + spin_lock_irq(lock); + } else { + io_schedule(); + } }
/* waker already committed us, proceed */