]> git.proxmox.com Git - mirror_zfs.git/commit
ZIL: Do not clone blocks from the future
authorAlexander Motin <mav@FreeBSD.org>
Tue, 5 Dec 2023 18:58:11 +0000 (13:58 -0500)
committerGitHub <noreply@github.com>
Tue, 5 Dec 2023 18:58:11 +0000 (10:58 -0800)
commit55b764e062b171874655c7ed51d6a45c2c243c0a
tree151043ce94575a2ad42b861f2c5061fbd1a19f12
parent014265f4e6fa32b0a990525a0967b52164a94752
ZIL: Do not clone blocks from the future

ZIL claim can not handle block pointers cloned from the future,
since they are not yet allocated at that point.  It may happen
either if the block was just written when it was cloned, or if
the pool was frozen or somehow else rewound on import.

Handle it from two sides: prevent cloning of blocks with physical
birth time from not yet synced or frozen TXG, and abort ZIL claim
if we still detect such blocks due to rewind or something else.

While there, assert that any cloned blocks we claim are really
allocated by calling metaslab_check_free().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15617
module/zfs/dmu.c
module/zfs/zil.c