From 3a1af3fe87460974159cde8599b9b092c1d11f6e Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 2 Feb 2025 19:28:56 -0600 Subject: [PATCH] Reverted bshrub-in-mdir assert in lfsr_mdir_commit epilogue Unfortunately, even with the mdir update order fixed, this assert still ends up violated by lfsr_rename. But only if lfsr_rename brings along open + unsynced shrubs. The problem is we copy these shrubs over with LFSR_TAG_MOVE, but don't update the related mdir until the epilogue in lfsr_rename. This avoids needing to parse LFSR_TAG_MOVE tags in the epilogue in lfsr_mdir_commit, but does mean we can't rely on this assert. Oh well, we at least have the bshrub-in-mdir assert in lfsr_mdir_commit's prologue. This at least gives us confidence that this constraint is usually held, even if it makes debugging a pain-in-the- ass. Found by our test_forphans_mv test, which is working as intended. No code changes. --- lfs.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lfs.c b/lfs.c index 5e6cd6e5..3b74453c 100644 --- a/lfs.c +++ b/lfs.c @@ -8687,11 +8687,6 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, // update any staged bshrubs for (lfsr_omdir_t *o = lfs->omdirs; o; o = o->next) { if (lfsr_o_isbshrub(o->flags)) { - // a bshrub outside of its mdir means something has gone - // horribly wrong - LFS_ASSERT(!lfsr_bshrub_isbshrub(&((lfsr_obshrub_t*)o)->bshrub_) - || ((lfsr_obshrub_t*)o)->bshrub_.u.bshrub.blocks[0] - == o->mdir.rbyd.blocks[0]); ((lfsr_obshrub_t*)o)->bshrub = ((lfsr_obshrub_t*)o)->bshrub_; } }