mirror_zfs/module/os/linux/zfs
Rob Norris a49c957299 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-12 17:24:11 -07:00
..
abd_os.c Export correct symbols for Lustre Direct I/O 2025-05-28 16:00:28 -07:00
arc_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
mmp_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
policy.c cred: properly pass and test creds on other threads (#17273) 2025-05-28 16:00:28 -07:00
qat_compress.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
qat_crypt.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
qat.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
spa_misc_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
trace.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
vdev_disk.c tunables: fix spelling 2025-06-17 10:50:26 -07:00
vdev_label_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
vdev_raidz.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zfs_acl.c dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_* (#17143) 2025-04-16 09:59:45 -07:00
zfs_ctldir.c Linux: sync: remove async/sync accounting 2025-08-12 17:23:39 -07:00
zfs_debug.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zfs_dir.c dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_* (#17143) 2025-04-16 09:59:45 -07:00
zfs_file_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zfs_ioctl_os.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zfs_racct.c SPDX: license tags: BSD-2-Clause 2025-04-16 09:59:44 -07:00
zfs_sysfs.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zfs_uio.c linux/uio: remove "skip" offset for UIO_ITER 2025-05-28 16:00:28 -07:00
zfs_vfsops.c enforce arc_dnode_limit 2025-08-07 12:11:34 -04:00
zfs_vnops_os.c Linux: zfs_putpage: document (and fix!) confusing sync/commit modes 2025-08-12 17:23:46 -07:00
zfs_znode_os.c Linux: sync: remove async/sync accounting 2025-08-12 17:23:39 -07:00
zio_crypt.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zpl_ctldir.c Linux 6.15: mkdir now returns struct dentry * 2025-05-28 16:00:28 -07:00
zpl_export.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zpl_file_range.c ioctl: remove FICLONE/FICLONERANGE/FIDEDUPERANGE compat 2025-06-17 10:50:27 -07:00
zpl_file.c Linux: sync: remove async/sync accounting 2025-08-12 17:23:39 -07:00
zpl_inode.c Linux 6.15: mkdir now returns struct dentry * 2025-05-28 16:00:28 -07:00
zpl_super.c Define sops->free_inode() to prevent use-after-free during lookup 2025-08-05 12:30:23 -04:00
zpl_xattr.c SPDX: license tags: CDDL-1.0 2025-04-16 09:59:44 -07:00
zvol_os.c linux/zvol_os: fix crash with blk-mq on Linux 4.19 2025-08-12 17:24:11 -07:00