]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsprogs: modify dumpe2fs to report free block ranges for bigalloc
authorEric Whitney <enwlinux@gmail.com>
Fri, 21 Jul 2023 18:55:06 +0000 (14:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 8 Aug 2023 19:52:22 +0000 (15:52 -0400)
commitb31d5b582b4189a0ed27bced22276dd3f68c50a7
treeba7c1abb00ea2c3f38e601cc0ba030be95bff97c
parent0d81aaff13ce35e456e7b0233df7e3c6e84af2ef
e2fsprogs: modify dumpe2fs to report free block ranges for bigalloc

dumpe2fs has never been modified to correctly report block ranges
corresponding to free clusters in block allocation bitmaps from bigalloc
file systems.  Rather than reporting block ranges covering all the
blocks in free clusters found in a block bitmap, it either reports just
the first block number in a cluster for a single free cluster, or a
range beginning with the first block number in the first cluster in a
series of free clusters, and ending with the first block number in the
last cluster in that series.

This behavior causes xfstest shared/298 to fail when run on a bigalloc
file system with a 1k block size.  The test uses dumpe2fs to collect
a list of the blocks freed when files are deleted from a file system.
When the test deletes a file containing blocks located after the first
block in the last cluster in a series of clusters, dumpe2fs does not
report those blocks as free per the test's expectations.

Modify dumpe2fs to report full block ranges for free clusters.  At the
same time, fix a small bug causing unnecessary !in_use() retests while
iterating over a block bitmap.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Link: https://lore.kernel.org/r/20230721185506.1020225-1-enwlinux@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/dumpe2fs.c