]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2freefrag: fix free blocks count during live scan
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 8 Nov 2018 18:44:31 +0000 (10:44 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 Nov 2018 02:46:36 +0000 (21:46 -0500)
commit93accdce51cabf2070206834c140a208c1753c35
treee93d5ff232cfbc23eba5ad4fd52727aef81227d6
parent0eeb17d0610fd512c1038dabb39370420ffb47a4
e2freefrag: fix free blocks count during live scan

In e2freefrag live scan mode, we take the free block count from the
ondisk superblock.  This leads to screwy histogram percentages:

Extent Size Range :  Free extents   Free Blocks  Percent
    4M...    8M-  :             5          8234    1.05%
   64M...  128M-  :             2         52279    6.64%
  512M... 1024M-  :             1        202752   25.74%

...because there could be superblock updates in the journal that haven't
yet been checkpointed.  The online scan is perfectly capable of tallying
the free blocks on its own, so teach it do that and make a more accurate
report.

Reported-by: Elana Hashman <Elana.Hashman@twosigma.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/e2freefrag.c