mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 00:33:30 +00:00
Workaround issue of Linux vdev_disk.c, (#16678)
in some cases not linearizing buffers with disk sector crossing a page boundary. It is fine for hardware, but somehow required by LUKS. It is not typical for ZFS to produce such buffers, but it may happen if 6KB block is compressed to 4KB, while still having 2KB alignment. Banning the 6KB buffers helps vdevs with ashifh=12. Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
This commit is contained in:
parent
152ae5c9bc
commit
aefc2da8a5
@ -187,6 +187,20 @@ zio_init(void)
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) && defined(_KERNEL)
|
||||||
|
/*
|
||||||
|
* Workaround issue of Linux vdev_disk.c, in some cases not
|
||||||
|
* linearizing buffers with disk sector crossing a page
|
||||||
|
* boundary. It is fine for hardware, but somehow required by
|
||||||
|
* LUKS. It is not typical for ZFS to produce such buffers, but
|
||||||
|
* it may happen if 6KB block is compressed to 4KB, while still
|
||||||
|
* having 2KB alignment. Banning the 6KB buffers helps vdevs
|
||||||
|
* with ashifh=12.
|
||||||
|
*/
|
||||||
|
if (size > PAGESIZE && !IS_P2ALIGNED(size, PAGESIZE))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (IS_P2ALIGNED(size, PAGESIZE))
|
if (IS_P2ALIGNED(size, PAGESIZE))
|
||||||
align = PAGESIZE;
|
align = PAGESIZE;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user