linux-yocto/block
Ming Lei db60edbfff block: don't call rq_qos_ops->done_bio if the bio isn't tracked
commit a647a524a4 upstream.

rq_qos framework is only applied on request based driver, so:

1) rq_qos_done_bio() needn't to be called for bio based driver

2) rq_qos_done_bio() needn't to be called for bio which isn't tracked,
such as bios ended from error handling code.

Especially in bio_endio():

1) request queue is referred via bio->bi_bdev->bd_disk->queue, which
may be gone since request queue refcount may not be held in above two
cases

2) q->rq_qos may be freed in blk_cleanup_queue() when calling into
__rq_qos_done_bio()

Fix the potential kernel panic by not calling rq_qos_ops->done_bio if
the bio isn't tracked. This way is safe because both ioc_rqos_done_bio()
and blkcg_iolatency_done_bio() are nop if the bio isn't tracked.

Reported-by: Yu Kuai <yukuai3@huawei.com>
Cc: tj@kernel.org
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20210924110704.1541818-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ Shivani: Modified to apply on 5.10.y ]
Signed-off-by: Shivani Agarwal <shivani.agarwal@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:22:54 +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 block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-03-17 08:45:14 +01:00
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: Get rid of __bio_blkcg() usage 2022-06-09 10:21:31 +02:00
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: don't call rq_qos_ops->done_bio if the bio isn't tracked 2025-08-28 16:22:54 +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 block: fix use-after-free of q->q_usage_counter 2023-10-10 21:53:36 +02:00
blk-crypto-fallback.c
blk-crypto-internal.h blk-mq: release crypto keyslot before reporting I/O complete 2023-05-17 11:47:32 +02:00
blk-crypto.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-17 11:47:32 +02:00
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-iolatency: Fix inflight count imbalances and IO hangs on offline 2022-06-09 10:21:29 +02:00
blk-lib.c
blk-map.c
blk-merge.c blk-mq: release crypto keyslot before reporting I/O complete 2023-05-17 11:47:32 +02:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created 2022-08-21 15:15:35 +02:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-03-11 16:39:15 +01:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2023-01-14 10:16:19 +01:00
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: avoid possible overflow for chunk_sectors check in blk_stack_limits() 2025-08-28 16:22:47 +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-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" 2023-12-20 15:44:31 +01:00
blk-timeout.c
blk-wbt.c blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() 2022-10-30 09:41:19 +01:00
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 blk-crypto: make blk_crypto_evict_key() more robust 2023-05-17 11:47:32 +02:00
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