]> git.baikalelectronics.ru Git - kernel.git/commit
blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init()
authorYu Kuai <yukuai3@huawei.com>
Sun, 9 Oct 2022 10:10:38 +0000 (18:10 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 9 Oct 2022 13:48:16 +0000 (07:48 -0600)
commit077e2a5090c1cf86b4e99696bff3b5fb30caf1d9
tree220f53e10904517add91c8f4dcff0c1c663d8839
parent0cda9f22dbe7ec53924f7b36f23224b247c259c3
blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init()

commit 87cd96ddfd7f ("blk-wbt: call rq_qos_add() after wb_normal is
initialized") moves wbt_set_write_cache() before rq_qos_add(), which
is wrong because wbt_rq_qos() is still NULL.

Fix the problem by removing wbt_set_write_cache() and setting 'rwb->wc'
directly. Noted that this patch also remove the redundant setting of
'rab->wc'.

Fixes: 87cd96ddfd7f ("blk-wbt: call rq_qos_add() after wb_normal is initialized")
Reported-by: kernel test robot <yujie.liu@intel.com>
Link: https://lore.kernel.org/r/202210081045.77ddf59b-yujie.liu@intel.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20221009101038.1692875-1-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-wbt.c