[LU-11506] e2freefrag calculates percentages incorrectly Created: 11/Oct/18  Updated: 11/Oct/18  Resolved: 11/Oct/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Dongyang Li
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

A recent usage with e2freefrag-1.42.13-wc5 shows that it is calculating the free blocks and percentage of blocks for each bucket incorrectly:

Device: /dev/mapper/lfs1_ost0015
Blocksize: 4096 bytes
Total blocks: 15602810880
Free blocks: 22769561 (0.1%)

Min. free extent: 4 KB 
Max. free extent: 115812 KB
Avg. free extent: 10844 KB
Num. free extent: 3172805

HISTOGRAM OF FREE EXTENT SIZES:
Extent Size Range :  Free extents   Free Blocks  Percent
    4K...    8K-  :        128938        128938    0.57%
    8K...   16K-  :        138698        332505    1.46%
   16K...   32K-  :        138806        721022    3.17%
   32K...   64K-  :        157230       1758685    7.72%
   64K...  128K-  :        180715       4102265   18.02%
  128K...  256K-  :        193026       8835597   38.80%
  256K...  512K-  :        191502      17473091   76.74%
  512K... 1024K-  :        202066      37180933  163.29%
    1M...    2M-  :        185758      68276323  299.86%
    2M...    4M-  :        176791     131489492  577.48%
    4M...    8M-  :        229272     312440019  1372.18%
    8M...   16M-  :        295202     857176672  3764.57%
   16M...   32M-  :        750785    5044129351  22152.95%
   32M...   64M-  :        203637    2112443487  9277.49%
   64M...  128M-  :           379       7350563   32.28%

This is very likely due to a 32-bit overflow in the calculations.



 Comments   
Comment by Andreas Dilger [ 11/Oct/18 ]

It looks like this may already be fixed in v1.43.7-7-gf222de72 "e2freefrag: print 64bit free blocks count", so it will be fixed in our next e2fsprogs release.

There was also commit v1.42.8-148-gd0550895 "e2freefrag: avoid integer overflow when reporting free space statistics", so it should already be in our e2fsprogs releases.

Generated at Sat Feb 10 02:44:28 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.