Go to file
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
arch x86/fpu: Delay instruction pointer fixup until after warning 2025-08-28 16:22:53 +02:00
block block: don't call rq_qos_ops->done_bio if the bio isn't tracked 2025-08-28 16:22:54 +02:00
certs
crypto crypto: xts - Only add ecb if it is not already there 2025-06-27 11:04:01 +01:00
Documentation Documentation: ACPI: Fix parent device references 2025-08-28 16:22:39 +02:00
drivers ptp: Fix possible memory leak in ptp_clock_register() 2025-08-28 16:22:54 +02:00
fs smb: client: fix use-after-free in crypt_message when using async crypto 2025-08-28 16:22:53 +02:00
include block: Make REQ_OP_ZONE_FINISH a write operation 2025-08-28 16:22:54 +02:00
init bpf: Clean up sockmap related Kconfigs 2025-06-27 11:04:09 +01:00
io_uring
ipc ipc: fix to protect IPCS lookups using RCU 2025-06-27 11:04:14 +01:00
kernel tracing: Add down_write(trace_event_sem) when adding trace event 2025-08-28 16:22:53 +02:00
lib lib: test_objagg: Set error message in check_expect_hints_stats() 2025-07-17 18:27:47 +02:00
LICENSES
mm mm/zsmalloc: do not pass __GFP_MOVABLE if CONFIG_COMPACTION=n 2025-08-28 16:22:53 +02:00
net sch_htb: make htb_deactivate() idempotent 2025-08-28 16:22:51 +02:00
samples samples: mei: Fix building on musl libc 2025-08-28 16:22:32 +02:00
scripts kconfig: lxdialog: fix 'space' to (de)select options 2025-08-28 16:22:47 +02:00
security securityfs: don't pin dentries twice, once is enough... 2025-08-28 16:22:40 +02:00
sound ALSA: scarlett2: Add retry on -EPROTO from scarlett2_usb_tx() 2025-08-28 16:22:53 +02:00
tools selftests: mptcp: connect: also cover alt modes 2025-08-28 16:22:52 +02:00
usr kbuild: hdrcheck: fix cross build with clang 2025-06-27 11:04:11 +01:00
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS platform: Add Surface platform directory 2025-06-27 11:04:19 +01:00
Makefile kbuild: userprogs: use correct linker when mixing clang and GNU ld 2025-08-28 16:22:52 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.