diff --git a/source/fs/mufs/tree.c b/source/fs/mufs/tree.c index 8585e95..61e3efc 100644 --- a/source/fs/mufs/tree.c +++ b/source/fs/mufs/tree.c @@ -35,6 +35,10 @@ static int mufs_do_lookup(struct mufs *fs, uint32_t *page, if (!table[index]) { if (!alloc || mufs_alloc_block(fs, &table[index]) < 0) return -1; + + if (flash_write(fs->dev, base << fs->dev->log2_block_size, data, + sizeof data) == 0) + return -1; } return mufs_do_lookup(fs, page, table[index], depth - 1, va, alloc);