linux-stable/block
Li Nan 56a9d07f42 blk-iocost: do not WARN if iocg was already offlined
commit 01bc4fda9e upstream.

In iocg_pay_debt(), warn is triggered if 'active_list' is empty, which
is intended to confirm iocg is active when it has debt. However, warn
can be triggered during a blkcg or disk removal, if iocg_waitq_timer_fn()
is run at that time:

  WARNING: CPU: 0 PID: 2344971 at block/blk-iocost.c:1402 iocg_pay_debt+0x14c/0x190
  Call trace:
  iocg_pay_debt+0x14c/0x190
  iocg_kick_waitq+0x438/0x4c0
  iocg_waitq_timer_fn+0xd8/0x130
  __run_hrtimer+0x144/0x45c
  __hrtimer_run_queues+0x16c/0x244
  hrtimer_interrupt+0x2cc/0x7b0

The warn in this situation is meaningless. Since this iocg is being
removed, the state of the 'active_list' is irrelevant, and 'waitq_timer'
is canceled after removing 'active_list' in ioc_pd_free(), which ensures
iocg is freed after iocg_waitq_timer_fn() returns.

Therefore, add the check if iocg was already offlined to avoid warn
when removing a blkcg or disk.

Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20240419093257.3004211-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-02 07:41:07 +02:00
..
partitions block: fix conversion of GPT partition name to 7-bit 2025-03-13 12:47:37 +01:00
badblocks.c
bfq-cgroup.c
bfq-iosched.c block, bfq: fix procress reference leakage for bfqq in merge chain 2024-11-08 16:21:58 +01:00
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c block: initialize integrity buffer to zero before writing it to media 2024-09-12 11:06:41 +02:00
bio.c block: fix 'kmem_cache of name 'bio-108' already exists' 2025-04-10 14:30:51 +02:00
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: support to track if policy is online 2025-05-02 07:41:07 +02:00
blk-core.c
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto.c
blk-exec.c
blk-flush.c
blk-integrity.c block: remove the blk_flush_integrity call in blk_integrity_unregister 2024-09-12 11:06:41 +02:00
blk-ioc.c
blk-iocost.c blk-iocost: do not WARN if iocg was already offlined 2025-05-02 07:41:07 +02:00
blk-iolatency.c
blk-lib.c
blk-map.c
blk-merge.c
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c block: fix ordering between checking BLK_MQ_S_STOPPED request adding 2024-12-14 19:48:11 +01:00
blk-mq.h block: fix ordering between checking BLK_MQ_S_STOPPED request adding 2024-12-14 19:48:11 +01:00
blk-pm.c
blk-pm.h
blk-rq-qos.c blk-rq-qos: fix crash on rq_qos_wait vs. rq_qos_wake_function race 2024-10-22 15:39:26 +02:00
blk-rq-qos.h
blk-settings.c block: Clear zone limits for a non-zoned stacked queue 2024-04-13 12:58:07 +02:00
blk-stat.c block: prevent division by zero in blk_rq_stat_sum() 2024-04-13 12:59:49 +02:00
blk-stat.h
blk-sysfs.c block: introduce zone_write_granularity limit 2024-04-13 12:58:07 +02:00
blk-throttle.c
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c
blk.h
bounce.c
bsg-lib.c
bsg.c
cmdline-parser.c
elevator.c
genhd.c block: remove the update_bdev parameter to set_capacity_revalidate_and_notify 2025-02-01 18:22:24 +01:00
ioctl.c block/ioctl: prefer different overflow check 2024-07-05 09:12:33 +02:00
ioprio.c
Kconfig
Kconfig.iosched
keyslot-manager.c
kyber-iosched.c
Makefile
mq-deadline.c
opal_proto.h block: sed-opal: handle empty atoms when parsing response 2024-03-26 18:21:46 -04:00
scsi_ioctl.c
sed-opal.c block: sed-opal: handle empty atoms when parsing response 2024-03-26 18:21:46 -04:00
t10-pi.c