mirror_zfs/module/os/linux/zfs
Rob Norris 1bf649cb0a vdev_disk: fix alignment check when buffer has non-zero starting offset
If a linear buffer spans multiple pages, and the first page has a
non-zero starting offset, the checker would not include the offset, and
so would think there was an alignment gap at the end of the first page,
rather than at the start.

That is, for a 16K buffer spread across five pages with an initial 512B
offset:

    [.XXXXXXX][XXXXXXXX][XXXXXXXX][XXXXXXXX][XXXXXXX.]

It would be interpreted as:

    [XXXXXXX.][XXXXXXXX]...

And be rejected as misaligned.

Since it's already a linear ABD, the "linearising" copy would just reuse
the buffer as-is, and the second check would failing, tripping the
VERIFY in vdev_disk_io_rw().

This commit fixes all this by including the offset in the check for
end-of-page alignment.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16076
2024-04-11 14:43:27 -07:00
..
abd_os.c abd_iter_page: don't use compound heads on Linux <4.5 2024-03-25 16:51:54 -07:00
arc_os.c Linux 6.7 compat: rework shrinker setup for heap allocations 2023-12-20 11:47:55 -08:00
mmp_os.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
policy.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
qat_compress.c Intel QAT 1.7 compatibility 2023-09-07 14:38:17 -07:00
qat_crypt.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
qat.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
spa_misc_os.c Selectable block allocators 2023-09-01 18:00:30 -07:00
trace.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
vdev_disk.c vdev_disk: fix alignment check when buffer has non-zero starting offset 2024-04-11 14:43:27 -07:00
vdev_file.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
vdev_label_os.c RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zfs_acl.c Fixed parameter passing error when calling zfs_acl_chmod 2024-02-26 11:41:44 -08:00
zfs_ctldir.c Linux 6.7 compat: use inode atime/mtime accessors 2023-12-20 11:47:40 -08:00
zfs_debug.c RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zfs_dir.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zfs_file_os.c Cleanup: Remove branches that always evaluate the same way 2022-11-03 10:47:48 -07:00
zfs_ioctl_os.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_sysfs.c Introduce kmem_scnprintf() 2022-10-29 13:05:11 -07:00
zfs_uio.c zvol: Remove broken blk-mq optimization 2023-10-24 14:37:52 -07:00
zfs_vfsops.c Linux 6.7 compat: handle superblock shrinker member change 2023-12-20 11:47:50 -08:00
zfs_vnops_os.c Fix corruption caused by mmap flushing problems 2024-03-25 14:56:49 -07:00
zfs_znode.c Linux 6.7 compat: use inode atime/mtime accessors 2023-12-20 11:47:40 -08:00
zio_crypt.c ZIL: Assert record sizes in different places 2023-11-28 13:35:14 -08:00
zpl_ctldir.c Linux 6.6 compat: generic_fillattr has a new u32 request_mask added at arg2 2023-09-21 18:38:40 -07:00
zpl_export.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zpl_file_range.c Linux 6.8 compat: use splice_copy_file_range() for fallback 2024-03-20 16:46:15 -07:00
zpl_file.c Fix corruption caused by mmap flushing problems 2024-03-25 14:56:49 -07:00
zpl_inode.c Linux 6.7 compat: use inode atime/mtime accessors 2023-12-20 11:47:40 -08:00
zpl_super.c Unify arc_prune_async() code 2023-10-30 16:56:04 -07:00
zpl_xattr.c Linux 6.6 compat: use inode_get/set_ctime*(...) 2023-09-21 18:38:31 -07:00
zvol_os.c zvol_os: fix compile with blk-mq on Linux 4.x 2024-04-08 11:38:49 -07:00