xfs
[Top] [All Lists]

Re: Strage values from FIBMAP on holes or after end of file

To: Constantin Loizides <Constantin.Loizides@xxxxxx>
Subject: Re: Strage values from FIBMAP on holes or after end of file
From: Steve Lord <lord@xxxxxxx>
Date: Fri, 03 Aug 2001 10:44:59 -0500
Cc: Utz Lehmann <leh@xxxxxxxxxxxxxx>, xfs-list <linux-xfs@xxxxxxxxxxx>
In-reply-to: Message from Constantin Loizides <Constantin.Loizides@isg.de> of "Fri, 03 Aug 2001 13:57:08 +0200." <3B6A9194.6C5B908F@isg.de>
Sender: owner-linux-xfs@xxxxxxxxxxx
> Hi,
> 
> thanx to Utz,
> I have rewritten the fibmap tool.
> You find it at
> 
> http://www.informatik.uni-frankfurt.de/~loizides/reiserfs/


I just chased down a bug in the xfs_db program which makes its
fragmentation command work correctly, should show up in the cvs
tree within the hour. Once it does you will be able to do this:

xfs_db -r /dev/sda3
xfs_db: frag
actual 45069, ideal 44941, fragmentation factor 0.28%
xfs_db: 

This works by walking all the internal structures on the disk looking at
inode contents. Read the man page for options for only looking at specific
inode types. One example would be, on the same filesystem:

regular files:
xfs_db: frag -f
actual 43660, ideal 43652, fragmentation factor 0.02%

and directories:
xfs_db: frag -d
actual 1409, ideal 1289, fragmentation factor 8.52%

Check out the freesp command as well, it shows the distribution of
filesystem free space.


The end result is that the fibmap program is still going 
wrong somewhere. The new version with a fixed ioctl call for xfs gave
me this for the same filesystem:

Result for 48425 files 3044 dirs: Int: 0.873 Ext: 1.000 1.000 1.000 1.000 - 
1.000 - Path 1.000 1.010
Mean Internal frag: 0.873
Mean External frag: 1.000
Mean Frag. Path 1.000
Hist for frag
                   1         2         4         8        16        32        
64       128       256       512      1024      2048      4096      8192
         1     29639      7198      4720      3038      1827      1131       
445       269        93        32        24         6         2         1     
48425
               29639      7198      4720      3038      1827      1131       
445       269        93        32        24         6         2         1     
48425

Hist for frag path
                   1         2         4         8        16        32        
64       128       256       512      1024      2048      4096      8192
         1     29639      7198      4720      3038      1827      1131       
445       268        91        31        24         6         2         1     
48421
        10         0         0         0         0         0         0         
0         1         2         1         0         0         0         0         
4
               29639      7198      4720      3038      1827      1131       
445       269        93        32        24         6         2         1     
48425


Now, the xfs_db frag command is looking at the extent information for all
files, and comparing it with the ideal case. So a file which has a physical
hole in the middle has an ideal extent count of 2. If a directory or symlink
fits in the inode it has no fragmentation it does not show up in the output,
this probably explains the count differences in the output, there are 3044
directories in this filesystem, but only 1218 of them are using space
outside the inode.

Steve


> >[...]
> 
> > > Did you just discover this problem by inspection, or did it
> > > bite you in some other way?   (was some other program using
> > > the FIBMAP ioctl and not working correctly with XFS?)
> > 
> > I found this with the fibmap program of Constantin Loizides fragmentation
> > project. http://www.informatik.uni-frankfurt.de/~loizides/reiserfs/
> > Note: The current version of fibmap doesn't work with XFS well. I thing
> > Constantin will release a fixed version soon.
> > 
> 
> Should work now on xfs, too.
> Also did some minor changes.
> 
> Utz, could you test it on your patched system, please?
> (I still test for minus and zwro values for holes though...)
> 
> Constantin



<Prev in Thread] Current Thread [Next in Thread>