ext4: call ext4_mb_mark_context in ext4_mb_mark_diskspace_used
authorKemeng Shi <shikemeng@huaweicloud.com>
Thu, 28 Sep 2023 16:04:00 +0000 (00:04 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 6 Oct 2023 02:32:15 +0000 (22:32 -0400)
commit2f94711b098bc55285ac74aba2f2b83fd72b555f
tree29d184b598bc564f163c530809d81c9d46078fb6
parentc431d3867e0a8258d1948408eb8297cdd2400e67
ext4: call ext4_mb_mark_context in ext4_mb_mark_diskspace_used

Call ext4_mb_mark_context in ext4_mb_mark_diskspace_used to:
1. Remove repeat code to normally update bitmap and group descriptor
on disk.
2. Now that we have a common API for marking blocks inuse/free in block
bitmap, use that instead of open coding it in function
ext4_mb_mark_diskspace_used(). The current code was not updating
checksum and other counters. ext4_mb_mark_context() should fix these
consistency problems.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20230928160407.142069-6-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c