Whamcloud - gitweb
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 20:04:03 +0000 (16:04 -0400)
commitb9df2bcb4d8a4d2f3985f3d2f9d85292b826cc8b
treecbe82ad2eae1815a3c27706ac7120d6fc2cef772
parent4565b26ddda4882f7aff032de1d90ce5cd50244f
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