I found that overwriting existing files hides a bug
in ext4 (since fixed). Removing the files before
the test reliably reproduces it.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
As found by Theodore Ts'o:
If a 128K file is falloc'ed using the KEEP_SIZE flag, and then
write exactly 128K, the EOFBLOCK_FL doesn't get cleared correctly.
This is bad since it forces e2fsck to complain about that inode.
If you have a large number of inodes that are written with fallocate
using KEEP_SIZE, and then fill them up to their expected size,
e2fsck will potentially complain about a _huge_ number of inodes.
This would also cause a huge increase in the time taken by e2fsck
to complete its check.
Test scenarios covered:
1. Fallocating X bytes and writing Y (Y<X) (buffered and direct io)
2. Fallocating X bytes and writing Y (Y=X) (buffered and direct io)
3. Fallocating X bytes and writing Y (Y>X) (buffered and direct io)
These test cases exercise the normal and edge case conditions using
falloc (and KEEP_SIZE).
Ref: http://thread.gmane.org/gmane.comp.file-systems.ext4/20682
Signed-off-by: Akshay Lal <alal@google.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>