1 if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then 2 test_description="fix up last bg when expanding beyond the last bg" 3 4 EXP=$test_dir/expect 5 OUT=$test_name.out 6 LOG=$test_name.log 7 E2FSCK=../e2fsck/e2fsck 8 9 $MKE2FS -T ext4 -b 1024 -F -U 56d3ee50-8532-4f29-8181-d7c6ea4a94a6 $TMPFILE 20000 > $OUT 2>&1 10 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT 11 $DEBUGFS -R "set_bg 2 itable_unused 0" -w $TMPFILE > /dev/null 2>&1 12 $DEBUGFS -R "set_bg 2 flags 0" -w $TMPFILE > /dev/null 2>&1 13 $DEBUGFS -R "set_bg 2 checksum 0xd318" -w $TMPFILE > /dev/null 2>&1 14 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT 15 dd if=/dev/zero of=$TMPFILE bs=1 count=1 seek=$((1024 * 40000)) conv=notrunc >> $OUT 2> /dev/null 16 RESIZE2FS_FORCE_ITABLE_INIT=1 $RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1 17 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT 18 $E2FSCK -fy $TMPFILE >> $OUT 2>&1 19 20 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $LOG 21 rm -rf $OUT 22 23 cmp -s $LOG $EXP 24 RC=$? 25 if [ $RC -eq 0 ]; then 26 echo "$test_name: $test_description: ok" 27 touch $test_name.ok 28 else 29 echo "$test_name: $test_description: failed" 30 diff -u $EXP $LOG > $test_name.failed 31 fi 32 33 unset EXP LOG OUT E2FSCK 34 35 else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then 36 echo "$test_name: $test_description: skipped" 37 fi 38