linux-stable/block
Li Nan 1c172ac7af blk-iocost: do not WARN if iocg was already offlined
[ Upstream commit 01bc4fda9e ]

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: Sasha Levin <sashal@kernel.org>
2024-05-17 12:02:20 +02:00
..
partitions block: Move checking GENHD_FL_NO_PART to bdev_add_partition() 2024-01-31 16:19:12 -08:00
Kconfig block: sed-opal: keyring support for SED keys 2023-08-22 11:10:26 -06:00
Kconfig.iosched block: Default to use cgroup support for BFQ 2023-01-30 09:42:42 -07:00
Makefile block: move the code to do early boot lookup of block devices to block/ 2023-06-05 10:57:40 -06:00
badblocks.c
bdev.c block: Provide bdev_open_* functions 2024-03-26 18:19:40 -04:00
bfq-cgroup.c blkcg: Restructure blkg_conf_prep() and friends 2023-04-13 06:46:49 -06:00
bfq-iosched.c SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
bfq-iosched.h block, bfq: remove BFQ_WEIGHT_LEGACY_DFL 2023-04-06 16:17:32 -06:00
bfq-wf2q.c block, bfq: inject I/O to underutilized actuators 2023-01-29 15:18:33 -07:00
bio-integrity.c bio-integrity: create multi-page bvecs in bio_integrity_add_page() 2023-08-09 16:05:35 -06:00
bio.c block: Fix page refcounts for unaligned buffers in __bio_release_pages() 2024-04-03 15:28:27 +02:00
blk-cgroup-fc-appid.c block: Replace all non-returning strlcpy with strscpy 2023-06-01 09:13:31 -06:00
blk-cgroup-rwstat.c Revert "blk-cgroup: pin the gendisk in struct blkcg_gq" 2023-02-14 14:24:09 -07:00
blk-cgroup-rwstat.h
blk-cgroup.c block: fix q->blkg_list corruption during disk rebind 2024-04-17 11:19:28 +02:00
blk-cgroup.h block: fix q->blkg_list corruption during disk rebind 2024-04-17 11:19:28 +02:00
blk-core.c block: fix q->blkg_list corruption during disk rebind 2024-04-17 11:19:28 +02:00
blk-crypto-fallback.c blk-crypto: dynamically allocate fallback profile 2023-08-18 15:00:39 -06:00
blk-crypto-internal.h blk-crypto: remove blk_crypto_insert_cloned_request() 2023-03-16 09:35:09 -06:00
blk-crypto-profile.c blk-crypto: use dynamic lock class for blk_crypto_profile::lock 2023-07-05 16:36:12 -06:00
blk-crypto-sysfs.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-crypto.c blk-crypto: make blk_crypto_evict_key() more robust 2023-03-16 09:35:09 -06:00
blk-flush.c blk-flush: reuse rq queuelist in flush state machine 2023-07-17 08:18:21 -06:00
blk-ia-ranges.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-integrity.c blk-integrity: register sysfs attributes on struct device 2023-04-26 18:22:50 -06:00
blk-ioc.c blk-ioc: fix recursive spin_lock/unlock_irq() in ioc_clear_queue() 2023-06-07 07:51:00 -06:00
blk-iocost.c blk-iocost: do not WARN if iocg was already offlined 2024-05-17 12:02:20 +02:00
blk-iolatency.c block: fix bad lockdep annotation in blk-iolatency 2023-08-10 17:24:53 -06:00
blk-ioprio.c blk-ioprio: Introduce promote-to-rt policy 2023-06-06 22:26:26 -06:00
blk-ioprio.h
blk-lib.c
blk-map.c block: Fix WARNING in _copy_from_iter 2024-03-01 13:34:49 +01:00
blk-merge.c blk-mq: release crypto keyslot before reporting I/O complete 2023-03-16 09:35:09 -06:00
blk-mq-cpumap.c blk-mq: include <linux/blk-mq.h> in block/blk-mq.h 2023-04-13 06:52:29 -06:00
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c blk-mq: fix potential io hang by wrong 'wake_batch' 2023-06-12 09:55:53 -06:00
blk-mq-debugfs.h
blk-mq-pci.c blk-mq: include <linux/blk-mq.h> in block/blk-mq.h 2023-04-13 06:52:29 -06:00
blk-mq-sched.c blk-mq: cleanup __blk_mq_sched_dispatch_requests 2023-04-13 06:57:18 -06:00
blk-mq-sched.h blk-mq: make sure elevator callbacks aren't called for passthrough request 2023-05-18 19:42:54 -06:00
blk-mq-sysfs.c blk-mq: include <linux/blk-mq.h> in block/blk-mq.h 2023-04-13 06:52:29 -06:00
blk-mq-tag.c for-6.5/block-2023-06-23 2023-06-26 12:47:20 -07:00
blk-mq-virtio.c blk-mq: include <linux/blk-mq.h> in block/blk-mq.h 2023-04-13 06:52:29 -06:00
blk-mq.c block: Do not force full zone append completion in req_bio_endio() 2024-04-03 15:28:56 +02:00
blk-mq.h blk-mq: fix potential io hang by wrong 'wake_batch' 2023-06-12 09:55:53 -06:00
blk-pm.c blk-mq: include <linux/blk-mq.h> in block/blk-mq.h 2023-04-13 06:52:29 -06:00
blk-pm.h
blk-rq-qos.c block: correct stale comment in rq_qos_wait 2023-09-18 14:15:28 -06:00
blk-rq-qos.h blk-iolatency: s/blkcg_rq_qos/iolat_rq_qos/ 2023-04-13 06:46:49 -06:00
blk-settings.c block: Clear zone limits for a non-zoned stacked queue 2024-04-03 15:28:20 +02:00
blk-stat.c block: prevent division by zero in blk_rq_stat_sum() 2024-04-13 13:07:37 +02:00
blk-stat.h
blk-sysfs.c block: don't allow enabling a cache on devices that don't support it 2023-07-17 08:18:18 -06:00
blk-throttle.c blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" 2023-12-20 17:01:55 +01:00
blk-throttle.h blk-throttle: print signed value 'carryover_bytes/ios' for user 2023-08-30 10:15:01 -06:00
blk-timeout.c
blk-wbt.c blk-wbt: Fix detection of dirty-throttled tasks 2024-02-23 09:25:16 +01:00
blk-wbt.h blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled 2023-06-26 09:53:36 -06:00
blk-zoned.c Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes 2023-07-11 12:15:15 -04:00
blk.h block: Add some exports for bcachefs 2023-08-14 15:40:42 -06:00
bounce.c
bsg-lib.c scsi: replace the fmode_t argument to ->sg_io_fn with a simple bool 2023-06-12 08:04:04 -06:00
bsg.c SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
disk-events.c block: fix kernel-doc for disk_force_media_change() 2023-09-26 00:43:34 -06:00
early-lookup.c block: don't return -EINVAL for not found names in devt_from_devname 2023-06-22 09:09:33 -06:00
elevator.c blk-mq: release scheduler resource when request completes 2023-08-19 07:47:17 -06:00
elevator.h blk-mq: pass a flags argument to elevator_type->insert_requests 2023-04-13 06:52:30 -06:00
fops.c block: Don't invalidate pagecache for invalid falloc modes 2023-10-11 15:53:17 -06:00
genhd.c block: add check of 'minors' and 'first_minor' in device_add_disk() 2024-01-25 15:35:27 -08:00
holder.c block: don't allow a disk link holder to itself 2022-11-16 15:19:56 -07:00
ioctl.c block: fix overflow in blk_ioctl_discard() 2024-05-17 12:02:13 +02:00
ioprio.c scsi: block: Improve ioprio value validity checks 2023-06-16 12:04:30 -04:00
kyber-iosched.c blk-mq: pass a flags argument to elevator_type->insert_requests 2023-04-13 06:52:30 -06:00
mq-deadline.c Revert "block/mq-deadline: use correct way to throttling write requests" 2024-04-03 15:28:33 +02:00
opal_proto.h block: sed-opal: handle empty atoms when parsing response 2024-03-26 18:19:12 -04:00
sed-opal.c block: sed-opal: handle empty atoms when parsing response 2024-03-26 18:19:12 -04:00
t10-pi.c