author: Zhang Yi <yi.zhang@huawei.com> 2021-06-19 17:37:00 +0800
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-14 17:06:52 +0200
commit: 30d5c741d111d66391be6ec79a09d590fd18af88
parent: 1c0d0e179994ccc7741433b58f2a2a828d1c45d2
Commit Summary:
Diffstat:
1 file changed, 5 insertions, 1 deletion
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index b098ac6a84f0..f5e5ac915bf7 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -637,9 +637,13 @@ void wbt_set_write_cache(struct request_queue *q, bool write_cache_on)
void wbt_enable_default(struct request_queue *q)
{
struct rq_qos *rqos = wbt_rq_qos(q);
+
/* Throttling already enabled? */
- if (rqos)
+ if (rqos) {
+ if (RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT)
+ RQWB(rqos)->enable_state = WBT_STATE_ON_DEFAULT;
return;
+ }
/* Queue not registered? Maybe shutting down... */
if (!blk_queue_registered(q))