Whamcloud - gitweb
tests: add another test for uninit extents past eof
authorEric Whitney <enwlinux@gmail.com>
Fri, 27 Sep 2013 00:17:09 +0000 (20:17 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Sep 2013 00:17:09 +0000 (20:17 -0400)
Commit d3f32c2db8 was intended to detect extents found outside their
proper location in the extent tree, including invalid extents at the
end of an extent block.  However, it incorrectly reported legal
uninitialized extents created by fallocate() at the end of file with
the FALLOC_FL_KEEP_SIZE flag as false positives.  xfstests
generic/263 (among others) caught this problem, while the e2fsprogs
test f_uninit_ext_past_eof did not.  The latter test failed to
detect the problem in part because it uses a test file whose i_size
is 0.

Add a test derived from the fsx-based test case in xfstests
generic/263 consisting of a file with non-zero length, more than
four extents total, and two uninitialized extents past EOF to
reliably reproduce commit d3f32c2db8's false positive behavior.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_uninit_ext_past_eof2/expect.1 [new file with mode: 0644]
tests/f_uninit_ext_past_eof2/expect.2 [new file with mode: 0644]
tests/f_uninit_ext_past_eof2/image.gz [new file with mode: 0644]
tests/f_uninit_ext_past_eof2/name [new file with mode: 0644]

diff --git a/tests/f_uninit_ext_past_eof2/expect.1 b/tests/f_uninit_ext_past_eof2/expect.1
new file mode 100644 (file)
index 0000000..eb8248e
--- /dev/null
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks
+Exit status is 0
diff --git a/tests/f_uninit_ext_past_eof2/expect.2 b/tests/f_uninit_ext_past_eof2/expect.2
new file mode 100644 (file)
index 0000000..eb8248e
--- /dev/null
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks
+Exit status is 0
diff --git a/tests/f_uninit_ext_past_eof2/image.gz b/tests/f_uninit_ext_past_eof2/image.gz
new file mode 100644 (file)
index 0000000..c739e49
Binary files /dev/null and b/tests/f_uninit_ext_past_eof2/image.gz differ
diff --git a/tests/f_uninit_ext_past_eof2/name b/tests/f_uninit_ext_past_eof2/name
new file mode 100644 (file)
index 0000000..352a0f5
--- /dev/null
@@ -0,0 +1 @@
+fallocated extents after nonzero i_size and total extents > 4