]> 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)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 9 Jan 2024 00:11:39 +0000 (16:11 -0800)
commite11b3eb1c608754d98ecb91e2c3dc8d5700ec7a8
treeeb3c388623adf74998290ac75aa42a9dcb856643
parent3b8f2273622318461836dc27fa65e50126caff78
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