diff mbox

[2/2] e2fsck/tests: Add the regression test case for e2fsck.

Message ID 1337238967-4704-3-git-send-email-tm@tao.ma
State Accepted, archived
Headers show

Commit Message

Tao Ma May 17, 2012, 7:16 a.m. UTC
From: Tao Ma <boyu.mt@taobao.com>

In commit "e2fsck: Let end_blk to be the maximum value of u32."
we fix a bug where a normal fallocate will cause e2fsck complain.
So add it to the regression test suite.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
 tests/f_zero_extent_length/expect.1 |    7 +++++++
 tests/f_zero_extent_length/expect.2 |    7 +++++++
 tests/f_zero_extent_length/image.gz |  Bin 0 -> 5102 bytes
 tests/f_zero_extent_length/name     |    1 +
 4 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 tests/f_zero_extent_length/expect.1
 create mode 100644 tests/f_zero_extent_length/expect.2
 create mode 100644 tests/f_zero_extent_length/image.gz
 create mode 100644 tests/f_zero_extent_length/name

Comments

Theodore Ts'o June 11, 2012, 5:07 a.m. UTC | #1
On Thu, May 17, 2012 at 03:16:07PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> In commit "e2fsck: Let end_blk to be the maximum value of u32."
> we fix a bug where a normal fallocate will cause e2fsck complain.
> So add it to the regression test suite.
> 
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

I've changed the description of this commit to reflect the change in
how I propose to fix the problem....

					- Ted

commit 8d12c46a22965179cae1e3b47778fdee5efeb513
Author: Tao Ma <boyu.mt@taobao.com>
Date:   Sun Jun 10 23:56:30 2012 -0400

    tests: add new test f_zero_extent_length
    
    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>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/f_zero_extent_length/expect.1 b/tests/f_zero_extent_length/expect.1
new file mode 100644
index 0000000..762159c
--- /dev/null
+++ b/tests/f_zero_extent_length/expect.1
@@ -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_zero_extent_length/expect.2 b/tests/f_zero_extent_length/expect.2
new file mode 100644
index 0000000..762159c
--- /dev/null
+++ b/tests/f_zero_extent_length/expect.2
@@ -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_zero_extent_length/image.gz b/tests/f_zero_extent_length/image.gz
new file mode 100644
index 0000000000000000000000000000000000000000..0b6915805bc7c3d67b9bf0f944f980b36012268e
GIT binary patch
literal 5102
zcmb2|=HM{n-0IK3oSB=Lp33m{u78e5s070Y^WBScwzp2RH+-<N(S>t{lY_{A6(w~8
zL)9)$^`=g#<SjBsT>RICD+?rfbW|xE5jfl^Fk47()~U$+s*edxoa}rp6SlP%t;{b=
zOY|0Bx$rI5=ijRG?`Pk<Idl8%@4o5V4(D(<WG*#ibNXRwW?khxV@=zHE%tU1E-~*;
z&fEC#d6G(E+OxCLp2a&w3wLeJcwJd&x=`@(Q;FT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9t
zhSQEm2rjli=Fl_s?h76Ix@gq4(GVC7fdLMI4;NN~3(A*U1P{$LX^EORzxSuZ#QEJn
zZz=7+B!4JjVtnt<V@mtQKCgAHvwddW{U_~Ax#-W3Gv7simi%|xuO!Dd)ooVF+kKO(
zXJ1~fFBdVbceeBNPus$D%%Mf5`uE89trL@FpPRe+-zjE28T<Crwm;uK53sjKtsf16
n(GVC7fzc2c4S~@R7!85Z5Eu=CArb-&ANXYirY~S%a9{uc`yfdH

literal 0
HcmV?d00001

diff --git a/tests/f_zero_extent_length/name b/tests/f_zero_extent_length/name
new file mode 100644
index 0000000..9e0c6e0
--- /dev/null
+++ b/tests/f_zero_extent_length/name
@@ -0,0 +1 @@ 
+fallocated extents after i_size