]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tests: explicitly force resize2fs's use of lazy (or not)
authorTheodore Ts'o <tytso@mit.edu>
Tue, 26 Jun 2018 13:59:19 +0000 (09:59 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Jun 2018 13:59:19 +0000 (09:59 -0400)
Resize2fs will not enable lazy_itable if the kernel apparently does
not support that feature.  This will cause spurious test failures when
the tests are running on such a system (or where sysfs is not
mounted).

So for the purposes of the regression test we need to force the use of
lazy_itable so that the results conform to expected golden output.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/resize2fs.c
tests/r_fixup_lastbg_big/script
tests/r_move_itable_realloc/expect
tests/r_move_itable_realloc/script
tests/test_config

index fe52a61798ebeeb3e229856de1738122154d4eda..e8940504225cf93235ed9616af84675d4715a096 100644 (file)
@@ -920,8 +920,9 @@ retry:
        group_block = ext2fs_group_first_block2(fs,
                                                old_fs->group_desc_count);
        csum_flag = ext2fs_has_group_desc_csum(fs);
-       if (!getenv("RESIZE2FS_FORCE_ITABLE_INIT") &&
-           access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0)
+       if (getenv("RESIZE2FS_FORCE_LAZY_ITABLE_INIT") ||
+           (!getenv("RESIZE2FS_FORCE_ITABLE_INIT") &&
+            access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0))
                lazy_itable_init = 1;
        if (ext2fs_has_feature_meta_bg(fs->super))
                old_desc_blocks = fs->super->s_first_meta_bg;
index 113831b7ab24dfda4b576378e8d582fefdb08bb1..ea169e66b6f868e465c63832ce5fdd9671083b63 100755 (executable)
@@ -15,7 +15,12 @@ $DEBUGFS -R "set_bg 2 flags 0" -w $TMPFILE > /dev/null 2>&1
 $DEBUGFS -R "set_bg 2 checksum 0xd318" -w $TMPFILE > /dev/null 2>&1
 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT
 dd if=/dev/zero of=$TMPFILE bs=1 count=1 seek=$((1024 * 40000)) conv=notrunc >> $OUT 2> /dev/null
-RESIZE2FS_FORCE_ITABLE_INIT=1 $RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1
+(
+RESIZE2FS_FORCE_ITABLE_INIT=1
+export RESIZE2FS_FORCE_ITABLE_INIT
+unset RESIZE2FS_FORCE_LAZY_ITABLE_INIT
+$RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1
+)
 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT
 $E2FSCK -fy $TMPFILE >> $OUT 2>&1
 
index 73b2fef06fa1817e539d9f3830739a537489a1ce..f9a7f515a44e6173649b82faaad7920f8de23336 100644 (file)
@@ -1,5 +1,5 @@
 mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000
-resize2fs -p test.img 10240000
+resize2fs -p test.img 100000000
 Resizing the filesystem on test.img to 100000000 (1k) blocks.
 Begin pass 2 (max = 2061)
 Relocating blocks             ----------------------------------------\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
index edc1303a1d9f9cf069063879f1448d7d9fbe13e8..ae875e4ac7ce11ec6acf7ba5cce2ccd053262a3d 100644 (file)
@@ -30,7 +30,7 @@ echo mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 102
 $MKE2FS -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 \
        $TMPFILE 1024000 >> $OUT 2>&1
 
-echo resize2fs -p test.img 10240000 >> $OUT
+echo resize2fs -p test.img 100000000 >> $OUT
 $RESIZE2FS -p $TMPFILE 100000000 >> $OUT 2>&1
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT 2>&1
index 81fbf95e3f3b03be42881068992c8348f3a30abc..1f146ca20cc71f2616e1c5ad9df0304324f4ff53 100644 (file)
@@ -49,5 +49,7 @@ E2FSPROGS_SKIP_PROGRESS=yes
 export E2FSPROGS_SKIP_PROGRESS
 EXT2FS_NO_MTAB_OK=yes
 export EXT2FS_NO_MTAB_OK
+RESIZE2FS_FORCE_LAZY_ITABLE_INIT=yes
+export RESIZE2FS_FORCE_LAZY_ITABLE_INIT
 E2FSPROGS_LIBMAGIC_SUPPRESS=yes
 export E2FSPROGS_LIBMAGIC_SUPPRESS