ext4: fix wrong unit use in ext4_mb_new_blocks
authorKemeng Shi <shikemeng@huaweicloud.com>
Sat, 3 Jun 2023 15:03:19 +0000 (23:03 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 Jun 2023 23:34:48 +0000 (19:34 -0400)
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>
fs/ext4/mballoc.c

index 474aebfdc1ddfa98a6cc26274eba3822e92d2c91..4322eb7559fc8dcd16a7ae35fe4a9ad37d8e3663 100644 (file)
@@ -6373,7 +6373,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;
        }