shithub: lwext4

Download patch

ref: faa76ad23b0ce89d3f0f6bb53740fb47d42ca9f3
parent: 9b38aef3133341e68a40756bd9fba1b81edb203b
author: Kaho Ng <[email protected]>
date: Wed Jun 21 22:26:19 EDT 2017

ext4_balloc: fix not invaliding cache correctly

We fix ext4_balloc_free_blocks() not invaliding cache
correctly according to start block and block count parameter
from caller.

--- a/src/ext4_balloc.c
+++ b/src/ext4_balloc.c
@@ -235,6 +235,7 @@
 {
 	int rc = EOK;
 	uint32_t blk_cnt = count;
+	ext4_fsblk_t start_block = first;
 	struct ext4_fs *fs = inode_ref->fs;
 	struct ext4_sblock *sb = &fs->sb;
 
@@ -341,7 +342,7 @@
 
 	}
 
-	ext4_bcache_invalidate_lba(fs->bdev->bc, first, count);
+	ext4_bcache_invalidate_lba(fs->bdev->bc, start_block, blk_cnt);
 	/*All blocks should be released*/
 	ext4_assert(count == 0);