diff options
author | Ryan Moeller <[email protected]> | 2022-11-01 15:19:32 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-11-01 12:49:14 -0700 |
commit | b27c7a1457e202435914403ddf6708cb6b53bfa0 (patch) | |
tree | 26a11056ee6f46bde7902fa8110e2f08b9a55586 /module | |
parent | 186e39f3362434263c9fbb36e5ee546096dcb29a (diff) |
zil: Relax assertion in zil_parse
Rather than panic debug builds when we fail to parse a whole ZIL, let's
instead improve the logging of errors and continue like in a release
build.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #14116
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/zil.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/module/zfs/zil.c b/module/zfs/zil.c index b9f177dae..11e05e477 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -397,8 +397,18 @@ zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, error = zil_read_log_block(zilog, decrypt, &blk, &next_blk, lrbuf, &end); - if (error != 0) + if (error != 0) { + if (claimed) { + char name[ZFS_MAX_DATASET_NAME_LEN]; + + dmu_objset_name(zilog->zl_os, name); + + cmn_err(CE_WARN, "ZFS read log block error %d, " + "dataset %s, seq 0x%llx\n", error, name, + (u_longlong_t)blk_seq); + } break; + } for (lrp = lrbuf; lrp < end; lrp += reclen) { lr_t *lr = (lr_t *)lrp; @@ -422,10 +432,6 @@ done: zilog->zl_parse_blk_count = blk_count; zilog->zl_parse_lr_count = lr_count; - ASSERT(!claimed || !(zh->zh_flags & ZIL_CLAIM_LR_SEQ_VALID) || - (max_blk_seq == claim_blk_seq && max_lr_seq == claim_lr_seq) || - (decrypt && error == EIO)); - zil_bp_tree_fini(zilog); zio_buf_free(lrbuf, SPA_OLD_MAXBLOCKSIZE); |