mirror_zfs/module
Jason King 2bba9fd479 Zpool can start allocating from metaslab before TRIMs have completed
When doing a manual TRIM on a zpool, the metaslab being TRIMmed is
potentially re-enabled before all queued TRIM zios for that metaslab
have completed. Since TRIM zios have the lowest priority, it is 
possible to get into a situation where allocations occur from the 
just re-enabled metaslab and cut ahead of queued TRIMs to the same 
metaslab.  If the ranges overlap, this will cause corruption.

We were able to trigger this pretty consistently with a small single 
top-level vdev zpool (i.e. small number of metaslabs) with heavy 
parallel write activity while performing a manual TRIM against a 
somewhat 'slow' device (so TRIMs took a bit of time to complete). 
With the patch, we've not been able to recreate it since. It was on 
illumos, but inspection of the OpenZFS trim code looks like the 
relevant pieces are largely unchanged and so it appears it would be 
vulnerable to the same issue.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jason King <jking@racktopsystems.com>
Illumos-issue: https://www.illumos.org/issues/15939
Closes #15395
2023-10-12 11:05:20 -07:00
..
avl Suppress Clang Static Analyzer false positive in the AVL tree code. 2023-03-08 13:51:21 -08:00
icp Add BTI landing pads to the AArch64 SHA2 assembly 2023-10-04 12:36:21 -07:00
lua Add loongarch64 support 2023-04-25 16:05:45 -07:00
nvpair nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
os Ensure we call fput when cloning fails due to different devices. 2023-10-10 19:19:09 -07:00
unicode Illumos #15286: do_composition() needs sign awareness 2023-01-05 11:16:21 -08:00
zcommon set autotrim default to 'off' everywhere 2023-07-21 16:35:12 -07:00
zfs Zpool can start allocating from metaslab before TRIMs have completed 2023-10-12 11:05:20 -07:00
zstd Resolve WS-2021-0184 vulnerability in zstd 2023-02-02 15:12:51 -08:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in linux: implement filesystem-side copy/clone functions 2023-07-26 08:46:58 -07:00
Makefile.bsd Finally drop long disabled vdev cache. 2023-06-09 12:40:55 -07:00
Makefile.in check-zstd-symbols: also ignore __pfx_ symbols 2023-09-19 08:52:06 -07:00