linux-stable/block
Tao Su 2793a9cc0f block: Skip destroyed blkg when restart in blkg_destroy_all()
[ Upstream commit 8176080d59 ]

Kernel hang in blkg_destroy_all() when total blkg greater than
BLKG_DESTROY_BATCH_SIZE, because of not removing destroyed blkg in
blkg_list. So the size of blkg_list is same after destroying a
batch of blkg, and the infinite 'restart' occurs.

Since blkg should stay on the queue list until blkg_free_workfn(),
skip destroyed blkg when restart a new round, which will solve this
kernel hang issue and satisfy the previous will to restart.

Reported-by: Xiangfei Ma <xiangfeix.ma@intel.com>
Tested-by: Xiangfei Ma <xiangfeix.ma@intel.com>
Tested-by: Farrah Chen <farrah.chen@intel.com>
Signed-off-by: Tao Su <tao1.su@linux.intel.com>
Fixes: f1c006f1c6 ("blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()")
Suggested-and-reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20230428045149.1310073-1-tao1.su@linux.intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 13:58:45 +02:00
..
partitions block: don't add partitions if GD_SUPPRESS_PART_SCAN is set 2022-09-03 11:29:03 -06:00
Kconfig block: Remove "select SRCU" 2023-01-05 08:50:10 -07:00
Kconfig.iosched
Makefile blk-cgroup: move blkcg_{get,set}_fc_appid out of line 2022-05-02 14:06:20 -06:00
badblocks.c block/badblocks: Remove redundant assignments 2022-04-23 07:15:26 -06:00
bdev.c block: bdev & blktrace: use consistent function doc. notation 2022-12-01 09:16:46 -07:00
bfq-cgroup.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-01-29 18:57:01 -07:00
bfq-iosched.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-01-29 18:57:01 -07:00
bfq-iosched.h block, bfq: switch 'bfqg->ref' to use atomic refcount apis 2023-01-15 20:53:27 -07:00
bfq-wf2q.c block, bfq: only do counting of pending-request for BFQ_GROUP_IOSCHED 2022-12-15 05:11:59 -07:00
bio-integrity.c block: bio-integrity: Copy flags when bio_integrity_payload is cloned 2023-03-10 09:27:57 +01:00
bio.c block: clear bio->bi_bdev when putting a bio back in the cache 2023-03-10 09:29:22 +01:00
blk-cgroup-fc-appid.c cgroup: Homogenize cgroup_get_from_id() return value 2022-08-26 10:57:41 -10:00
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h block: Use the new blk_opf_t type 2022-07-14 12:14:30 -06:00
blk-cgroup.c block: Skip destroyed blkg when restart in blkg_destroy_all() 2023-05-17 13:58:45 +02:00
blk-cgroup.h blk-cgroup: Optimize blkcg_rstat_flush() 2022-11-16 16:58:44 -07:00
blk-core.c block: count 'ios' and 'sectors' when io is done for bio-based device 2023-03-22 13:37:50 +01:00
blk-crypto-fallback.c treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
blk-crypto-internal.h blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:10:50 +09:00
blk-crypto-profile.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:10:50 +09:00
blk-crypto-sysfs.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-crypto.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:10:50 +09:00
blk-flush.c block: change request end_io handler to pass back a return value 2022-09-30 07:49:09 -06:00
blk-ia-ranges.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-integrity.c
blk-ioc.c block: fix default IO priority handling again 2022-06-27 06:29:12 -06:00
blk-iocost.c blk-iocost: avoid 64-bit division in ioc_timer_fn 2023-05-11 23:11:35 +09:00
blk-iolatency.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
blk-ioprio.c blk-ioprio: pass a gendisk to blk_ioprio_init and blk_ioprio_exit 2022-09-26 19:09:31 -06:00
blk-ioprio.h blk-ioprio: pass a gendisk to blk_ioprio_init and blk_ioprio_exit 2022-09-26 19:09:31 -06:00
blk-lib.c blk-lib: fix blkdev_issue_secure_erase 2022-09-15 00:25:17 -06:00
blk-map.c block: set FOLL_PCI_P2PDMA in bio_map_user_iov() 2022-11-09 11:29:21 -07:00
blk-merge.c blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:10:50 +09:00
blk-mq-cpumap.c block: Change the return type of blk_mq_map_queues() into void 2022-08-22 10:07:53 -06:00
blk-mq-debugfs-zoned.c block: move zone related fields to struct gendisk 2022-07-06 06:46:26 -06:00
blk-mq-debugfs.c for-6.1/block-2022-10-03 2022-10-07 09:19:14 -07:00
blk-mq-debugfs.h block: remove per-disk debugfs files in blk_unregister_queue 2022-06-17 07:31:05 -06:00
blk-mq-pci.c block: Change the return type of blk_mq_map_queues() into void 2022-08-22 10:07:53 -06:00
blk-mq-rdma.c block: Change the return type of blk_mq_map_queues() into void 2022-08-22 10:07:53 -06:00
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-03-10 09:27:55 +01:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2022-11-25 06:34:03 -07:00
blk-mq-tag.c sbitmap: fix batched wait_cnt accounting 2022-09-12 00:10:34 -06:00
blk-mq-tag.h blk-mq: blk_mq_tag_busy is no need to return a value 2022-06-27 06:29:12 -06:00
blk-mq-virtio.c block: Change the return type of blk_mq_map_queues() into void 2022-08-22 10:07:53 -06:00
blk-mq.c blk-mq: don't plug for head insertions in blk_execute_rq_nowait 2023-05-11 23:11:14 +09:00
blk-mq.h blk-mq: fix "bad unlock balance detected" on q->srcu in __blk_mq_run_dispatch_ops 2023-03-22 13:37:48 +01:00
blk-pm.c
blk-pm.h
blk-rq-qos.c block/rq_qos: Use atomic_try_cmpxchg in atomic_inc_below 2022-07-12 14:38:52 -06:00
blk-rq-qos.h block/blk-rq-qos: delete useless enmu RQ_QOS_IOPRIO 2022-09-21 19:50:53 -06:00
blk-settings.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
blk-stat.c blk-stat: fix QUEUE_FLAG_STATS clear 2023-05-11 23:10:50 +09:00
blk-stat.h
blk-sysfs.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
blk-throttle.c blk-throttle: Use more suitable time_after check for update of slice_start 2022-12-05 13:45:31 -07:00
blk-throttle.h blk-throttle: pass a gendisk to blk_throtl_cancel_bios 2022-09-26 19:17:28 -06:00
blk-timeout.c
blk-wbt.c blk-wbt: don't enable throttling if default elevator is bfq 2022-10-23 18:59:17 -06:00
blk-wbt.h blk-wbt: don't show valid wbt_lat_usec in sysfs while wbt is disabled 2022-10-23 18:59:17 -06:00
blk-zoned.c block: adapt blk_mq_plug() to not plug for writes that require a zone lock 2022-09-29 07:45:47 -06:00
blk.h block: Revert "block: Do not reread partition table on exclusively open device" 2023-03-17 08:57:50 +01:00
bounce.c block: change the blk_queue_bounce calling convention 2022-08-02 17:22:54 -06:00
bsg-lib.c blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue 2022-10-25 08:25:10 -06:00
bsg.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
disk-events.c block: remove genhd.h 2022-02-02 07:49:59 -07:00
elevator.c block: untangle request_queue refcounting from sysfs 2022-11-30 11:09:00 -07:00
elevator.h block: add proper helpers for elevator_type module refcount management 2022-10-23 18:59:17 -06:00
fops.c block: don't allow multiple bios for IOCB_NOWAIT issue 2023-03-10 09:29:22 +01:00
genhd.c block: don't set GD_NEED_PART_SCAN if scan partition failed 2023-04-13 17:02:54 +02: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 scan partition for exclusively open device again 2023-03-17 08:57:50 +01:00
ioprio.c block: Fix handling of tasks without ioprio in ioprio_get(2) 2022-06-27 06:29:12 -06:00
kyber-iosched.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
mq-deadline.c block: mq-deadline: Rename deadline_is_seq_writes() 2022-11-28 19:27:45 -07:00
opal_proto.h block: sed-opal: Add ioctl to return device status 2022-08-22 07:52:51 -06:00
sed-opal.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
t10-pi.c block: add pi for extended integrity 2022-03-07 12:48:35 -07:00