summary refs log tree commit diff
path: root/fs/ext4
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2023-06-03 23:03:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-23 13:49:33 +0200
commite861961f3a503909d7377f8f41364464dce5fb4f (patch)
treeb2943acc2096a2518c4c48da77f29d4a0999733b /fs/ext4
parent2038d35749c74994a9cf0a4bbd206a8c976591ba (diff)
downloadlinux-e861961f3a503909d7377f8f41364464dce5fb4f.tar.gz
ext4: fix wrong unit use in ext4_mb_new_blocks
commit 2ec6d0a5ea72689a79e6f725fd8b443a788ae279 upstream.

Function ext4_free_blocks_simple needs count in cluster. Function
ext4_free_blocks accepts count in block. Convert count to cluster
to fix the mismatch.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: stable@kernel.org
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20230603150327.3596033-12-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/mballoc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 9ada3a395255..88ed64ebae3e 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -6166,7 +6166,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
 	}
 
 	if (sbi->s_mount_state & EXT4_FC_REPLAY) {
-		ext4_free_blocks_simple(inode, block, count);
+		ext4_free_blocks_simple(inode, block, EXT4_NUM_B2C(sbi, count));
 		return;
 	}