From 72122696756d035c00acb131840716d421535ac1 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Fri, 9 Jun 2017 13:18:09 +0200 Subject: [PATCH] mufs: write tree updates to disk --- source/fs/mufs/tree.c | 4 ++++ 1 file changed, 4 insertions(+) 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);