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.
This commit is contained in:
@@ -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_;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user