From 1259c170c43142e0fb9a57fd28667389726d9e82 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 4 Feb 2025 14:30:59 -0600 Subject: [PATCH] Adopted ckfetches+ckmeta fix in lfsr_file_ckmeta/ckdata This was missed in the previous fix for ckfetches+ckmeta (ab26437e). lfsr_file_ck should be more-or-less the same as lfsr_mtree_traverse, just limited to the current file. Code changes: code stack ctx default before: 36492 2608 640 default after: 36492 (+0.0%) 2608 (+0.0%) 640 (+0.0%) ckfetches before: 36724 2648 640 ckfetches after: 36716 (-0.0%) 2648 (+0.0%) 640 (+0.0%) --- lfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lfs.c b/lfs.c index a2d09b7b..932f120e 100644 --- a/lfs.c +++ b/lfs.c @@ -9371,9 +9371,9 @@ static int lfsr_mtree_traverse(lfs_t *lfs, lfsr_traversal_t *t, // validate btree nodes? // - // this may end up revalidating some btree nodes when ckfetches is - // enabled, but we need to revalidate cached btree nodes or we risk - // missing errors in ckmeta scans + // this may end up revalidating some btree nodes when ckfetches + // is enabled, but we need to revalidate cached btree nodes or + // we risk missing errors in ckmeta scans if ((lfsr_t_isckmeta(t->b.o.flags) || lfsr_t_isckdata(t->b.o.flags)) && tag == LFSR_TAG_BRANCH) { @@ -12739,12 +12739,12 @@ static int lfsr_file_ck(lfs_t *lfs, const lfsr_file_t *file, } // validate btree nodes? + // + // this may end up revalidating some btree nodes when ckfetches + // is enabled, but we need to revalidate cached btree nodes or + // we risk missing errors in ckmeta scans if ((lfsr_t_isckmeta(flags) || lfsr_t_isckdata(flags)) - // note ckfetches already validates btree nodes - && LFS_IFDEF_CKFETCHES( - !lfsr_m_isckfetches(lfs->flags), - true) && tag == LFSR_TAG_BRANCH) { lfsr_rbyd_t *rbyd = (lfsr_rbyd_t*)bptr.data.u.buffer; err = lfsr_rbyd_fetchck(lfs, rbyd,