diff options
| -rw-r--r-- | lwext4/ext4_extent_full.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lwext4/ext4_extent_full.c b/lwext4/ext4_extent_full.c index 2fe5016..cf98635 100644 --- a/lwext4/ext4_extent_full.c +++ b/lwext4/ext4_extent_full.c @@ -348,10 +348,9 @@ static void ext4_extent_block_csum_set(struct ext4_inode_ref *inode_ref, static int ext4_ext_dirty(struct ext4_inode_ref *inode_ref, struct ext4_extent_path *path) { - if (path->block.lb_id) { - ext4_extent_block_csum_set(inode_ref, path->header); + if (path->block.lb_id) path->block.dirty = true; - } else + else inode_ref->dirty = true; return EOK; @@ -371,6 +370,10 @@ static void ext4_ext_drop_refs(struct ext4_inode_ref *inode_ref, for (i = 0; i <= depth; i++, path++) { if (path->block.lb_id) { + if (path->block.dirty) + ext4_extent_block_csum_set(inode_ref, + path->header); + ext4_block_set(inode_ref->fs->bdev, &path->block); } } |
