OSDN Git Service

tests: add new test f_zero_extent_length
authorTao Ma <boyu.mt@taobao.com>
Mon, 11 Jun 2012 03:56:30 +0000 (23:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 05:06:50 +0000 (01:06 -0400)
If all of the extents in the last extent tree block (ETB) in a
non-trivial extent tree contain uninitialized extents which are after
the end of the file as defined by i_size, the hueristics will
incorrectly estimate the last entry (and hence the node's e_len field)
in the last entry of each level of the extent tree.

As Tao Ma has noted, since e2fsck was requiring that the length
(e_len) field of interior nodes be non-zero, this was causing false
failures where e2fsck would declare that the extent tree was
corrupted.

This was fixed in commit 9c40d14841: "e2fsck: only check for
zero-length leaf extents".  Add a regression test case to ensure that
this issue remains fixed.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_uninit_ext_past_eof/expect.1 [new file with mode: 0644]
tests/f_uninit_ext_past_eof/expect.2 [new file with mode: 0644]
tests/f_uninit_ext_past_eof/image.gz [new file with mode: 0644]
tests/f_uninit_ext_past_eof/name [new file with mode: 0644]

diff --git a/tests/f_uninit_ext_past_eof/expect.1 b/tests/f_uninit_ext_past_eof/expect.1
new file mode 100644 (file)
index 0000000..762159c
--- /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/1024 files (16.7% non-contiguous), 1227/4096 blocks
+Exit status is 0
diff --git a/tests/f_uninit_ext_past_eof/expect.2 b/tests/f_uninit_ext_past_eof/expect.2
new file mode 100644 (file)
index 0000000..762159c
--- /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/1024 files (16.7% non-contiguous), 1227/4096 blocks
+Exit status is 0
diff --git a/tests/f_uninit_ext_past_eof/image.gz b/tests/f_uninit_ext_past_eof/image.gz
new file mode 100644 (file)
index 0000000..0b69158
Binary files /dev/null and b/tests/f_uninit_ext_past_eof/image.gz differ
diff --git a/tests/f_uninit_ext_past_eof/name b/tests/f_uninit_ext_past_eof/name
new file mode 100644 (file)
index 0000000..9e0c6e0
--- /dev/null
@@ -0,0 +1 @@
+fallocated extents after i_size