All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in filefrag?
@ 2012-07-12 15:04 Nelson, John R
  2012-07-12 15:22 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson, John R @ 2012-07-12 15:04 UTC (permalink / raw)
  To: linux-ext4

I did ran filefrag on a 100GB file and it showed it in 82 extents, when i did filefrag -v it went all the way down to 1038 Total extents.. So which is correct? 82 extents or 1038 extents?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in filefrag?
  2012-07-12 15:04 Bug in filefrag? Nelson, John R
@ 2012-07-12 15:22 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2012-07-12 15:22 UTC (permalink / raw)
  To: Nelson, John R; +Cc: linux-ext4

On Thu, Jul 12, 2012 at 03:04:44PM +0000, Nelson, John R wrote:
> I did ran filefrag on a 100GB file and it showed it in 82 extents,
> when i did filefrag -v it went all the way down to 1038 Total
> extents.. So which is correct? 82 extents or 1038 extents?

Both, really.

The first means that you have 82 contiguous regions in your 100 gig
file.  That's not bad at all, and reflects the fact that there is
intervening file system metadata.  Each chunk is over a gigabyte on
average, and a seek every 1.2 gigabytes is not going to be noticeable.

The reason you are seeing 1038 extents reflects the fact that an entry
in a leaf node of the extent tree has a 15-bit length field, which
given a 4k block size, means that each extent descriptor can only
cover 128 megabytes.  So we simply use multiple entries in an extent
tree's leaf node for each adjacent 128 megabyte segment.  Since
filefrag -v shows you each physical extent descriptor, you'll see this.

Filefrag -v has many uses, including for filesystem developers who are
trying to debug performance issues, so it shows this greater amount of
detail.

Regards,

					- Ted

P.S.  The "expected" field shows the discontinuities,  For example:

% filefrag -v /u1/02\ Agent\ Afloat.m4v 
Filesystem type is: ef53
File size of /u1/02 Agent Afloat.m4v is 596714332 (145683 blocks, blocksize 4096)
 ext logical physical expected length flags
   0       0    34816           32768 
   1   32768    67584           30720 
   2   63488   100352    98304  32768 
   3   96256   133120           30720 
   4  126976   165888   163840  18432 
   5  145408   164865   184320    275 eof

In line #1, the physical + length fields is 67584 + 30720 = 98304.
That's the physical block number we would hope to see in line #2 if
that extent were physically contiguous with the previous one (and
which you can see in the "expected" column).  In fact, it wasn't; the
starting physical block number for extent #2 was 100352.

The fact that there are 3 discontinuities means that the file has 4
extents, comprising the logical block ranges: 0 -- 63487, 63488 --
126975, 126976 -- 145407, and 145408 -- 145682.  Hence:

/u1/02 Agent Afloat.m4v: 4 extents found




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-12 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 15:04 Bug in filefrag? Nelson, John R
2012-07-12 15:22 ` Ted Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.