From 0e9c19c8369e9cac2b8fe601f50fcee54d38eea8 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Fri, 16 Jun 2017 16:25:58 +0200 Subject: [PATCH] mufs: fix syncing issue in write_dirent() --- source/fs/mufs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fs/mufs/dir.c b/source/fs/mufs/dir.c index 4441dd8..ca10d51 100644 --- a/source/fs/mufs/dir.c +++ b/source/fs/mufs/dir.c @@ -293,8 +293,8 @@ size_t write_dirent(struct mufs_tree *tree, if (mufs_tree_write(tree, &entry, va + offset, sizeof entry) == 0) return 0; - tree->file_size = max(tree->file_size, va + offset + sizeof entry + - entry.path_len); + va += offset + sizeof entry + entry.path_len; + tree->file_size = max(tree->file_size, va); if (tree->file_size <= va && mufs_sync_tree(tree) < 0) return 0;