Whamcloud - gitweb
LU-193 fix f_messy_inode failure due to ibadness 43/543/5
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 11 May 2011 08:48:14 +0000 (02:48 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 16 May 2011 19:42:10 +0000 (13:42 -0600)
The EXT4_XTIME_ANCIENT (ctime > s_mkfs_time) check was failing on i686
due to s_mkfs_time being uninitialized on the f_messy_inode test image.
On i686 this caused an underflow due to the 24h error margin for the
timestamp comparison to compensate for time zone errors.

Add -d to e2fsck runtime options for the failing f_messy_inode test
so that it prints when the inode badness is incremented.  The debug
test output was generated on an x86_64 system and should pass on all
architectures.

Print failed test output at the time of failure to simplify debugging
when running in an automated test harness.

Change-Id: I9142cfb83e53552b7ded5a4052eeccc5a7efb3d2

patches/e2fsprogs-ibadness-counter.patch
patches/e2fsprogs-tests-f_ibadness_debug.patch [new file with mode: 0644]
patches/e2fsprogs-version.patch
patches/series

index 6f0e6bb..a595719 100644 (file)
@@ -43,7 +43,7 @@ Index: e2fsprogs/e2fsck/e2fsck.h
 +      (!((ctx)->flags & E2F_FLAG_TIME_INSANE) &&      \
 +       (xtime) > (ctx)->now + (margin))
 +#define EXT4_XTIME_ANCIENT(ctx, sb, xtime, margin)    \
-+      ((xtime) < (sb)->s_mkfs_time - (margin))
++      ((sb)->s_mkfs_time > (margin) && (xtime) < (sb)->s_mkfs_time - (margin))
 +
 +#define BADNESS_NORMAL                1
 +#define BADNESS_HIGH          2
diff --git a/patches/e2fsprogs-tests-f_ibadness_debug.patch b/patches/e2fsprogs-tests-f_ibadness_debug.patch
new file mode 100644 (file)
index 0000000..850b259
--- /dev/null
@@ -0,0 +1,67 @@
+Test to debug inconsistencies when running the f_messy_inode test
+after e2fsprogs-ibadness-counter.patch is applied.  Any new errors
+found in this inode will cause a different badness value to be
+printed, so always print the locations of the ibadness increments.
+
+Add debugging to test_script.in so it prints the ".failed" file
+after a test failure, so that failures are easier to debug.
+
+Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
+Index: e2fsprogs/tests/f_messy_inode/expect.1
+===================================================================
+--- e2fsprogs.orig/tests/f_messy_inode/expect.1
++++ e2fsprogs/tests/f_messy_inode/expect.1
+@@ -1,19 +1,31 @@
+ Filesystem did not have a UUID; generating one.
+ Pass 1: Checking inodes, blocks, and sizes
++check_ext_attr:: increase inode 14 badness 0 to 1
++process_block:: increase inode 14 badness 1 to 2
+ Inode 14 has illegal block(s).  Clear? yes
+ Illegal block #2 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 2 to 3
+ Illegal block #3 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 3 to 4
+ Illegal block #4 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 4 to 5
+ Illegal block #5 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 5 to 6
+ Illegal block #6 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 6 to 7
+ Illegal block #7 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 7 to 8
+ Illegal block #8 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 8 to 9
+ Illegal block #9 (4294901760) in inode 14.  CLEARED.
++process_block:: increase inode 14 badness 9 to 10
+ Illegal block #10 (4294901760) in inode 14.  CLEARED.
++check_blocks:: increase inode 14 badness 10 to 11
+ Inode 14, i_size is 18446462598732849291, should be 2048.  Fix? yes
++check_blocks:: increase inode 14 badness 11 to 12
+ Inode 14, i_blocks is 18, should be 4.  Fix? yes
+ Pass 2: Checking directory structure
+Index: e2fsprogs/tests/f_messy_inode/script
+===================================================================
+--- /dev/null
++++ e2fsprogs/tests/f_messy_inode/script
+@@ -0,0 +1,5 @@
++FSCK_OPT="-fy -d"
++OUT1=$test_name.1.log
++AFTER_CMD="sed -i -e 's/:[0-9]\{4\}:/::/' $OUT1"
++
++. $cmd_dir/run_e2fsck
+Index: e2fsprogs/tests/test_script.in
+===================================================================
+--- e2fsprogs.orig/tests/test_script.in
++++ e2fsprogs/tests/test_script.in
+@@ -69,6 +69,7 @@ do
+                       echo "Missing test script!"
+               fi
+       fi
++      [ -f $test_name.failed ] && diff -u $test_name.{1,2}.log
+ done
+ num_ok=`ls *.ok 2>/dev/null | wc -l`
index fb85598..e3ccd43 100644 (file)
@@ -10,5 +10,5 @@ Index: e2fsprogs/version.h
  
 -#define E2FSPROGS_VERSION "1.41.14"
 -#define E2FSPROGS_DATE "22-Dec-2010"
-+#define E2FSPROGS_VERSION "1.41.90.wc1"
-+#define E2FSPROGS_DATE "18-Mar-2011"
++#define E2FSPROGS_VERSION "1.41.90.wc2"
++#define E2FSPROGS_DATE "14-May-2011"
index 8594183..0061958 100644 (file)
@@ -55,6 +55,7 @@ e2fsprogs-expand-extra-isize.patch
 e2fsprogs-tests-f_expisize.patch
 e2fsprogs-tests-f_expisize_ea_del.patch
 e2fsprogs-ibadness-counter.patch
+e2fsprogs-tests-f_ibadness_debug.patch
 e2fsprogs-tests-f_ibadness.patch
 e2fsprogs-tests-f_ibadness_bad_extents.patch
 e2fsprogs-tests-f_random_corruption.patch