On Fri, Sep 20, 2002 at 09:24:12PM +0200, Juri Haberland wrote:
> Out of curiosity, could you elaborate on this a little bit?
xfs_fsr defragments file be looking at which files are fragmented,
create a new file preallocating space for a defragmented version of
that file an copying the old file to the new file.
However, xfs_fsr doesn't always know reliably when it can and cannot
further defragment files. I mad fixed to my local version here when I
saw it was trying to defragment files that *must* span multiple AGs
because of their size (technically it's not the file size, but
aggregated size of adjacent extents as holes don't count).
Whe the file is copied, it tests to see if the original has changed
and then 'swaps' the extents from the old to the new.
Because xfs_fsr 'copies' the data, it's actually rather slow and can
(usually) does slow access to the fs noticeably. It also means you
cannot defragment files which are in use.
The other things to consider is that it defagments *files* not
filesystems, so potentially as you defragment files, you fragment free
space. (I'm not sure in reality of this is a problem though, in
practise if your filesystem is large compared to you average file size
then probaby not).
On last this to consider, a recent minor security fix means xfs_fsr
cannot defragment non-root owned files...