]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZIL: Replay blocks without next block pointer.
authorAlexander Motin <mav@FreeBSD.org>
Fri, 11 Aug 2023 16:04:44 +0000 (12:04 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2023 16:04:44 +0000 (09:04 -0700)
If we get next block allocation error during log write, we trigger
transaction commit.  But the block we have just completed is still
written and transactions it covers will be acknowledged normally.
If after that we ignore the block during replay just because it is
the last in the chain, we may not replay some transactions that we
have acknowledged as synced, that is not right.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15132

module/zfs/zil.c

index 6f04a7d4a7dfabe0622f8c23b4ceb5b6b005e724..567787a19b66e2b3ed7106e12ebc34f24c193dc9 100644 (file)
@@ -290,7 +290,7 @@ zil_read_log_block(zilog_t *zilog, boolean_t decrypt, const blkptr_t *bp,
                        char *lr = (char *)(zilc + 1);
 
                        if (memcmp(&cksum, &zilc->zc_next_blk.blk_cksum,
-                           sizeof (cksum)) || BP_IS_HOLE(&zilc->zc_next_blk) ||
+                           sizeof (cksum)) ||
                            zilc->zc_nused < sizeof (*zilc) ||
                            zilc->zc_nused > size) {
                                error = SET_ERROR(ECKSUM);
@@ -304,7 +304,7 @@ zil_read_log_block(zilog_t *zilog, boolean_t decrypt, const blkptr_t *bp,
                        zil_chain_t *zilc = (zil_chain_t *)(lr + size) - 1;
 
                        if (memcmp(&cksum, &zilc->zc_next_blk.blk_cksum,
-                           sizeof (cksum)) || BP_IS_HOLE(&zilc->zc_next_blk) ||
+                           sizeof (cksum)) ||
                            (zilc->zc_nused > (size - sizeof (*zilc)))) {
                                error = SET_ERROR(ECKSUM);
                        } else {