Commit 18e44529 authored by Yu Kuai's avatar Yu Kuai Committed by Li Lingfeng
Browse files

blk-wbt: don't show valid wbt_lat_usec in sysfs while wbt is disabled

mainline inclusion
from mainline-v6.2-rc1
commit 3642ef4d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6Z1UG
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.3-rc7&id=3642ef4d95699193c4a461862382e643ae3720f0



----------------------------------------

Currently, if wbt is initialized and then disabled by
wbt_disable_default(), sysfs will still show valid wbt_lat_usec, which
will confuse users that wbt is still enabled.

This patch shows wbt_lat_usec as zero if it's disabled.

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Reported-and-tested-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221019121518.3865235-5-yukuai1@huaweicloud.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
parent 52ad37a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment