mirror_zfs/module
Rob Norris b270663e8a
linux/zvol_os: fix crash with blk-mq on Linux 4.19
03987f71e3 (#16069) added a workaround to get the blk-mq hardware
context for older kernels that don't cache it in the struct request.
However, this workaround appears to be incomplete.

In 4.19, the rq data context is optional. If its not initialised, then
the cached rq->cpu will be -1, and so using it to index into mq_map
causes a crash.

Given that the upstream 4.19 is now in extended LTS and rarely seen,
RHEL8 4.18+ has long carried "modern" blk-mq support, and the cached
hardware context has been available since 5.1, I'm not going to huge
lengths to get queue selection correct for the very few people that are
likely to feel it. To that end, we simply call raw_smp_processor_id() to
get a valid CPU id and use that instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17597
2025-08-08 09:39:14 -07:00
..
avl Prefer VERIFY0P(n) over VERIFY(n == NULL) 2025-08-07 11:41:37 -07:00
icp Prefer VERIFY0(n) over VERIFY(n == 0) 2025-08-07 11:40:59 -07:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
nvpair Prefer VERIFY0P(n) over VERIFY3P(n, ==, NULL) 2025-08-07 11:41:42 -07:00
os linux/zvol_os: fix crash with blk-mq on Linux 4.19 2025-08-08 09:39:14 -07:00
unicode SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcommon Implement physical rewrites 2025-08-06 10:36:56 -07:00
zfs Prefer VERIFY0P(n) over VERIFY3P(n, ==, NULL) 2025-08-07 11:41:42 -07:00
zstd everywhere: misc unnecessary var init/update 2025-07-22 15:23:58 -07:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in Add TXG timestamp database 2025-08-06 10:31:21 -07:00
Makefile.bsd Add TXG timestamp database 2025-08-06 10:31:21 -07:00
Makefile.in objtool wrapper: use absolute path to call the wrapper 2025-07-14 15:10:02 -07:00