The behavior of the r_fixup_lastbg_big test varies depending on whether or not ext4.ko is loaded and supports lazy_itable_init. This makes checking the bg flags after resize2fs hard to predict, so put in a way to force resize2fs to zero the inode tables, and compare the output based on lazy_itable_init == 0. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- resize/resize2fs.c | 3 ++- tests/r_fixup_lastbg_big/expect | 4 +++- tests/r_fixup_lastbg_big/script | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resize/resize2fs.c b/resize/resize2fs.c index 2febfde..041ff75 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -904,7 +904,8 @@ retry: group_block = ext2fs_group_first_block2(fs, old_fs->group_desc_count); csum_flag = ext2fs_has_group_desc_csum(fs); - if (access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0) + if (!getenv("RESIZE2FS_FORCE_ITABLE_INIT") && + access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0) lazy_itable_init = 1; if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) old_desc_blocks = fs->super->s_first_meta_bg; diff --git a/tests/r_fixup_lastbg_big/expect b/tests/r_fixup_lastbg_big/expect index 8f302a3..edaabaf 100644 --- a/tests/r_fixup_lastbg_big/expect +++ b/tests/r_fixup_lastbg_big/expect @@ -22,6 +22,8 @@ Group 2: (Blocks 16385-19999) Free blocks: 16385-19999 Free inodes: 833-1248 Resizing the filesystem on test.img to 40000 (1k) blocks. +Begin pass 1 (max = 2) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on test.img is now 40000 (1k) blocks long. Group 2: (Blocks 16385-24576) [INODE_UNINIT, BLOCK_UNINIT] @@ -31,7 +33,7 @@ Group 2: (Blocks 16385-24576) [INODE_UNINIT, BLOCK_UNINIT] 8192 free blocks, 416 free inodes, 0 directories, 416 unused inodes Free blocks: 16385-24576 Free inodes: 833-1248 -Group 3: (Blocks 24577-32768) [INODE_UNINIT] +Group 3: (Blocks 24577-32768) [INODE_UNINIT, ITABLE_ZEROED] Backup superblock at 24577, Group descriptors at 24578-24578 Reserved GDT blocks at 24579-24656 Block bitmap at 413 (bg #0 + 412) diff --git a/tests/r_fixup_lastbg_big/script b/tests/r_fixup_lastbg_big/script index 4c4a351..97d9fd4 100755 --- a/tests/r_fixup_lastbg_big/script +++ b/tests/r_fixup_lastbg_big/script @@ -13,7 +13,7 @@ $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_EXE -f -p $TMPFILE >> $OUT 2>&1 +RESIZE2FS_FORCE_ITABLE_INIT=1 $RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT $E2FSCK -fy $TMPFILE >> $OUT 2>&1 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html