Expanded fuzz testing a bit, found/fixed an mid neighbor update bug

This bug was just overlooked in testing the mtree, fortunately dir
fuzzing found it. Though since this depends on neighboring mdirs, it
probably would have been found quicker with smaller block sizes. At the
moment I am only testing on NOR-liked geometry (4KiB blocks).

The fix is easy, we can use the difference in the mtree size to
determine if a split or drop happened in mdir commit, since at most one
of these can happen on any mdir commit.

Also added an explicit test for mid updates when splitting and dropping.
This commit is contained in:
Christopher Haster
2023-07-07 16:31:52 -05:00
parent 039bdf91b4
commit cb1319c9e6
4 changed files with 237 additions and 29 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ code = '''
// test that all of our metadata entries are still there
lfs_size_t i = 0;
for (lfs_ssize_t mid = (lfsr_mtree_isinlined(&lfs) ? -1 : 0);
mid < lfsr_mtree_weight(&lfs);
mid < (lfs_ssize_t)lfsr_mtree_weight(&lfs);
mid++) {
lfsr_mdir_t mdir;
lfsr_mtree_lookup(&lfs, mid, &mdir) => 0;