linux-kernelorg-stable/block
Julian Sun 8f5845e074 block: restore default wbt enablement
The commit 245618f8e4 ("block: protect wbt_lat_usec using
q->elevator_lock") protected wbt_enable_default() with
q->elevator_lock; however, it also placed wbt_enable_default()
before blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q);, resulting
in wbt failing to be enabled.

Moreover, the protection of wbt_enable_default() by q->elevator_lock
was removed in commit 78c271344b ("block: move wbt_enable_default()
out of queue freezing from sched ->exit()"), so we can directly fix
this issue by placing wbt_enable_default() after
blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q);.

Additionally, this issue also causes the inability to read the
wbt_lat_usec file, and the scenario is as follows:

root@q:/sys/block/sda/queue# cat wbt_lat_usec
cat: wbt_lat_usec: Invalid argument

root@q:/data00/sjc/linux# ls /sys/kernel/debug/block/sda/rqos
cannot access '/sys/kernel/debug/block/sda/rqos': No such file or directory

root@q:/data00/sjc/linux# find /sys -name wbt
/sys/kernel/debug/tracing/events/wbt

After testing with this patch, wbt can be enabled normally.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Cc: stable@vger.kernel.org
Fixes: 245618f8e4 ("block: protect wbt_lat_usec using q->elevator_lock")
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250812154257.57540-1-sunjunchao@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-08-13 05:33:48 -06:00
..
partitions
Kconfig
Kconfig.iosched
Makefile
badblocks.c
bdev.c
bfq-cgroup.c
bfq-iosched.c block, bfq: remove redundant __GFP_NOWARN 2025-08-11 07:59:22 -06:00
bfq-iosched.h lib/sbitmap: convert shallow_depth from one word to the whole sbitmap 2025-08-07 06:30:17 -06:00
bfq-wf2q.c
bio-integrity-auto.c block: rename tuple_size field in blk_integrity to metadata_size 2025-07-01 14:00:14 +02:00
bio-integrity.c block: don't merge different kinds of P2P transfers in a single bio 2025-06-30 15:50:32 -06:00
bio.c Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: remove redundant __GFP_NOWARN 2025-08-11 07:59:40 -06:00
blk-cgroup.h
blk-core.c
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c
blk-crypto.c
blk-flush.c
blk-ia-ranges.c
blk-integrity.c block: fix lbmd_guard_tag_type assignment in FS_IOC_GETLBMD_CAP 2025-07-23 14:55:51 +02:00
blk-ioc.c blk-ioc: don't hold queue_lock for ioc_lookup_icq() 2025-07-29 06:26:34 -06:00
blk-iocost.c
blk-iolatency.c
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c
blk-merge.c block: use plug request list tail for one-shot backmerge attempt 2025-06-11 08:48:46 -06:00
blk-mq-cpumap.c blk-mq: add number of queue calc helper 2025-07-01 10:24:19 -06:00
blk-mq-debugfs.c blk-mq-debugfs: use debugfs_get_aux() 2025-07-09 13:30:29 +02:00
blk-mq-debugfs.h
blk-mq-dma.c block: add scatterlist-less DMA mapping helpers 2025-06-30 15:50:32 -06:00
blk-mq-sched.c block: fix potential deadlock while running nr_hw_queue update 2025-07-30 06:20:51 -06:00
blk-mq-sched.h block: fix potential deadlock while running nr_hw_queue update 2025-07-30 06:20:51 -06:00
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq.c block: fix potential deadlock while running nr_hw_queue update 2025-07-30 06:20:51 -06:00
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c block: ensure discard_granularity is zero when discard is not supported 2025-07-31 15:01:35 -06:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: restore default wbt enablement 2025-08-13 05:33:48 -06:00
blk-throttle.c
blk-throttle.h
blk-timeout.c
blk-wbt.c blk-wbt: Eliminate ambiguity in the comments of struct rq_wb 2025-08-11 10:21:38 -06:00
blk-wbt.h
blk-zoned.c block: add trace messages to zone write plugging 2025-07-15 08:03:49 -06:00
blk.h block: fix kobject double initialization in add_disk 2025-08-11 08:00:49 -06:00
bsg-lib.c
bsg.c
disk-events.c
early-lookup.c
elevator.c block: fix potential deadlock while running nr_hw_queue update 2025-07-30 06:20:51 -06:00
elevator.h block: fix lockdep warning caused by lock dependency in elv_iosched_store 2025-07-30 06:20:51 -06:00
fops.c vfs-6.17-rc1.iomap 2025-07-28 16:09:03 -07:00
genhd.c block: fix kobject double initialization in add_disk 2025-08-11 08:00:49 -06:00
holder.c
ioctl.c vfs-6.17-rc1.integrity 2025-07-28 15:12:00 -07:00
ioprio.c
kyber-iosched.c lib/sbitmap: convert shallow_depth from one word to the whole sbitmap 2025-08-07 06:30:17 -06:00
mq-deadline.c lib/sbitmap: convert shallow_depth from one word to the whole sbitmap 2025-08-07 06:30:17 -06:00
opal_proto.h
sed-opal.c
t10-pi.c block: rename tuple_size field in blk_integrity to metadata_size 2025-07-01 14:00:14 +02:00