From faa76ad23b0ce89d3f0f6bb53740fb47d42ca9f3 Mon Sep 17 00:00:00 2001 From: Kaho Ng Date: Thu, 22 Jun 2017 02:26:19 +0800 Subject: [PATCH] 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. --- src/ext4_balloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ext4_balloc.c b/src/ext4_balloc.c index a308fbb..8e5e26c 100644 --- a/src/ext4_balloc.c +++ b/src/ext4_balloc.c @@ -235,6 +235,7 @@ int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref, { 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 @@ int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref, } - 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);