From a3e9469cb2de68a411222bb04de0dbb8079324d2 Mon Sep 17 00:00:00 2001 From: deukyeon Date: Mon, 24 Jul 2023 18:02:50 -0700 Subject: [PATCH] Set the addresses of log for super block if it is. (#582) Co-authored-by: Alex Conway --- src/trunk.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/trunk.c b/src/trunk.c index 0fecad5ce..fc566278e 100644 --- a/src/trunk.c +++ b/src/trunk.c @@ -931,8 +931,13 @@ trunk_set_super_block(trunk_handle *spl, super->root_addr = spl->root_addr; super->meta_tail = mini_meta_tail(&spl->mini); if (spl->cfg.use_log) { - super->log_addr = log_addr(spl->log); - super->log_meta_addr = log_meta_addr(spl->log); + if (spl->log) { + super->log_addr = log_addr(spl->log); + super->log_meta_addr = log_meta_addr(spl->log); + } else { + super->log_addr = 0; + super->log_meta_addr = 0; + } } super->timestamp = platform_get_real_time(); super->checkpointed = is_checkpoint;