Skip to content

Commit 76a8040

Browse files
zhangyi089axboe
authored andcommitted
blk-wbt: make sure throttle is enabled properly
After commit a790504 ("blk-rq-qos: refactor out common elements of blk-wbt"), if throttle was disabled by wbt_disable_default(), we could not enable again, fix this by set enable_state back to WBT_STATE_ON_DEFAULT. Fixes: a790504 ("blk-rq-qos: refactor out common elements of blk-wbt") Signed-off-by: Zhang Yi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 1d0903d commit 76a8040

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

block/blk-wbt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,13 @@ void wbt_set_write_cache(struct request_queue *q, bool write_cache_on)
636636
void wbt_enable_default(struct request_queue *q)
637637
{
638638
struct rq_qos *rqos = wbt_rq_qos(q);
639+
639640
/* Throttling already enabled? */
640-
if (rqos)
641+
if (rqos) {
642+
if (RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT)
643+
RQWB(rqos)->enable_state = WBT_STATE_ON_DEFAULT;
641644
return;
645+
}
642646

643647
/* Queue not registered? Maybe shutting down... */
644648
if (!blk_queue_registered(q))

0 commit comments

Comments
 (0)