]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
libext2fs: fix arguments passed to ->block_alloc_stats_range
authorDarrick J. Wong <djwong@kernel.org>
Sun, 6 Jul 2025 18:31:16 +0000 (11:31 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 31 Jul 2025 14:36:15 +0000 (10:36 -0400)
commit520caea10dec63fb9abebaa55578a671d9f2aa15
tree835f2cab85fd2768082c00749510d60266795cfd
parent509da98991e2a3f72042c6b29e538a5269357a80
libext2fs: fix arguments passed to ->block_alloc_stats_range

In ext2fs_block_alloc_stats_range, we use @num as the loop counter but
then pass it to the callback and @blk as the loop cursor.  This means
that the range passed to e2fsck_block_alloc_stats_range starts beyond
the range that was actually freed and has a length of zero, which is not
at all correct.

Fix this by saving the original values and passing those instead.

Cc: linux-ext4@vger.kernel.org # v1.43
Fixes: 647e8786156061 ("libext2fs: add new hooks to support large allocations")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/175182663005.1984706.2711154041137486922.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/alloc_stats.c