On 4/19/2011 1:29 AM, Andreas Dilger wrote:
On 2011-04-19, at 1:37 AM, Allison Henderson wrote:
Big Hole Test
---------------------------------------------------------------
A hole large hole is punched in a large file (exact file size=638169088 bytes, exact hole size = 638150422 bytes, offset = 6144 bytes),
resulting in all but 5 blocks being punched out (2 in the front, 3 in the back). This test case verifies that the code can properly
punch out a hole covering multiple extents.
This test is successful when the following conditions are met:
- File frag shows extents only for the first two blocks and the last 3 blocks
- The test file contains zeros from bytes 6144 to 638156566
(* ls and df is not measured here because some blocks will still be reserved
as index blocks causing the consumed space to be appear larger)
Shouldn't the remaining two extents fit inside the inode, so there is no need for index blocks, or does the extent removal code not shrink the index blocks?
Cheers, Andreas
Hi there,
It turns out that it does not. At one point I spent a good chunk of
time trying to figure out why the file size was not the number I had
expected, and found out that there was an index block that was still
there. I also found out a normal truncate does the same thing. A large
file truncated down to a small file ended up occupying more space than
an empty file that was grown to the same size. Since this behavior was
existing though, we have put this task on our back log as a separate
work item.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html