diff options
Diffstat (limited to '')
1352 files changed, 40259 insertions, 0 deletions
diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..ba06b3b --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,107 @@ +# +# Makefile for the tests directory +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = .. +my_dir = tests +INSTALL = @INSTALL@ +MKDIR_P = @MKDIR_P@ + +@MCONFIG@ + +all:: @DO_TEST_SUITE@ test_one test_script + +test_one: $(srcdir)/test_one.in Makefile mke2fs.conf test_data.tmp + @echo "Creating test_one script..." + @[ -f test_one ] && chmod u+w test_one || true + @echo "#!/bin/sh" > test_one + @echo "HTREE=y" >> test_one + @echo "QUOTA=y" >> test_one + @echo "SRCDIR=@srcdir@" >> test_one + @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one + @echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one + @echo "DD=@DD@" >>test_one + @cat $(srcdir)/test_one.in >> test_one + @chmod +x-w test_one + +test_script: test_one test_script.in Makefile mke2fs.conf test_data.tmp + @echo "Creating test_script..." + @[ -f test_script ] && chmod u+w test_script || true + @echo "#!/bin/sh" > test_script + @echo "SRCDIR=@srcdir@" >> test_script + @cat $(srcdir)/test_script.in >> test_script + @chmod +x-w test_script + +mke2fs.conf: $(srcdir)/mke2fs.conf.in + $(CP) $(srcdir)/mke2fs.conf.in mke2fs.conf + +test_data.tmp: $(srcdir)/scripts/gen-test-data + $(srcdir)/scripts/gen-test-data > test_data.tmp + +.PHONY : test_pre test_post check always_run + +always_run: + +@ifGNUmake@TESTS=$(wildcard $(srcdir)/[a-z]_*) +@ifNotGNUmake@TESTS != echo $(srcdir)/[a-z]_* + +SKIP_SLOW_TESTS=--skip-slow-tests + +$(TESTS):: test_one always_run + @./test_one $(SKIP_SLOW_TESTS) $@ + +foo: + echo $(TESTS) + +test_pre: + @$(RM) -f *.failed + @echo "Running e2fsprogs test suite..." + @echo " " + +test_post: test_pre $(TESTS) + @$(srcdir)/test_post + +check:: test_pre test_post test_script + +fullcheck:: + $(MAKE) SKIP_SLOW_TESTS= check + +check-failed: $(basename $(wildcard *.failed)) + @$(srcdir)/test_post + + +TDIR=f_testnew +# Target which creates a new testcase to simplify adding new regression tests. +testnew: + @echo "Creating a new e2fsck testcase in ${TDIR}" + @mkdir -p ${TDIR} + dd if=/dev/zero of=${TDIR}/image bs=1k count=8k + $(top_srcdir)/misc/mke2fs -j -F -N 256 ${TDIR}/image + @echo "new test description" > ${TDIR}/name + @echo; echo; echo "New test filesystem at ${TDIR}/image." + @echo "Now, break the filesystem as appropriate, and run 'make testend'" + +EXPECT1=${TDIR}/expect.1 +EXPECT2=${TDIR}/expect.2 +# Target which generates the expect files for the new testcase. +testend: test_one ${TDIR}/image + gzip -9 ${TDIR}/image + @OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_one ${TDIR} + @echo; echo; echo "*** output from first e2fsck run (${EXPECT1}) ***" + @cat ${EXPECT1} + @echo "*** output from second e2fsck run (${EXPECT2}) ***" + @cat ${EXPECT2} + @echo "*** end of e2fsck output ***" + @echo; echo "Hopefully e2fsck now fixes this problem properly." + @echo "If all is well, edit ${TDIR}/name and rename ${TDIR}." + +clean:: + $(RM) -f *~ *.log *.new *.failed *.ok *.tmp *.slow + $(RM) -f test_one test_script mke2fs.conf test_data.tmp + +distclean:: clean + $(RM) -f Makefile + $(RM) -rf ${TDIR} diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..d9d2437 --- /dev/null +++ b/tests/README @@ -0,0 +1,68 @@ +These images contain various forms of corrupted filesystem which +e2fsck will correct. They are used as a regression test for e2fsck. + +The test_script program will automatically run e2fsck against the +filesystem images. It will run them two times, and display the exit +status for each run. The meaning of the exit status codes are as +follows: + + 0 No filesystem errors were detected + 1 Filesystem errors detected, but corrected + 2 System should be rebooted + 4 Filesystem errors left uncorrected + 8 Operational error (generally means internal error, + or filesystem error that the e2fsck was not + prepared to deal with) + 16 Usage or syntax error + +During the regression test, the first exit code should be 1, and the +second exit code should be 0. In other words, all (with one +exception) of the test filesystems in this directory have some sort of +filesystem corruption, which e2fsck should fix on the first pass. +After the first pass, e2fsck should leave a fully consistent +filesystem with no detectable errors found in the second pass. The +exception is the okgroup.img filesystem, which contains no errors, and +so both exit codes should be 0. + +NOTE: It appears that at least some versions of the original e2fsck do +not exit with an exit status code of 1 after correcting filesystem +errors. So if you modify the test_script to try running these +filesystems against the original e2fsck, you will have to inspect the +test_script.log file manually. + +-------------------------------------------------------------- +Here's a one-line descriptions of the various test images in this +directory: + +baddir.img Filesystem with a corrupted directory +badbblocks.img Filesystem with illegal blocks in the bad block inode. +badinode.img Filesystem with various different corrupted inode + entries. +badlkcnt.img Filesystem with deleted files with non-zero link count +badroot.img Filesystem with a file for a root directory +badtable.img Filesystem with blocks shared between the bitmaps and + inode table blocks and the bad block inode +bbfile.img Filesystem with files containing bad blocks +bitmaps.img Filesystem with corrupted inode and block bitmaps +dirlink.img Filesystem with a hard link to a directory +dup.img Filesystem with blocks claimed by two different files +dup2.img Filesystem with blocks claimed by three different files +dupfsblks.img Filesystem with blocks claimed by a file and + inode/block bitmaps and inode tables +dupsuper.img Filesystem with blocks claimed by a file and + the superblock / group descriptors +end-bitmap.img Filesystem with corruption at the end of the block + bitmap +expand.img Tests e2fsck's ability to expand lost+found if + necessary +lpf.img Filesystem with disconnected files and no /lost+found + directory +mke2fs2b.img Filesystem with corruption similar to that + created by mke2fs version 0.2b +noroot.img Filesystem with a deleted root directory +okgroup.img Filesystem that's exactly 8193 blocks long + (otherwise OK) +overfsblks.img Filesystem with overlapping inode and block bitmaps +symlinks.img Filesystem with bad symlink sizes + + diff --git a/tests/d_bad_ostype/expect b/tests/d_bad_ostype/expect new file mode 100644 index 0000000..b00318c --- /dev/null +++ b/tests/d_bad_ostype/expect @@ -0,0 +1 @@ +Filesystem OS type: (unknown os) diff --git a/tests/d_bad_ostype/name b/tests/d_bad_ostype/name new file mode 100644 index 0000000..3da887a --- /dev/null +++ b/tests/d_bad_ostype/name @@ -0,0 +1 @@ +handle bad (negative) os_type diff --git a/tests/d_bad_ostype/script b/tests/d_bad_ostype/script new file mode 100644 index 0000000..fb4f68b --- /dev/null +++ b/tests/d_bad_ostype/script @@ -0,0 +1,21 @@ +dd if=/dev/zero of=$TMPFILE bs=1k count=64 > /dev/null 2>&1 +$MKE2FS -q -b 1024 -o hurd $TMPFILE +$DEBUGFS -w -R 'set_super_value creator_os 0xf0000000' $TMPFILE + +OUT=$test_name.log +EXP=$test_dir/expect +$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed | grep 'Filesystem OS type:' > $OUT + +rm -f $TMPFILE +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi +unset OUT EXP diff --git a/tests/d_corrupt_journal_nr_users/expect b/tests/d_corrupt_journal_nr_users/expect new file mode 100644 index 0000000..656d35c --- /dev/null +++ b/tests/d_corrupt_journal_nr_users/expect @@ -0,0 +1,101 @@ +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum +Default mount options: user_xattr acl +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 512 +Block count: 2048 +Reserved block count: 102 +Free blocks: 982 +Free inodes: 501 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Group descriptor size: 64 +Blocks per group: 32768 +Fragments per group: 32768 +Inodes per group: 512 +Inode blocks per group: 32 +Flex block group size: 16 +Mount count: 0 +Check interval: 0 (<none>) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Checksum type: crc32c +Journal features: (none) +Total journal size: 4096k +Total journal blocks: 1024 +Max transaction length: 1024 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 +Journal number of users: 9999 +Journal users: <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + <none> + + +Group 0: (Blocks 0-2047) + Primary superblock at 0, Group descriptors at 1-1 + Block bitmap at 2 (+2) + Inode bitmap at 18 (+18) + Inode table at 34-65 (+34) + 982 free blocks, 501 free inodes, 2 directories, 501 unused inodes + Free blocks: 1066-2047 + Free inodes: 12-512 diff --git a/tests/d_corrupt_journal_nr_users/image.gz b/tests/d_corrupt_journal_nr_users/image.gz Binary files differnew file mode 100644 index 0000000..1fc32ed --- /dev/null +++ b/tests/d_corrupt_journal_nr_users/image.gz diff --git a/tests/d_corrupt_journal_nr_users/name b/tests/d_corrupt_journal_nr_users/name new file mode 100644 index 0000000..24be3be --- /dev/null +++ b/tests/d_corrupt_journal_nr_users/name @@ -0,0 +1 @@ +journal superblock corrupted, nr_users too high diff --git a/tests/d_corrupt_journal_nr_users/script b/tests/d_corrupt_journal_nr_users/script new file mode 100644 index 0000000..683cd48 --- /dev/null +++ b/tests/d_corrupt_journal_nr_users/script @@ -0,0 +1,25 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +EXP=$test_dir/expect +OUT=$test_name.log +gunzip < $IMAGE > $TMPFILE + +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi diff --git a/tests/d_dumpe2fs_group_only/expect b/tests/d_dumpe2fs_group_only/expect new file mode 100644 index 0000000..52610e6 --- /dev/null +++ b/tests/d_dumpe2fs_group_only/expect @@ -0,0 +1,51 @@ +Creating filesystem with 1048576 4k blocks and 262144 inodes +Superblock backups stored on blocks: + 32768, 98304, 163840, 229376, 294912, 819200, 884736 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/262144 files (0.0% non-contiguous), 34894/1048576 blocks +Exit status is 0 +dumpe2fs output + +group:block:super:gdt:bbitmap:ibitmap:itable +0:0:0:1-1:257:273:289 +1:32768:32768:32769-32769:258:274:801 +2:65536:-1:-1:259:275:1313 +3:98304:98304:98305-98305:260:276:1825 +4:131072:-1:-1:261:277:2337 +5:163840:163840:163841-163841:262:278:2849 +6:196608:-1:-1:263:279:3361 +7:229376:229376:229377-229377:264:280:3873 +8:262144:-1:-1:265:281:4385 +9:294912:294912:294913-294913:266:282:4897 +10:327680:-1:-1:267:283:5409 +11:360448:-1:-1:268:284:5921 +12:393216:-1:-1:269:285:6433 +13:425984:-1:-1:270:286:6945 +14:458752:-1:-1:271:287:7457 +15:491520:-1:-1:272:288:7969 +16:524288:-1:-1:524288:524304:524320 +17:557056:-1:-1:524289:524305:524832 +18:589824:-1:-1:524290:524306:525344 +19:622592:-1:-1:524291:524307:525856 +20:655360:-1:-1:524292:524308:526368 +21:688128:-1:-1:524293:524309:526880 +22:720896:-1:-1:524294:524310:527392 +23:753664:-1:-1:524295:524311:527904 +24:786432:-1:-1:524296:524312:528416 +25:819200:819200:819201-819201:524297:524313:528928 +26:851968:-1:-1:524298:524314:529440 +27:884736:884736:884737-884737:524299:524315:529952 +28:917504:-1:-1:524300:524316:530464 +29:950272:-1:-1:524301:524317:530976 +30:983040:-1:-1:524302:524318:531488 +31:1015808:-1:-1:524303:524319:532000 diff --git a/tests/d_dumpe2fs_group_only/name b/tests/d_dumpe2fs_group_only/name new file mode 100644 index 0000000..096c020 --- /dev/null +++ b/tests/d_dumpe2fs_group_only/name @@ -0,0 +1 @@ +dumpe2fs group only mode diff --git a/tests/d_dumpe2fs_group_only/script b/tests/d_dumpe2fs_group_only/script new file mode 100644 index 0000000..01373b9 --- /dev/null +++ b/tests/d_dumpe2fs_group_only/script @@ -0,0 +1,44 @@ +if [ $(uname -s) = "Darwin" ]; then + # creates a 4GB filesystem + echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" + return 0 +fi + +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 1048576 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "dumpe2fs output" >> $OUT.new +$DUMPE2FS -g $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_fallocate/expect.gz b/tests/d_fallocate/expect.gz Binary files differnew file mode 100644 index 0000000..3e6ffc3 --- /dev/null +++ b/tests/d_fallocate/expect.gz diff --git a/tests/d_fallocate/name b/tests/d_fallocate/name new file mode 100644 index 0000000..72d0ed3 --- /dev/null +++ b/tests/d_fallocate/name @@ -0,0 +1 @@ +fallocate sparse files and big files diff --git a/tests/d_fallocate/script b/tests/d_fallocate/script new file mode 100644 index 0000000..36fa019 --- /dev/null +++ b/tests/d_fallocate/script @@ -0,0 +1,166 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP +else + EXP=$test_dir/expect +fi + +cat > $TMPFILE.conf << ENDL +[fs_types] +ext4 = { + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr,^has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit + blocksize = 1024 + inode_size = 256 + inode_ratio = 16384 +} +ENDL +MKE2FS_CONFIG=$TMPFILE.conf $MKE2FS -F -o Linux -b 1024 -O ^bigalloc -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 +rm -f $TMPFILE.conf + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write files" >> $OUT.new +make_file() { + name="$1" + start="$2" + flag="$3" + + cat << ENDL +write /dev/null $name +sif /$name size 40960 +eo /$name +set_bmap $flag 10 $((start + 10)) +set_bmap $flag 13 $((start + 13)) +set_bmap $flag 26 $((start + 26)) +set_bmap $flag 29 $((start + 29)) +ec +sif /$name blocks 8 +setb $((start + 10)) +setb $((start + 13)) +setb $((start + 26)) +setb $((start + 29)) +ENDL +} + +#Files we create: +# a: fallocate a 40k file +# b*: falloc sparse file starting at b* +# c*: falloc spare file ending at c* +# d: midcluster to midcluster, surrounding sparse +# e: partial middle cluster alloc +# f: one big file +# g*: falloc sparse init file starting at g* +# h*: falloc sparse init file ending at h* +# i: midcluster to midcluster, surrounding sparse init +# j: partial middle cluster alloc +# k: one big init file +base=5000 +cat > $TMPFILE.cmd << ENDL +write /dev/null a +sif /a size 40960 +fallocate /a 0 39 +ENDL +echo "ex /a" >> $TMPFILE.cmd2 + +make_file sample $base --uninit >> $TMPFILE.cmd +echo "ex /sample" >> $TMPFILE.cmd2 +base=10000 + +for i in 8 9 10 11 12 13 14 15; do + make_file b$i $(($base + (40 * ($i - 8)))) --uninit >> $TMPFILE.cmd + echo "fallocate /b$i $i 39" >> $TMPFILE.cmd + echo "ex /b$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file c$i $(($base + 320 + (40 * ($i - 24)))) --uninit >> $TMPFILE.cmd + echo "fallocate /c$i 0 $i" >> $TMPFILE.cmd + echo "ex /c$i" >> $TMPFILE.cmd2 +done + +make_file d $(($base + 640)) --uninit >> $TMPFILE.cmd +echo "fallocate /d 4 35" >> $TMPFILE.cmd +echo "ex /d" >> $TMPFILE.cmd2 + +make_file e $(($base + 680)) --uninit >> $TMPFILE.cmd +echo "fallocate /e 19 20" >> $TMPFILE.cmd +echo "ex /e" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null f +sif /f size 1024 +eo /f +set_bmap --uninit 0 9000 +ec +sif /f blocks 2 +setb 9000 +fallocate /f 0 8999 +ENDL +echo "ex /f" >> $TMPFILE.cmd2 + +# Now do it again, but with initialized blocks +base=20000 +for i in 8 9 10 11 12 13 14 15; do + make_file g$i $(($base + (40 * ($i - 8)))) >> $TMPFILE.cmd + echo "fallocate /g$i $i 39" >> $TMPFILE.cmd + echo "ex /g$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file h$i $(($base + 320 + (40 * ($i - 24)))) >> $TMPFILE.cmd + echo "fallocate /h$i 0 $i" >> $TMPFILE.cmd + echo "ex /h$i" >> $TMPFILE.cmd2 +done + +make_file i $(($base + 640)) >> $TMPFILE.cmd +echo "fallocate /i 4 35" >> $TMPFILE.cmd +echo "ex /i" >> $TMPFILE.cmd2 + +make_file j $(($base + 680)) >> $TMPFILE.cmd +echo "fallocate /j 19 20" >> $TMPFILE.cmd +echo "ex /j" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null k +sif /k size 1024 +eo /k +set_bmap 0 19000 +ec +sif /k blocks 2 +setb 19000 +fallocate /k 0 8999 +sif /k size 9216000 +ENDL +echo "ex /k" >> $TMPFILE.cmd2 + +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $TMPFILE.cmd2 $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi +rm -f $EXP + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_fallocate_bigalloc/expect.gz b/tests/d_fallocate_bigalloc/expect.gz Binary files differnew file mode 100644 index 0000000..167c069 --- /dev/null +++ b/tests/d_fallocate_bigalloc/expect.gz diff --git a/tests/d_fallocate_bigalloc/name b/tests/d_fallocate_bigalloc/name new file mode 100644 index 0000000..915645c --- /dev/null +++ b/tests/d_fallocate_bigalloc/name @@ -0,0 +1 @@ +fallocate sparse files and big files with bigalloc diff --git a/tests/d_fallocate_bigalloc/script b/tests/d_fallocate_bigalloc/script new file mode 100644 index 0000000..d4bf749 --- /dev/null +++ b/tests/d_fallocate_bigalloc/script @@ -0,0 +1,168 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP +else + EXP=$test_dir/expect +fi + +cat > $TMPFILE.conf << ENDL +[fs_types] +ext4 = { + cluster_size = 8192 + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr,^has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit + blocksize = 1024 + inode_size = 256 + inode_ratio = 16384 +} +ENDL +MKE2FS_CONFIG=$TMPFILE.conf $MKE2FS -F -o Linux -b 1024 -O bigalloc -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 +rm -f $TMPFILE.conf + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write files" >> $OUT.new +make_file() { + name="$1" + start="$2" + flag="$3" + + cat << ENDL +write /dev/null $name +sif /$name size 40960 +eo /$name +set_bmap $flag 10 $((start + 10)) +set_bmap $flag 13 $((start + 13)) +set_bmap $flag 26 $((start + 26)) +set_bmap $flag 29 $((start + 29)) +ec +sif /$name blocks 32 +setb $((start + 10)) +setb $((start + 13)) +setb $((start + 26)) +setb $((start + 29)) +ENDL +} + +#Files we create: +# a: fallocate a 40k file +# b*: falloc sparse file starting at b* +# c*: falloc spare file ending at c* +# d: midcluster to midcluster, surrounding sparse +# e: partial middle cluster alloc +# f: one big file +# g*: falloc sparse init file starting at g* +# h*: falloc sparse init file ending at h* +# i: midcluster to midcluster, surrounding sparse init +# j: partial middle cluster alloc +# k: one big init file +base=5000 +cat > $TMPFILE.cmd << ENDL +write /dev/null a +sif /a size 40960 +fallocate /a 0 39 +ENDL +echo "ex /a" >> $TMPFILE.cmd2 + +make_file sample $base --uninit >> $TMPFILE.cmd +echo "ex /sample" >> $TMPFILE.cmd2 +base=10000 + +for i in 8 9 10 11 12 13 14 15; do + make_file b$i $(($base + (40 * ($i - 8)))) --uninit >> $TMPFILE.cmd + echo "fallocate /b$i $i 39" >> $TMPFILE.cmd + echo "ex /b$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file c$i $(($base + 320 + (40 * ($i - 24)))) --uninit >> $TMPFILE.cmd + echo "fallocate /c$i 0 $i" >> $TMPFILE.cmd + echo "ex /c$i" >> $TMPFILE.cmd2 +done + +make_file d $(($base + 640)) --uninit >> $TMPFILE.cmd +echo "fallocate /d 4 35" >> $TMPFILE.cmd +echo "ex /d" >> $TMPFILE.cmd2 + +make_file e $(($base + 680)) --uninit >> $TMPFILE.cmd +echo "fallocate /e 19 20" >> $TMPFILE.cmd +echo "ex /e" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null f +sif /f size 1024 +eo /f +set_bmap --uninit 0 9000 +ec +sif /f blocks 16 +setb 9000 +fallocate /f 0 8999 +ENDL +echo "ex /f" >> $TMPFILE.cmd2 + +# Now do it again, but with initialized blocks +base=20000 +for i in 8 9 10 11 12 13 14 15; do + make_file g$i $(($base + (40 * ($i - 8)))) >> $TMPFILE.cmd + echo "fallocate /g$i $i 39" >> $TMPFILE.cmd + echo "ex /g$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file h$i $(($base + 320 + (40 * ($i - 24)))) >> $TMPFILE.cmd + echo "fallocate /h$i 0 $i" >> $TMPFILE.cmd + echo "ex /h$i" >> $TMPFILE.cmd2 +done + +make_file i $(($base + 640)) >> $TMPFILE.cmd +echo "fallocate /i 4 35" >> $TMPFILE.cmd +echo "ex /i" >> $TMPFILE.cmd2 + +make_file j $(($base + 680)) >> $TMPFILE.cmd +echo "fallocate /j 19 20" >> $TMPFILE.cmd +echo "ex /j" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null k +sif /k size 1024 +eo /k +set_bmap 0 19000 +ec +sif /k blocks 16 +setb 19000 +fallocate /k 0 8999 +sif /k size 9216000 +ENDL +echo "ex /k" >> $TMPFILE.cmd2 + +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $TMPFILE.cmd2 $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi +rm -f $EXP + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_fallocate_blkmap/expect b/tests/d_fallocate_blkmap/expect new file mode 100644 index 0000000..f588511 --- /dev/null +++ b/tests/d_fallocate_blkmap/expect @@ -0,0 +1,58 @@ +Creating filesystem with 65536 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +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: 11/4096 files (0.0% non-contiguous), 2340/65536 blocks +Exit status is 0 +debugfs write files +debugfs: stat /a +Inode: 12 Type: regular Mode: 0666 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 40960 +File ACL: 0 +Links: 1 Blockcount: 82 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +BLOCKS: +(0-1):1312-1313, (2-11):8000-8009, (IND):8010, (12-39):8011-8038 +TOTAL: 41 + +debugfs: stat /b +Inode: 13 Type: regular Mode: 0666 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 10240000 +File ACL: 0 +Links: 1 Blockcount: 20082 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +BLOCKS: +(0-11):10000-10011, (IND):10012, (12-267):10013-10268, (DIND):10269, (IND):10270, (268-523):10271-10526, (IND):10527, (524-779):10528-10783, (IND):10784, (780-1035):10785-11040, (IND):11041, (1036-1291):11042-11297, (IND):11298, (1292-1547):11299-11554, (IND):11555, (1548-1803):11556-11811, (IND):11812, (1804-2059):11813-12068, (IND):12069, (2060-2315):12070-12325, (IND):12326, (2316-2571):12327-12582, (IND):12583, (2572-2827):12584-12839, (IND):12840, (2828-3083):12841-13096, (IND):13097, (3084-3339):13098-13353, (IND):13354, (3340-3595):13355-13610, (IND):13611, (3596-3851):13612-13867, (IND):13868, (3852-4107):13869-14124, (IND):14125, (4108-4363):14126-14381, (IND):14382, (4364-4619):14383-14638, (IND):14639, (4620-4875):14640-14895, (IND):14896, (4876-5131):14897-15152, (IND):15153, (5132-5387):15154-15409, (IND):15410, (5388-5643):15411-15666, (IND):15667, (5644-5899):15668-15923, (IND):15924, (5900-6155):15925-16180, (IND):16181, (6156-6411):16182-16437, (IND):16438, (6412-6667):16439-16694, (IND):16695, (6668-6923):16696-16951, (IND):16952, (6924-7179):16953-17208, (IND):17209, (7180-7435):17210-17465, (IND):17466, (7436-7691):17467-17722, (IND):17723, (7692-7947):17724-17979, (IND):17980, (7948-8203):17981-18236, (IND):18237, (8204-8459):18238-18493, (IND):18494, (8460-8715):18495-18750, (IND):18751, (8716-8971):18752-19007, (IND):19008, (8972-9227):19009-19264, (IND):19265, (9228-9483):19266-19521, (IND):19522, (9484-9739):19523-19778, (IND):19779, (9740-9995):19780-20035, (IND):20036, (9996-9999):20037-20040 +TOTAL: 10041 + +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 +Free blocks count wrong for group #0 (6841, counted=6840). +Fix? yes + +Free blocks count wrong for group #1 (1551, counted=1550). +Fix? yes + +Free blocks count wrong (53116, counted=53114). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/4096 files (7.7% non-contiguous), 12422/65536 blocks +Exit status is 1 diff --git a/tests/d_fallocate_blkmap/name b/tests/d_fallocate_blkmap/name new file mode 100644 index 0000000..ba2b61d --- /dev/null +++ b/tests/d_fallocate_blkmap/name @@ -0,0 +1 @@ +fallocate sparse files and big files on a blockmap fs diff --git a/tests/d_fallocate_blkmap/script b/tests/d_fallocate_blkmap/script new file mode 100644 index 0000000..2ec319f --- /dev/null +++ b/tests/d_fallocate_blkmap/script @@ -0,0 +1,75 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +cat > $TMPFILE.conf << ENDL +[fs_types] +ext4 = { + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr,^has_journal,^extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,^64bit + blocksize = 1024 + inode_size = 256 + inode_ratio = 16384 +} +ENDL +MKE2FS_CONFIG=$TMPFILE.conf $MKE2FS -F -o Linux -b 1024 -O ^bigalloc -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 +rm -f $TMPFILE.conf + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write files" >> $OUT.new +#Files we create: +# a: fallocate a 40k file +# k: one big file +base=5000 +cat > $TMPFILE.cmd << ENDL +write /dev/null a +sif /a bmap[2] 8000 +sif /a size 40960 +sif /a i_blocks 2 +setb 8000 +fallocate /a 0 39 + +write /dev/null b +sif /b size 10240000 +sif /b bmap[0] 10000 +sif /b i_blocks 2 +setb 10000 +fallocate /b 0 9999 +ENDL +echo "stat /a" >> $TMPFILE.cmd2 +echo "stat /b" >> $TMPFILE.cmd2 + +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e '/^.*time:.*$/d' $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $TMPFILE.cmd2 $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_inline_dump/expect b/tests/d_inline_dump/expect new file mode 100644 index 0000000..db9d522 --- /dev/null +++ b/tests/d_inline_dump/expect @@ -0,0 +1,95 @@ +*** long file +Inode: 13 Type: regular Mode: 0644 Flags: 0x10000000 +Generation: 3289262644 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 80 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec6b4:c72e3c00 -- Tue Jul 22 20:16:52 2014 + atime: 0x53cec3c8:4a3fd000 -- Tue Jul 22 20:04:24 2014 + mtime: 0x53cec3c8:4c281800 -- Tue Jul 22 20:04:24 2014 +crtime: 0x53cec3c8:4a3fd000 -- Tue Jul 22 20:04:24 2014 +Size of extra inode fields: 28 +Extended attributes: + system.data (20) + user.a (1) = "b" +Size of inline data: 80 +*** short file +Inode: 18 Type: regular Mode: 0644 Flags: 0x10000000 +Generation: 3842229473 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 20 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec6b4:cafecc00 -- Tue Jul 22 20:16:52 2014 + atime: 0x53cec443:bda4d400 -- Tue Jul 22 20:06:27 2014 + mtime: 0x53cec443:bf8d1c00 -- Tue Jul 22 20:06:27 2014 +crtime: 0x53cec443:bda4d400 -- Tue Jul 22 20:06:27 2014 +Size of extra inode fields: 28 +Extended attributes: + system.data (0) + user.a (1) = "b" +Size of inline data: 60 + +*** long dir +Inode: 16 Type: directory Mode: 0755 Flags: 0x10000000 +Generation: 3842229469 Version: 0x00000000:00000004 +User: 0 Group: 0 Size: 132 +File ACL: 7 +Links: 2 Blockcount: 8 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec6e3:27eac000 -- Tue Jul 22 20:17:39 2014 + atime: 0x53cec410:ed53dc00 -- Tue Jul 22 20:05:36 2014 + mtime: 0x53cec42b:241a3000 -- Tue Jul 22 20:06:03 2014 +crtime: 0x53cec3fe:c8226000 -- Tue Jul 22 20:05:18 2014 +Size of extra inode fields: 28 +Extended attributes: + system.data (72) + user.a (1) = "b" +Size of inline data: 132 +*** short dir +Inode: 20 Type: directory Mode: 0755 Flags: 0x10000000 +Generation: 3710818931 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 60 +File ACL: 0 +Links: 2 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec6b4:ca0aa800 -- Tue Jul 22 20:16:52 2014 + atime: 0x53cec477:9a5ba000 -- Tue Jul 22 20:07:19 2014 + mtime: 0x53cec477:9a5ba000 -- Tue Jul 22 20:07:19 2014 +crtime: 0x53cec477:9a5ba000 -- Tue Jul 22 20:07:19 2014 +Size of extra inode fields: 28 +Extended attributes: + system.data (0) + user.a (1) = "b" +Size of inline data: 60 + +*** long link +Inode: 12 Type: symlink Mode: 0777 Flags: 0x10000000 +Generation: 3289262643 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 80 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec47f:724db800 -- Tue Jul 22 20:07:27 2014 + atime: 0x53cec665:27eac000 -- Tue Jul 22 20:15:33 2014 + mtime: 0x53cec3b6:82841c00 -- Tue Jul 22 20:04:06 2014 +crtime: 0x53cec3b6:82841c00 -- Tue Jul 22 20:04:06 2014 +Size of extra inode fields: 28 +Extended attributes: + system.data (20) +Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +*** short link +Inode: 19 Type: symlink Mode: 0777 Flags: 0x0 +Generation: 3842229474 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 20 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x53cec44c:a1fcc000 -- Tue Jul 22 20:06:36 2014 + atime: 0x53cec44d:11fb8400 -- Tue Jul 22 20:06:37 2014 + mtime: 0x53cec44c:a1fcc000 -- Tue Jul 22 20:06:36 2014 +crtime: 0x53cec44c:a1fcc000 -- Tue Jul 22 20:06:36 2014 +Size of extra inode fields: 28 +Fast link dest: "xxxxxxxxxxxxxxxxxxxx" +*** end test diff --git a/tests/d_inline_dump/image.gz b/tests/d_inline_dump/image.gz Binary files differnew file mode 100644 index 0000000..598a495 --- /dev/null +++ b/tests/d_inline_dump/image.gz diff --git a/tests/d_inline_dump/name b/tests/d_inline_dump/name new file mode 100644 index 0000000..dfc1a9c --- /dev/null +++ b/tests/d_inline_dump/name @@ -0,0 +1 @@ +debugfs dump inline data test diff --git a/tests/d_inline_dump/script b/tests/d_inline_dump/script new file mode 100644 index 0000000..3193f78 --- /dev/null +++ b/tests/d_inline_dump/script @@ -0,0 +1,43 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf + +ZIMAGE=$test_dir/image.gz +gzip -d < $ZIMAGE > $TMPFILE + +echo "*** long file" > $OUT +$DEBUGFS -R 'stat /file' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short file" >> $OUT +$DEBUGFS -R 'stat /shortfile' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo >> $OUT + +echo "*** long dir" >> $OUT +$DEBUGFS -R 'stat /dir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short dir" >> $OUT +$DEBUGFS -R 'stat /shortdir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo >> $OUT + +echo "*** long link" >> $OUT +$DEBUGFS -R 'stat /link' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 +echo "*** short link" >> $OUT +$DEBUGFS -R 'stat /shortlink' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1 + +echo "*** end test" >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE diff --git a/tests/d_loaddump/expect b/tests/d_loaddump/expect new file mode 100644 index 0000000..de90526 --- /dev/null +++ b/tests/d_loaddump/expect @@ -0,0 +1,18 @@ +debugfs load/dump test +mke2fs -Fq -b 1024 test.img 512 +Exit status is 0 +debugfs -R ''write d_loaddump.tmp test_data'' -w test.img +Allocated inode: 12 +Exit status is 0 +e2fsck -yf -N test_filesys +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/64 files (0.0% non-contiguous), 166/512 blocks +Exit status is 0 +debugfs -R ''dump test_data d_loaddump.ver.tmp'' test.img +Exit status is 0 +cmp d_loaddump.tmp d_loaddump.ver.tmp +Exit status is 0 diff --git a/tests/d_loaddump/name b/tests/d_loaddump/name new file mode 100644 index 0000000..025ec3b --- /dev/null +++ b/tests/d_loaddump/name @@ -0,0 +1 @@ +debugfs load/dump test diff --git a/tests/d_loaddump/script b/tests/d_loaddump/script new file mode 100644 index 0000000..ace3372 --- /dev/null +++ b/tests/d_loaddump/script @@ -0,0 +1,67 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf + +TEST_DATA=$test_name.tmp +VERIFY_DATA=$test_name.ver.tmp + +echo "debugfs load/dump test" > $OUT.new + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT.new + +$MKE2FS -Fq -b 1024 $TMPFILE 512 > /dev/null 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +dd if=$TEST_BITS of=$TEST_DATA bs=128k count=1 conv=sync > /dev/null 2>&1 +echo "file fragment odd size" >> $TEST_DATA + +echo "debugfs -R ''write $TEST_DATA test_data'' -w test.img" >> $OUT.new +$DEBUGFS -R "write $TEST_DATA test_data" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo e2fsck $VERIFY_FSCK_OPT -N test_filesys >> $OUT.new +$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''dump test_data $VERIFY_DATA'' test.img" >> $OUT.new +$DEBUGFS -R "dump test_data $VERIFY_DATA" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cmp $TEST_DATA $VERIFY_DATA" >> $OUT.new +cmp $TEST_DATA $VERIFY_DATA >>$OUT.new +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT + +# +# Do the verification +# + +if [ "$SKIP_UNLINK" != "true" ]; then + rm -f $VERIFY_DATA $TEST_DATA $TMPFILE $OUT.new +else + echo "TMPFILE=$TMPFILE" +fi +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA diff --git a/tests/d_punch/expect b/tests/d_punch/expect new file mode 100644 index 0000000..b13462b --- /dev/null +++ b/tests/d_punch/expect @@ -0,0 +1,176 @@ +Creating filesystem with 65536 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +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: 11/4096 files (0.0% non-contiguous), 2345/65536 blocks +Exit status is 0 +debugfs write files +debugfs: ex /a +Level Entries Logical Physical Length Flags +debugfs: ex /sample +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1323 0 + 1/ 1 1/ 5 0 - 9 1313 - 1322 10 Uninit + 1/ 1 2/ 5 11 - 12 1324 - 1325 2 Uninit + 1/ 1 3/ 5 14 - 25 1327 - 1338 12 Uninit + 1/ 1 4/ 5 27 - 28 1340 - 1341 2 Uninit + 1/ 1 5/ 5 30 - 39 1343 - 1352 10 Uninit +debugfs: ex /b8 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1390 0 + 1/ 1 1/ 4 0 - 0 1326 - 1326 1 Uninit + 1/ 1 2/ 4 1 - 1 1339 - 1339 1 Uninit + 1/ 1 3/ 4 2 - 2 1342 - 1342 1 Uninit + 1/ 1 4/ 4 3 - 7 1353 - 1357 5 Uninit +debugfs: ex /b9 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1368 0 + 1/ 1 1/ 1 0 - 8 1358 - 1366 9 Uninit +debugfs: ex /b10 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1378 0 + 1/ 1 1/ 2 0 - 0 1367 - 1367 1 Uninit + 1/ 1 2/ 2 1 - 9 1369 - 1377 9 Uninit +debugfs: ex /b11 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1389 0 + 1/ 1 1/ 1 0 - 9 1379 - 1388 10 Uninit +debugfs: ex /b12 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1401 0 + 1/ 1 1/ 2 0 - 9 1391 - 1400 10 Uninit + 1/ 1 2/ 2 11 - 11 1402 - 1402 1 Uninit +debugfs: ex /b13 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1413 0 + 1/ 1 1/ 2 0 - 9 1403 - 1412 10 Uninit + 1/ 1 2/ 2 11 - 12 1414 - 1415 2 Uninit +debugfs: ex /b14 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1426 0 + 1/ 1 1/ 2 0 - 9 1416 - 1425 10 Uninit + 1/ 1 2/ 2 11 - 12 1427 - 1428 2 Uninit +debugfs: ex /b15 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1439 0 + 1/ 1 1/ 3 0 - 9 1429 - 1438 10 Uninit + 1/ 1 2/ 3 11 - 12 1440 - 1441 2 Uninit + 1/ 1 3/ 3 14 - 14 1443 - 1443 1 Uninit +debugfs: ex /c24 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 25 - 4294967295 1453 4294967271 + 1/ 1 1/ 3 25 - 25 1468 - 1468 1 Uninit + 1/ 1 2/ 3 27 - 28 1470 - 1471 2 Uninit + 1/ 1 3/ 3 30 - 39 1473 - 1482 10 Uninit +debugfs: ex /c25 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 27 - 4294967295 1483 4294967269 + 1/ 1 1/ 2 27 - 28 1485 - 1486 2 Uninit + 1/ 1 2/ 2 30 - 39 1488 - 1497 10 Uninit +debugfs: ex /c26 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 27 - 4294967295 1484 4294967269 + 1/ 1 1/ 2 27 - 28 1498 - 1499 2 Uninit + 1/ 1 2/ 2 30 - 39 1501 - 1510 10 Uninit +debugfs: ex /c27 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 28 - 4294967295 1487 4294967268 + 1/ 1 1/ 2 28 - 28 1512 - 1512 1 Uninit + 1/ 1 2/ 2 30 - 39 1514 - 1523 10 Uninit +debugfs: ex /c28 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 30 - 4294967295 1500 4294967266 + 1/ 1 1/ 1 30 - 39 1526 - 1535 10 Uninit +debugfs: ex /c29 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 30 - 4294967295 1511 4294967266 + 1/ 1 1/ 1 30 - 39 1537 - 1546 10 Uninit +debugfs: ex /c30 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 31 - 4294967295 1513 4294967265 + 1/ 1 1/ 1 31 - 39 1549 - 1557 9 Uninit +debugfs: ex /c31 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 32 - 4294967295 1524 4294967264 + 1/ 1 1/ 1 32 - 39 1560 - 1567 8 Uninit +debugfs: ex /d +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1525 0 + 1/ 1 1/ 3 0 - 0 1442 - 1442 1 Uninit + 1/ 1 2/ 3 1 - 3 1444 - 1446 3 Uninit + 1/ 1 3/ 3 36 - 39 1573 - 1576 4 Uninit +debugfs: ex /e +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1547 0 + 1/ 1 1/ 11 0 - 5 1447 - 1452 6 Uninit + 1/ 1 2/ 11 6 - 9 1454 - 1457 4 Uninit + 1/ 1 3/ 11 11 - 12 1459 - 1460 2 Uninit + 1/ 1 4/ 11 14 - 18 1462 - 1466 5 Uninit + 1/ 1 5/ 11 21 - 21 1472 - 1472 1 Uninit + 1/ 1 6/ 11 22 - 22 1536 - 1536 1 Uninit + 1/ 1 7/ 11 23 - 23 1548 - 1548 1 Uninit + 1/ 1 8/ 11 24 - 25 1558 - 1559 2 Uninit + 1/ 1 9/ 11 27 - 28 1569 - 1570 2 Uninit + 1/ 1 10/ 11 30 - 30 1572 - 1572 1 Uninit + 1/ 1 11/ 11 31 - 39 1577 - 1585 9 Uninit +debugfs: ex /f +Level Entries Logical Physical Length Flags + 0/ 0 1/ 2 0 - 0 9000 - 9000 1 Uninit + 0/ 0 2/ 2 8999 - 8999 17999 - 17999 1 Uninit +Pass 1: Checking inodes, blocks, and sizes +Inode 15 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 16 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 17 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 18 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 19 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 20 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 21 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 22 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 23 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 24 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 25 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 26 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 27 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 28 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 29 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 30 extent tree (at level 1) could be shorter. Optimize? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #1 (7934, counted=7933). +Fix? yes + +Free blocks count wrong (62939, counted=62938). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 32/4096 files (43.8% non-contiguous), 2598/65536 blocks +Exit status is 1 diff --git a/tests/d_punch/name b/tests/d_punch/name new file mode 100644 index 0000000..724639f --- /dev/null +++ b/tests/d_punch/name @@ -0,0 +1 @@ +punch sparse files and big files diff --git a/tests/d_punch/script b/tests/d_punch/script new file mode 100644 index 0000000..e0eee76 --- /dev/null +++ b/tests/d_punch/script @@ -0,0 +1,120 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +cat > $TMPFILE.conf << ENDL +[fs_types] +ext4 = { + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr,^has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit + blocksize = 1024 + inode_size = 256 + inode_ratio = 16384 +} +ENDL +MKE2FS_CONFIG=$TMPFILE.conf $MKE2FS -F -o Linux -b 1024 -O ^bigalloc -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 +rm -f $TMPFILE.conf + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write files" >> $OUT.new +make_file() { + name="$1" + start="$2" + flag="$3" + + cat << ENDL +write /dev/null $name +fallocate /$name 0 39 +punch /$name 10 10 +punch /$name 13 13 +punch /$name 26 26 +punch /$name 29 29 +ENDL +} + +#Files we create: +# a: punch a 40k file +# b*: punch sparse file starting at b* +# c*: punch spare file ending at c* +# d: midcluster to midcluster, surrounding sparse +# e: partial middle cluster alloc +# f: one big file +base=5000 +cat > $TMPFILE.cmd << ENDL +write /dev/null a +fallocate /a 0 39 +punch /a 0 39 +ENDL +echo "ex /a" >> $TMPFILE.cmd2 + +make_file sample $base --uninit >> $TMPFILE.cmd +echo "ex /sample" >> $TMPFILE.cmd2 +base=10000 + +for i in 8 9 10 11 12 13 14 15; do + make_file b$i $(($base + (40 * ($i - 8)))) --uninit >> $TMPFILE.cmd + echo "punch /b$i $i 39" >> $TMPFILE.cmd + echo "ex /b$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file c$i $(($base + 320 + (40 * ($i - 24)))) --uninit >> $TMPFILE.cmd + echo "punch /c$i 0 $i" >> $TMPFILE.cmd + echo "ex /c$i" >> $TMPFILE.cmd2 +done + +make_file d $(($base + 640)) --uninit >> $TMPFILE.cmd +echo "punch /d 4 35" >> $TMPFILE.cmd +echo "ex /d" >> $TMPFILE.cmd2 + +make_file e $(($base + 680)) --uninit >> $TMPFILE.cmd +echo "punch /e 19 20" >> $TMPFILE.cmd +echo "ex /e" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null f +sif /f size 1024 +eo /f +set_bmap --uninit 0 9000 +ec +sif /f blocks 2 +setb 9000 +fallocate /f 0 8999 +punch /f 1 8998 +ENDL +echo "ex /f" >> $TMPFILE.cmd2 + +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $TMPFILE.cmd2 $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_punch_bigalloc/expect b/tests/d_punch_bigalloc/expect new file mode 100644 index 0000000..be841e6 --- /dev/null +++ b/tests/d_punch_bigalloc/expect @@ -0,0 +1,171 @@ +Creating filesystem with 65536 1k blocks and 4096 inodes + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +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: 11/4096 files (9.1% non-contiguous), 1144/65536 blocks +Exit status is 0 +debugfs write files +debugfs: ex /a +Level Entries Logical Physical Length Flags +debugfs: ex /sample +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1184 0 + 1/ 1 1/ 5 0 - 9 1144 - 1153 10 Uninit + 1/ 1 2/ 5 11 - 12 1155 - 1156 2 Uninit + 1/ 1 3/ 5 14 - 25 1158 - 1169 12 Uninit + 1/ 1 4/ 5 27 - 28 1171 - 1172 2 Uninit + 1/ 1 5/ 5 30 - 39 1174 - 1183 10 Uninit +debugfs: ex /b8 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1232 0 + 1/ 1 1/ 1 0 - 7 1192 - 1199 8 Uninit +debugfs: ex /b9 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1248 0 + 1/ 1 1/ 1 0 - 8 1200 - 1208 9 Uninit +debugfs: ex /b10 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1272 0 + 1/ 1 1/ 1 0 - 9 1216 - 1225 10 Uninit +debugfs: ex /b11 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1296 0 + 1/ 1 1/ 2 0 - 7 1240 - 1247 8 Uninit + 1/ 1 2/ 2 8 - 9 1256 - 1257 2 Uninit +debugfs: ex /b12 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1320 0 + 1/ 1 1/ 3 0 - 7 1264 - 1271 8 Uninit + 1/ 1 2/ 3 8 - 9 1280 - 1281 2 Uninit + 1/ 1 3/ 3 11 - 11 1283 - 1283 1 Uninit +debugfs: ex /b13 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1344 0 + 1/ 1 1/ 3 0 - 7 1288 - 1295 8 Uninit + 1/ 1 2/ 3 8 - 9 1304 - 1305 2 Uninit + 1/ 1 3/ 3 11 - 12 1307 - 1308 2 Uninit +debugfs: ex /b14 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1368 0 + 1/ 1 1/ 3 0 - 7 1312 - 1319 8 Uninit + 1/ 1 2/ 3 8 - 9 1328 - 1329 2 Uninit + 1/ 1 3/ 3 11 - 12 1331 - 1332 2 Uninit +debugfs: ex /b15 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1392 0 + 1/ 1 1/ 4 0 - 7 1336 - 1343 8 Uninit + 1/ 1 2/ 4 8 - 9 1352 - 1353 2 Uninit + 1/ 1 3/ 4 11 - 12 1355 - 1356 2 Uninit + 1/ 1 4/ 4 14 - 14 1358 - 1358 1 Uninit +debugfs: ex /c24 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 25 - 4294967295 1416 4294967271 + 1/ 1 1/ 3 25 - 25 1401 - 1401 1 Uninit + 1/ 1 2/ 3 27 - 28 1403 - 1404 2 Uninit + 1/ 1 3/ 3 30 - 39 1406 - 1415 10 Uninit +debugfs: ex /c25 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 27 - 4294967295 1440 4294967269 + 1/ 1 1/ 2 27 - 28 1427 - 1428 2 Uninit + 1/ 1 2/ 2 30 - 39 1430 - 1439 10 Uninit +debugfs: ex /c26 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 27 - 4294967295 1464 4294967269 + 1/ 1 1/ 2 27 - 28 1451 - 1452 2 Uninit + 1/ 1 2/ 2 30 - 39 1454 - 1463 10 Uninit +debugfs: ex /c27 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 28 - 4294967295 1488 4294967268 + 1/ 1 1/ 2 28 - 28 1476 - 1476 1 Uninit + 1/ 1 2/ 2 30 - 39 1478 - 1487 10 Uninit +debugfs: ex /c28 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 30 - 4294967295 1512 4294967266 + 1/ 1 1/ 1 30 - 39 1502 - 1511 10 Uninit +debugfs: ex /c29 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 30 - 4294967295 1536 4294967266 + 1/ 1 1/ 1 30 - 39 1526 - 1535 10 Uninit +debugfs: ex /c30 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 31 - 4294967295 1560 4294967265 + 1/ 1 1/ 1 31 - 39 1551 - 1559 9 Uninit +debugfs: ex /c31 +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 32 - 4294967295 1584 4294967264 + 1/ 1 1/ 1 32 - 39 1576 - 1583 8 Uninit +debugfs: ex /d +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1600 0 + 1/ 1 1/ 2 0 - 3 1360 - 1363 4 Uninit + 1/ 1 2/ 2 36 - 39 1596 - 1599 4 Uninit +debugfs: ex /e +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 4294967295 1624 0 + 1/ 1 1/ 8 0 - 9 1376 - 1385 10 Uninit + 1/ 1 2/ 8 11 - 12 1387 - 1388 2 Uninit + 1/ 1 3/ 8 14 - 15 1390 - 1391 2 Uninit + 1/ 1 4/ 8 16 - 18 1568 - 1570 3 Uninit + 1/ 1 5/ 8 21 - 23 1573 - 1575 3 Uninit + 1/ 1 6/ 8 24 - 25 1608 - 1609 2 Uninit + 1/ 1 7/ 8 27 - 28 1611 - 1612 2 Uninit + 1/ 1 8/ 8 30 - 39 1614 - 1623 10 Uninit +debugfs: ex /f +Level Entries Logical Physical Length Flags + 0/ 0 1/ 2 0 - 0 9000 - 9000 1 Uninit + 0/ 0 2/ 2 8999 - 8999 17999 - 17999 1 Uninit +Pass 1: Checking inodes, blocks, and sizes +Inode 14 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 15 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 16 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 17 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 18 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 19 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 20 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 22 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 23 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 24 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 25 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 26 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 27 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 28 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 29 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 30 extent tree (at level 1) could be shorter. Optimize? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (8003, counted=8002). +Fix? yes + +Free blocks count wrong (64024, counted=64016). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 32/4096 files (43.8% non-contiguous), 1520/65536 blocks +Exit status is 1 diff --git a/tests/d_punch_bigalloc/name b/tests/d_punch_bigalloc/name new file mode 100644 index 0000000..6d61ebe --- /dev/null +++ b/tests/d_punch_bigalloc/name @@ -0,0 +1 @@ +punch sparse files and big files with bigalloc diff --git a/tests/d_punch_bigalloc/script b/tests/d_punch_bigalloc/script new file mode 100644 index 0000000..73eee46 --- /dev/null +++ b/tests/d_punch_bigalloc/script @@ -0,0 +1,121 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +cat > $TMPFILE.conf << ENDL +[fs_types] +ext4 = { + cluster_size = 8192 + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr,^has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit + blocksize = 1024 + inode_size = 256 + inode_ratio = 16384 +} +ENDL +MKE2FS_CONFIG=$TMPFILE.conf $MKE2FS -F -o Linux -b 1024 -O bigalloc -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 +rm -f $TMPFILE.conf + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write files" >> $OUT.new +make_file() { + name="$1" + start="$2" + flag="$3" + + cat << ENDL +write /dev/null $name +fallocate /$name 0 39 +punch /$name 10 10 +punch /$name 13 13 +punch /$name 26 26 +punch /$name 29 29 +ENDL +} + +#Files we create: +# a: punch a 40k file +# b*: punch sparse file starting at b* +# c*: punch spare file ending at c* +# d: midcluster to midcluster, surrounding sparse +# e: partial middle cluster alloc +# f: one big file +base=5000 +cat > $TMPFILE.cmd << ENDL +write /dev/null a +fallocate /a 0 39 +punch /a 0 39 +ENDL +echo "ex /a" >> $TMPFILE.cmd2 + +make_file sample $base --uninit >> $TMPFILE.cmd +echo "ex /sample" >> $TMPFILE.cmd2 +base=10000 + +for i in 8 9 10 11 12 13 14 15; do + make_file b$i $(($base + (40 * ($i - 8)))) --uninit >> $TMPFILE.cmd + echo "punch /b$i $i 39" >> $TMPFILE.cmd + echo "ex /b$i" >> $TMPFILE.cmd2 +done + +for i in 24 25 26 27 28 29 30 31; do + make_file c$i $(($base + 320 + (40 * ($i - 24)))) --uninit >> $TMPFILE.cmd + echo "punch /c$i 0 $i" >> $TMPFILE.cmd + echo "ex /c$i" >> $TMPFILE.cmd2 +done + +make_file d $(($base + 640)) --uninit >> $TMPFILE.cmd +echo "punch /d 4 35" >> $TMPFILE.cmd +echo "ex /d" >> $TMPFILE.cmd2 + +make_file e $(($base + 680)) --uninit >> $TMPFILE.cmd +echo "punch /e 19 20" >> $TMPFILE.cmd +echo "ex /e" >> $TMPFILE.cmd2 + +cat >> $TMPFILE.cmd << ENDL +write /dev/null f +sif /f size 1024 +eo /f +set_bmap --uninit 0 9000 +ec +sif /f blocks 16 +setb 9000 +fallocate /f 0 8999 +punch /f 1 8998 +ENDL +echo "ex /f" >> $TMPFILE.cmd2 + +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE > /dev/null 2>&1 +$DEBUGFS -f $TMPFILE.cmd2 $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $TMPFILE.cmd2 $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/d_special_files/expect b/tests/d_special_files/expect new file mode 100644 index 0000000..a4761f1 --- /dev/null +++ b/tests/d_special_files/expect @@ -0,0 +1,91 @@ +debugfs create special files +mke2fs -Fq -b 1024 test.img 512 +Exit status is 0 +debugfs -R ''stat foo'' -w test.img +Inode: 12 Type: symlink Mode: 0777 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 3 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + atime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + mtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +crtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +Size of extra inode fields: 32 +Fast link dest: "bar" +Exit status is 0 +debugfs -R ''stat foo2'' -w test.img +Inode: 13 Type: symlink Mode: 0777 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 80 +File ACL: 0 +Links: 1 Blockcount: 2 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + atime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + mtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +crtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +Size of extra inode fields: 32 +BLOCKS: +(0):36 +TOTAL: 1 + +Exit status is 0 +debugfs -R ''block_dump 28'' -w test.img +0000 0000 0000 0004 0000 0000 0000 0000 0000 ................ +0020 0000 0000 0000 0000 0000 0000 0000 0000 ................ +* + +Exit status is 0 +debugfs -R ''stat pipe'' -w test.img +Inode: 14 Type: FIFO Mode: 0000 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 0 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + atime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + mtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +crtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +Size of extra inode fields: 32 +BLOCKS: + +Exit status is 0 +debugfs -R ''stat sda'' -w test.img +Inode: 15 Type: block special Mode: 0000 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 0 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + atime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + mtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +crtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +Size of extra inode fields: 32 +Device major/minor number: 08:00 (hex 08:00) +Exit status is 0 +debugfs -R ''stat null'' -w test.img +Inode: 16 Type: character special Mode: 0000 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 0 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + atime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 + mtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +crtime: 0x50f560e0:00000000 -- Tue Jan 15 14:00:00 2013 +Size of extra inode fields: 32 +Device major/minor number: 01:03 (hex 01:03) +Exit status is 0 +e2fsck -yf -N test_filesys +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: 16/64 files (0.0% non-contiguous), 37/512 blocks +Exit status is 0 diff --git a/tests/d_special_files/name b/tests/d_special_files/name new file mode 100644 index 0000000..98d10d2 --- /dev/null +++ b/tests/d_special_files/name @@ -0,0 +1 @@ +create special files in debugfs diff --git a/tests/d_special_files/script b/tests/d_special_files/script new file mode 100644 index 0000000..c2a7fa0 --- /dev/null +++ b/tests/d_special_files/script @@ -0,0 +1,87 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf + +TEST_DATA=$test_name.tmp +VERIFY_DATA=$test_name.ver.tmp + +echo "debugfs create special files" > $OUT.new + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT.new + +$MKE2FS -Fq -b 1024 -o linux $TMPFILE 512 > /dev/null 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +set_current_time 20130115140000 +set_super_value lastcheck 0 +set_super_value hash_seed null +set_super_value mkfs_time 0 +symlink foo bar +symlink foo2 12345678901234567890123456789012345678901234567890123456789012345678901234567890 +mknod pipe p +mknod sda b 8 0 +mknod null c 1 3 +EOF + +echo "debugfs -R ''stat foo'' -w test.img" >> $OUT.new +$DEBUGFS -R "stat foo" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''stat foo2'' -w test.img" >> $OUT.new +$DEBUGFS -R "stat foo2" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''block_dump 28'' -w test.img" >> $OUT.new +$DEBUGFS -R "block_dump 28" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''stat pipe'' -w test.img" >> $OUT.new +$DEBUGFS -R "stat pipe" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''stat sda'' -w test.img" >> $OUT.new +$DEBUGFS -R "stat sda" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs -R ''stat null'' -w test.img" >> $OUT.new +$DEBUGFS -R "stat null" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo e2fsck $VERIFY_FSCK_OPT -N test_filesys >> $OUT.new +$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT + +# +# Do the verification +# + +rm -f $TMPFILE $OUT.new +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA diff --git a/tests/d_xattr_edits/expect b/tests/d_xattr_edits/expect new file mode 100644 index 0000000..6a4d912 --- /dev/null +++ b/tests/d_xattr_edits/expect @@ -0,0 +1,55 @@ +debugfs edit extended attributes +mke2fs -Fq -b 1024 test.img 512 +Exit status is 0 +ea_set / user.joe smith +Exit status is 0 +ea_set / user.moo FEE_FIE_FOE_FUMMMMMM +Exit status is 0 +ea_list / +Extended attributes: + user.joe (5) = "smith" + user.moo (20) = "FEE_FIE_FOE_FUMMMMMM" +Exit status is 0 +ea_get / user.moo +user.moo (20) = "FEE_FIE_FOE_FUMMMMMM" + +Exit status is 0 +ea_get / nosuchea +ea_get: Extended attribute key not found while getting extended attribute +Exit status is 0 +ea_rm / user.moo +Exit status is 0 +ea_rm / nosuchea +Exit status is 0 +ea_list / +Extended attributes: + user.joe (5) = "smith" +Exit status is 0 +ea_get / user.moo +ea_get: Extended attribute key not found while getting extended attribute +Exit status is 0 +ea_rm / user.joe +Exit status is 0 +ea_list / +Exit status is 0 +ea_set -f d_xattr_edits.tmp / user.file_based_xattr +Exit status is 0 +ea_list / +Extended attributes: + user.file_based_xattr (108) +Exit status is 0 +ea_get / user.file_based_xattr +user.file_based_xattr (108) = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567\n" + +Exit status is 0 +ea_get -f d_xattr_edits.ver.tmp / user.file_based_xattr +Exit status is 0 +Compare big attribute +e2fsck -yf -N test_filesys +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: 11/64 files (0.0% non-contiguous), 37/512 blocks +Exit status is 0 diff --git a/tests/d_xattr_edits/name b/tests/d_xattr_edits/name new file mode 100644 index 0000000..c0c428c --- /dev/null +++ b/tests/d_xattr_edits/name @@ -0,0 +1 @@ +edit extended attributes in debugfs diff --git a/tests/d_xattr_edits/script b/tests/d_xattr_edits/script new file mode 100644 index 0000000..07906c2 --- /dev/null +++ b/tests/d_xattr_edits/script @@ -0,0 +1,124 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf + +TEST_DATA=$test_name.tmp +VERIFY_DATA=$test_name.ver.tmp + +echo "debugfs edit extended attributes" > $OUT.new + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT.new + +$MKE2FS -Fq -b 1024 $TMPFILE 512 > /dev/null 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_set / user.joe smith" >> $OUT.new +$DEBUGFS -w -R "ea_set / user.joe smith" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_set / user.moo FEE_FIE_FOE_FUMMMMMM" >> $OUT.new +$DEBUGFS -w -R "ea_set / user.moo FEE_FIE_FOE_FUMMMMMM" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_list /" >> $OUT.new +$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / user.moo" >> $OUT.new +$DEBUGFS -w -R "ea_get / user.moo" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / nosuchea" >> $OUT.new +$DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_rm / user.moo" >> $OUT.new +$DEBUGFS -w -R "ea_rm / user.moo" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_rm / nosuchea" >> $OUT.new +$DEBUGFS -w -R "ea_rm / nosuchea" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_list /" >> $OUT.new +$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / user.moo" >> $OUT.new +$DEBUGFS -w -R "ea_get / user.moo" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_rm / user.joe" >> $OUT.new +$DEBUGFS -w -R "ea_rm / user.joe" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_list /" >> $OUT.new +$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" > $TEST_DATA +echo "ea_set -f $TEST_DATA / user.file_based_xattr" >> $OUT.new +$DEBUGFS -w -R "ea_set -f $TEST_DATA / user.file_based_xattr" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_list /" >> $OUT.new +$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / user.file_based_xattr" >> $OUT.new +$DEBUGFS -w -R "ea_get / user.file_based_xattr" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get -f $VERIFY_DATA / user.file_based_xattr" >> $OUT.new +$DEBUGFS -w -R "ea_get -f $VERIFY_DATA / user.file_based_xattr" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "Compare big attribute" >> $OUT.new +diff -u $TEST_DATA $VERIFY_DATA >> $OUT.new + +echo e2fsck $VERIFY_FSCK_OPT -N test_filesys >> $OUT.new +$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT + +# +# Do the verification +# + +rm -f $TMPFILE $TEST_DATA $VERIFY_DATA $OUT.new +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA diff --git a/tests/d_xattr_sorting/expect b/tests/d_xattr_sorting/expect new file mode 100644 index 0000000..6711645 --- /dev/null +++ b/tests/d_xattr_sorting/expect @@ -0,0 +1,34 @@ +debugfs sort extended attributes +mke2fs -Fq -b 1024 test.img 512 +Exit status is 0 +ea_set -f /tmp/b / security.SMEG64 +Exit status is 0 +ea_set -f /tmp/b / security.imb +Exit status is 0 +ea_set / user.moo cow +Exit status is 0 +ea_list / +Extended attributes: + user.moo (3) = "cow" + security.imb (256) + security.SMEG64 (256) +Exit status is 0 +ea_get / security.imb +security.imb (256) = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + +Exit status is 0 +ea_get / security.SMEG64 +security.SMEG64 (256) = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + +Exit status is 0 +ea_get / nosuchea +ea_get: Extended attribute key not found while getting extended attribute +Exit status is 0 +e2fsck -yf -N test_filesys +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: 11/64 files (0.0% non-contiguous), 37/512 blocks +Exit status is 0 diff --git a/tests/d_xattr_sorting/name b/tests/d_xattr_sorting/name new file mode 100644 index 0000000..dde8926 --- /dev/null +++ b/tests/d_xattr_sorting/name @@ -0,0 +1 @@ +sort extended attributes in debugfs diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script new file mode 100644 index 0000000..8666115 --- /dev/null +++ b/tests/d_xattr_sorting/script @@ -0,0 +1,87 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +EXP=$test_dir/expect +VERIFY_FSCK_OPT=-yf + +TEST_DATA=$test_name.tmp +VERIFY_DATA=$test_name.ver.tmp + +echo "debugfs sort extended attributes" > $OUT.new + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT.new + +$MKE2FS -Fq -b 1024 $TMPFILE 512 > /dev/null 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +B=$(mktemp ${TMPDIR:-/tmp}/b.XXXXXX) + +perl -e 'print "x" x 256;' > $B + +echo "ea_set -f /tmp/b / security.SMEG64" >> $OUT.new +$DEBUGFS -w -R "ea_set -f $B / security.SMEG64" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_set -f /tmp/b / security.imb" >> $OUT.new +$DEBUGFS -w -R "ea_set -f $B / security.imb" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_set / user.moo cow" >> $OUT.new +$DEBUGFS -w -R "ea_set / user.moo cow" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +rm -f $B +unset B + +echo "ea_list /" >> $OUT.new +$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / security.imb" >> $OUT.new +$DEBUGFS -w -R "ea_get / security.imb" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / security.SMEG64" >> $OUT.new +$DEBUGFS -w -R "ea_get / security.SMEG64" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "ea_get / nosuchea" >> $OUT.new +$DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo e2fsck $VERIFY_FSCK_OPT -N test_filesys >> $OUT.new +$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new >> $OUT + +# +# Do the verification +# + +rm -f $TMPFILE $OUT.new +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA diff --git a/tests/defaults/e_script b/tests/defaults/e_script new file mode 100644 index 0000000..8c9cfb6 --- /dev/null +++ b/tests/defaults/e_script @@ -0,0 +1,47 @@ +# +# Default script for testing the relocation library routines +# (irel -- inode relocation and brel -- block relocation) +# + +if [ -f $test_dir/setup ]; then + . $test_dir/setup +fi + +if [ "$class"x = x ]; then + class=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\1/'` + instance=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\2/'` +fi +if [ "$OUT"x = x ]; then + OUT=$test_name.log +fi +if [ "$EXPECT"x = x ]; then + EXPECT=$SRCDIR/progs/test_data/expect.$class +fi + +if [ "$class" = irel ]; then + TEST_PROG=$TEST_REL +elif [ "$class" = brel ]; then + TEST_PROG=$TEST_REL +elif [ "$class" = icount ]; then + TEST_PROG=$TEST_ICOUNT +else + TEST_PROG=/bin/cat +fi + +cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \ + | $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT + +cmp -s $EXPECT $OUT +status=$? + +rm -f $test_name.failed $test_name.ok + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXPECT $OUT > $test_name.failed +fi + +unset EXPECT OUT class instance diff --git a/tests/defaults/f_script b/tests/defaults/f_script new file mode 100644 index 0000000..7a3b34f --- /dev/null +++ b/tests/defaults/f_script @@ -0,0 +1 @@ +. $cmd_dir/run_e2fsck diff --git a/tests/defaults/j_script b/tests/defaults/j_script new file mode 100644 index 0000000..7a3b34f --- /dev/null +++ b/tests/defaults/j_script @@ -0,0 +1 @@ +. $cmd_dir/run_e2fsck diff --git a/tests/e_brel_bma/name b/tests/e_brel_bma/name new file mode 100644 index 0000000..9843871 --- /dev/null +++ b/tests/e_brel_bma/name @@ -0,0 +1 @@ +block relocation table using memory array implementation diff --git a/tests/e_brel_bma/script b/tests/e_brel_bma/script new file mode 100644 index 0000000..037e2fb --- /dev/null +++ b/tests/e_brel_bma/script @@ -0,0 +1 @@ +echo "$test_name: $test_description: skipped" diff --git a/tests/e_icount_normal/name b/tests/e_icount_normal/name new file mode 100644 index 0000000..1317876 --- /dev/null +++ b/tests/e_icount_normal/name @@ -0,0 +1 @@ +inode counting structure optimized for low counts diff --git a/tests/e_icount_opt/name b/tests/e_icount_opt/name new file mode 100644 index 0000000..5b6b1a5 --- /dev/null +++ b/tests/e_icount_opt/name @@ -0,0 +1 @@ +inode counting abstraction optimized for counting diff --git a/tests/e_irel_ima/name b/tests/e_irel_ima/name new file mode 100644 index 0000000..d19d277 --- /dev/null +++ b/tests/e_irel_ima/name @@ -0,0 +1 @@ +inode relocation table using memory array implementation diff --git a/tests/e_irel_ima/script b/tests/e_irel_ima/script new file mode 100644 index 0000000..037e2fb --- /dev/null +++ b/tests/e_irel_ima/script @@ -0,0 +1 @@ +echo "$test_name: $test_description: skipped" diff --git a/tests/f_16384_block/expect.1 b/tests/f_16384_block/expect.1 new file mode 100644 index 0000000..d5a5659 --- /dev/null +++ b/tests/f_16384_block/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: 11/2048 files (0.0% non-contiguous), 39/1024 blocks +Exit status is 0 diff --git a/tests/f_16384_block/expect.2 b/tests/f_16384_block/expect.2 new file mode 100644 index 0000000..d5a5659 --- /dev/null +++ b/tests/f_16384_block/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: 11/2048 files (0.0% non-contiguous), 39/1024 blocks +Exit status is 0 diff --git a/tests/f_16384_block/image.gz b/tests/f_16384_block/image.gz Binary files differnew file mode 100644 index 0000000..c5f311b --- /dev/null +++ b/tests/f_16384_block/image.gz diff --git a/tests/f_16384_block/name b/tests/f_16384_block/name new file mode 100644 index 0000000..79b3112 --- /dev/null +++ b/tests/f_16384_block/name @@ -0,0 +1 @@ +16384 byte blocksize diff --git a/tests/f_8192_block/expect.1 b/tests/f_8192_block/expect.1 new file mode 100644 index 0000000..d5a5659 --- /dev/null +++ b/tests/f_8192_block/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: 11/2048 files (0.0% non-contiguous), 39/1024 blocks +Exit status is 0 diff --git a/tests/f_8192_block/expect.2 b/tests/f_8192_block/expect.2 new file mode 100644 index 0000000..d5a5659 --- /dev/null +++ b/tests/f_8192_block/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: 11/2048 files (0.0% non-contiguous), 39/1024 blocks +Exit status is 0 diff --git a/tests/f_8192_block/image.gz b/tests/f_8192_block/image.gz Binary files differnew file mode 100644 index 0000000..c5f311b --- /dev/null +++ b/tests/f_8192_block/image.gz diff --git a/tests/f_8192_block/name b/tests/f_8192_block/name new file mode 100644 index 0000000..50d8dca --- /dev/null +++ b/tests/f_8192_block/name @@ -0,0 +1 @@ +8192 byte blocksize diff --git a/tests/f_bad_bbitmap/expect.1 b/tests/f_bad_bbitmap/expect.1 new file mode 100644 index 0000000..71ad1bb --- /dev/null +++ b/tests/f_bad_bbitmap/expect.1 @@ -0,0 +1,15 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x49ff, should be 0x4972. FIXED. +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 +Block bitmap differences: -(8--10) -(12--17) -(19--31) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bbitmap/expect.2 b/tests/f_bad_bbitmap/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bbitmap/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bbitmap/image.gz b/tests/f_bad_bbitmap/image.gz Binary files differnew file mode 100644 index 0000000..c488ecd --- /dev/null +++ b/tests/f_bad_bbitmap/image.gz diff --git a/tests/f_bad_bbitmap/name b/tests/f_bad_bbitmap/name new file mode 100644 index 0000000..923ddcb --- /dev/null +++ b/tests/f_bad_bbitmap/name @@ -0,0 +1 @@ +corrupt block bitmap (metadata_csum) diff --git a/tests/f_bad_bmap_csum/expect.1 b/tests/f_bad_bmap_csum/expect.1 new file mode 100644 index 0000000..ca8f77f --- /dev/null +++ b/tests/f_bad_bmap_csum/expect.1 @@ -0,0 +1,16 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x4972, should be 0x7074. FIXED. +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 +Inode bitmap differences: Group 0 inode bitmap does not match checksum. +FIXED. +Block bitmap differences: Group 0 block bitmap does not match checksum. +FIXED. + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bmap_csum/expect.2 b/tests/f_bad_bmap_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bmap_csum/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bmap_csum/image.gz b/tests/f_bad_bmap_csum/image.gz Binary files differnew file mode 100644 index 0000000..70a0d18 --- /dev/null +++ b/tests/f_bad_bmap_csum/image.gz diff --git a/tests/f_bad_bmap_csum/name b/tests/f_bad_bmap_csum/name new file mode 100644 index 0000000..df19fe3 --- /dev/null +++ b/tests/f_bad_bmap_csum/name @@ -0,0 +1 @@ +bad block/inode bitmap csum (metadata_csum) diff --git a/tests/f_bad_disconnected_inode/expect.1 b/tests/f_bad_disconnected_inode/expect.1 new file mode 100644 index 0000000..d1479ce --- /dev/null +++ b/tests/f_bad_disconnected_inode/expect.1 @@ -0,0 +1,49 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 1 has EXTENTS_FL flag set on filesystem without extents support. +Clear? yes + +Inode 9 has the casefold flag set but is not a directory. Clear flag? yes + +Inode 14 has the casefold flag set but is not a directory. Clear flag? yes + +Inode 14 has INLINE_DATA_FL flag on filesystem without inline data support. +Clear? yes + +Inode 15 has INLINE_DATA_FL flag on filesystem without inline data support. +Clear? yes + +Inode 16 has the casefold flag set but is not a directory. Clear flag? yes + +Inode 16 has INLINE_DATA_FL flag on filesystem without inline data support. +Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +i_file_acl for inode 13 (...) is 4218798225, should be zero. +Clear? yes + +Inode 13 (...) has invalid mode (0117003). +Clear? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(9--19) +Fix? yes + +Free blocks count wrong for group #0 (79, counted=91). +Fix? yes + +Free blocks count wrong (79, counted=91). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 9/100 blocks +Exit status is 1 diff --git a/tests/f_bad_disconnected_inode/expect.2 b/tests/f_bad_disconnected_inode/expect.2 new file mode 100644 index 0000000..8dfeb70 --- /dev/null +++ b/tests/f_bad_disconnected_inode/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: 11/16 files (0.0% non-contiguous), 9/100 blocks +Exit status is 0 diff --git a/tests/f_bad_disconnected_inode/image.gz b/tests/f_bad_disconnected_inode/image.gz Binary files differnew file mode 100644 index 0000000..8f2b3d9 --- /dev/null +++ b/tests/f_bad_disconnected_inode/image.gz diff --git a/tests/f_bad_disconnected_inode/name b/tests/f_bad_disconnected_inode/name new file mode 100644 index 0000000..f2fa67b --- /dev/null +++ b/tests/f_bad_disconnected_inode/name @@ -0,0 +1 @@ +disconnected inode with bad fields diff --git a/tests/f_bad_encryption/expect.1 b/tests/f_bad_encryption/expect.1 new file mode 100644 index 0000000..7027095 --- /dev/null +++ b/tests/f_bad_encryption/expect.1 @@ -0,0 +1,125 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 17 has encrypt flag but no encryption extended attribute. +Clear flag? yes + +Inode 18 has encrypt flag but no encryption extended attribute. +Clear flag? yes + +Encrypted inode 19 has corrupt encryption extended attribute. +Clear inode? yes + +Encrypted inode 20 has corrupt encryption extended attribute. +Clear inode? yes + +Encrypted inode 21 has corrupt encryption extended attribute. +Clear inode? yes + +Encrypted inode 22 has corrupt encryption extended attribute. +Clear inode? yes + +Pass 2: Checking directory structure +Encrypted entry 'd6M->'M-#I^VM-^KM-F~^WSJ+M-uM-zM-zXM-^' in /edir (12) references unencrypted inode 17. +Clear? yes + +Encrypted entry '\M-!M-Y%DhM-OM-VM-zM-CM-gVM-R3M-^RM-IkE^JM-^S' in /edir (12) references unencrypted inode 18. +Clear? yes + +Entry 'M-{^Qp-M-sM-U7eM-^C^L^PG^ZM-FM-,M-B' in /edir (12) has deleted/unused inode 19. Clear? yes + +Entry 'M-f0M-f3/M-NM-GM-:M-^YM-jM-XM-91DM-^_M-V' in /edir (12) has deleted/unused inode 20. Clear? yes + +Entry '^M-R"M-^K^P7M-'M-EM-C}^MM-yM-^LwM-^N^Z' in /edir (12) has deleted/unused inode 21. Clear? yes + +Entry 'M-s^J_;uIvM-^Z[M-nIM-5vM-^AcM-o' in /edir (12) has deleted/unused inode 22. Clear? yes + +Encrypted entry 'kK=,M-bM-^AM-{M-YM-^J6M-hM-y^XM-^W}M-M' in /edir (12) references unencrypted inode 23. +Clear? yes + +Encrypted entry 'M-VM-cxM-jM-zM-b^WM-o*M-jM-uM-,R^PM-hM-2' in /edir (12) references unencrypted inode 24. +Clear? yes + +Encrypted entry 'UqM-AM-#KM-^PM-_^kM-9P0M-^FM-_^@;A^J"R' in /edir (12) references unencrypted inode 25. +Clear? yes + +Encrypted entry 'M-TM-N8^[M-3M-( M-[A^FR}^ZhkM-^?=M-c^Mo' in /edir (12) references inode 26, which has a different encryption policy. +Clear? yes + +Encrypted entry 'M--aM-^?~M-^\M-u^FM-/!^YM-OZM-^LM-)M-p1' in /edir (12) references inode 27, which has a different encryption policy. +Clear? yes + +Encrypted entry '(M-8RKM-LM-eM-^W^[M-'M-SM-@uM-^VM-|M-GiM-^JbM-nM-z' in /edir (12) references inode 28, which has a different encryption policy. +Clear? yes + +Encrypted entry '\M-ggCeM-/?M-^BM-{(M-^OM-9M-^QQAM-^N=M-c^Mo' in /edir (12) references inode 29, which has a different encryption policy. +Clear? yes + +Pass 3: Checking directory connectivity +Unconnected directory inode 18 (was in /edir) +Connect to /lost+found? yes + +Unconnected directory inode 24 (was in /edir) +Connect to /lost+found? yes + +Unconnected directory inode 27 (was in /edir) +Connect to /lost+found? yes + +Pass 4: Checking reference counts +Unattached inode 17 +Connect to /lost+found? yes + +Inode 17 ref count is 2, should be 1. Fix? yes + +Inode 18 ref count is 3, should be 2. Fix? yes + +Unattached inode 23 +Connect to /lost+found? yes + +Inode 23 ref count is 2, should be 1. Fix? yes + +Inode 24 ref count is 3, should be 2. Fix? yes + +Unattached inode 25 +Connect to /lost+found? yes + +Inode 25 ref count is 2, should be 1. Fix? yes + +Unattached inode 26 +Connect to /lost+found? yes + +Inode 26 ref count is 2, should be 1. Fix? yes + +Inode 27 ref count is 3, should be 2. Fix? yes + +Unattached inode 28 +Connect to /lost+found? yes + +Inode 28 ref count is 2, should be 1. Fix? yes + +Unattached inode 29 +Connect to /lost+found? yes + +Inode 29 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(25--32) +Fix? yes + +Free blocks count wrong for group #0 (75, counted=83). +Fix? yes + +Free blocks count wrong (75, counted=83). +Fix? yes + +Inode bitmap differences: -(19--22) +Fix? yes + +Free inodes count wrong for group #0 (95, counted=99). +Fix? yes + +Free inodes count wrong (95, counted=99). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 29/128 files (0.0% non-contiguous), 45/128 blocks +Exit status is 1 diff --git a/tests/f_bad_encryption/expect.2 b/tests/f_bad_encryption/expect.2 new file mode 100644 index 0000000..fcfabdb --- /dev/null +++ b/tests/f_bad_encryption/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: 29/128 files (0.0% non-contiguous), 45/128 blocks +Exit status is 0 diff --git a/tests/f_bad_encryption/image.gz b/tests/f_bad_encryption/image.gz Binary files differnew file mode 100644 index 0000000..64b59b7 --- /dev/null +++ b/tests/f_bad_encryption/image.gz diff --git a/tests/f_bad_encryption/mkimage.sh b/tests/f_bad_encryption/mkimage.sh new file mode 100755 index 0000000..e58395d --- /dev/null +++ b/tests/f_bad_encryption/mkimage.sh @@ -0,0 +1,169 @@ +#!/bin/bash +# +# This is the script that was used to create the image.gz in this directory. +# +# This requires a patched version of debugfs that understands the "fscrypt." +# xattr name prefix, so that the encryption xattrs can be manipulated. + +set -e -u +umask 0022 + +do_debugfs() { + umount mnt + debugfs -w "$@" image + mount image mnt +} + +create_encrypted_file() { + local file=$1 + local ino + + echo foo > "$file" + + # not needed, but makes image more compressible + ino=$(stat -c %i "$file") + do_debugfs -R "zap_block -f <$ino> 0" +} + +set_encryption_xattr() { + local file=$1 + local value=$2 + local ino + + ino=$(stat -c %i "$file") + do_debugfs -R "ea_set <$ino> fscrypt.c $value" +} + +rm_encryption_xattr() { + local file=$1 + local ino + + ino=$(stat -c %i "$file") + do_debugfs -R "ea_rm <$ino> fscrypt.c" +} + +clear_encrypt_flag() { + local file=$1 + local ino + + ino=$(stat -c %i "$file") + do_debugfs -R "set_inode_field <$ino> flags 0" +} + +clear_encryption() { + local file=$1 + local ino + local is_symlink=false + + if [ -L "$file" ]; then + is_symlink=true + fi + ino=$(stat -c %i "$file") + + do_debugfs -R "ea_rm <$ino> fscrypt.c" + do_debugfs -R "set_inode_field <$ino> flags 0" + if $is_symlink; then + do_debugfs -R "set_inode_field <$ino> block[0] 0xAAAAAAAA" + do_debugfs -R "set_inode_field <$ino> block[1] 0" + do_debugfs -R "set_inode_field <$ino> size 4" + fi +} + +mkdir -p mnt +umount mnt &> /dev/null || true + +dd if=/dev/zero of=image bs=4096 count=128 +mke2fs -O encrypt -b 4096 -N 128 image +mount image mnt + +# Create an encrypted directory (ino 12) +dir=mnt/edir +mkdir $dir +echo password | e4crypt add_key $dir + +# Control cases: valid encrypted regular file, dir, and symlink (ino 13-15) +create_encrypted_file $dir/encrypted_file +mkdir $dir/encrypted_dir +ln -s target $dir/encrypted_symlink + +# Control case: file type that is never encrypted (ino 16) +mkfifo $dir/fifo + +# Inodes with missing encryption xattr (ino 17-18). +# e2fsck should offer to clear the encrypt flag on these inodes. + +create_encrypted_file $dir/missing_xattr_file +rm_encryption_xattr $dir/missing_xattr_file + +mkdir $dir/missing_xattr_dir +rm_encryption_xattr $dir/missing_xattr_dir + +# Inodes with corrupt encryption xattr (ino 19-22). +# e2fsck should offer to clear these inodes. + +create_encrypted_file $dir/corrupt_xattr_1 +set_encryption_xattr $dir/corrupt_xattr_1 '\0' + +create_encrypted_file $dir/corrupt_xattr_2 +set_encryption_xattr $dir/corrupt_xattr_2 \ + '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' + +create_encrypted_file $dir/corrupt_xattr_3 +set_encryption_xattr $dir/corrupt_xattr_3 '\1' + +create_encrypted_file $dir/corrupt_xattr_4 +set_encryption_xattr $dir/corrupt_xattr_4 '\2' + +# Unencrypted inodes in encrypted directory (ino 23-25). +# e2fsck should offer to clear these directory entries. + +create_encrypted_file $dir/unencrypted_file +clear_encryption $dir/unencrypted_file + +mkdir $dir/unencrypted_dir +clear_encryption $dir/unencrypted_dir + +ln -s target $dir/unencrypted_symlink +clear_encryption $dir/unencrypted_symlink + +# Inodes with different encryption policy in encrypted directory (ino 26-29). +# e2fsck should offer to clear these directory entries. + +xattr='\1\1\4\0AAAAAAAABBBBBBBBBBBBBBBB' + +create_encrypted_file $dir/inconsistent_file_1 +set_encryption_xattr $dir/inconsistent_file_1 $xattr + +mkdir $dir/inconsistent_dir +set_encryption_xattr $dir/inconsistent_dir $xattr + +ln -s target $dir/inconsistent_symlink +set_encryption_xattr $dir/inconsistent_symlink $xattr + +xattr='\2\1\4\0\0\0\0\0AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB' +create_encrypted_file $dir/inconsistent_file_2 +set_encryption_xattr $dir/inconsistent_file_2 $xattr + +# Encrypted file and directory with valid v2 encryption policy (ino 30-31). +# e2fsck shouldn't change these. +dir2=mnt/edir2 +mkdir $dir2 +echo password | e4crypt add_key $dir2 +xattr='\2\1\4\0\0\0\0\0AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB' +create_encrypted_file $dir2/file +set_encryption_xattr $dir2/file $xattr +set_encryption_xattr $dir2 $xattr + +# Encrypted file and directory with unrecognized encryption policy version +# (ino 32-33). e2fsck shouldn't change these. +dir3=mnt/edir3 +mkdir $dir3 +echo password | e4crypt add_key $dir3 +xattr='\3' +create_encrypted_file $dir3/file +set_encryption_xattr $dir3/file $xattr +set_encryption_xattr $dir3 $xattr + +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_bad_encryption/name b/tests/f_bad_encryption/name new file mode 100644 index 0000000..85b19ed --- /dev/null +++ b/tests/f_bad_encryption/name @@ -0,0 +1 @@ +missing, corrupt, and inconsistent encryption policies diff --git a/tests/f_bad_fname/expect.1 b/tests/f_bad_fname/expect.1 new file mode 100644 index 0000000..66f87df --- /dev/null +++ b/tests/f_bad_fname/expect.1 @@ -0,0 +1,22 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'AM-^?' in /ci_dir (12) has illegal UTF-8 characters in its name. +Fix? yes + +Entry 'AM-~' in /ci_dir (12) has illegal UTF-8 characters in its name. +Fix? yes + +Duplicate entry 'A.' found. + Marking /ci_dir (12) to be rebuilt. + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Entry 'A.' in /ci_dir (12) has a non-unique filename. +Rename to A.~0? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_bad_fname/expect.2 b/tests/f_bad_fname/expect.2 new file mode 100644 index 0000000..13de1c0 --- /dev/null +++ b/tests/f_bad_fname/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: 14/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_bad_fname/image.gz b/tests/f_bad_fname/image.gz Binary files differnew file mode 100644 index 0000000..a8b3fc6 --- /dev/null +++ b/tests/f_bad_fname/image.gz diff --git a/tests/f_bad_fname/name b/tests/f_bad_fname/name new file mode 100644 index 0000000..29681cb --- /dev/null +++ b/tests/f_bad_fname/name @@ -0,0 +1 @@ +case-insensitive directory with broken file names diff --git a/tests/f_bad_gdt_csum/expect.1 b/tests/f_bad_gdt_csum/expect.1 new file mode 100644 index 0000000..e14c897 --- /dev/null +++ b/tests/f_bad_gdt_csum/expect.1 @@ -0,0 +1,10 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xffff, should be 0x4972. FIXED. +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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/expect.2 b/tests/f_bad_gdt_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_gdt_csum/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/image.gz b/tests/f_bad_gdt_csum/image.gz Binary files differnew file mode 100644 index 0000000..c3fdafe --- /dev/null +++ b/tests/f_bad_gdt_csum/image.gz diff --git a/tests/f_bad_gdt_csum/name b/tests/f_bad_gdt_csum/name new file mode 100644 index 0000000..fe2c601 --- /dev/null +++ b/tests/f_bad_gdt_csum/name @@ -0,0 +1 @@ +bad group descriptor csum (metadata_csum) diff --git a/tests/f_bad_ibitmap/expect.1 b/tests/f_bad_ibitmap/expect.1 new file mode 100644 index 0000000..ea17523 --- /dev/null +++ b/tests/f_bad_ibitmap/expect.1 @@ -0,0 +1,15 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xffff, should be 0x4972. FIXED. +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 +Inode bitmap differences: -(12--32) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_ibitmap/expect.2 b/tests/f_bad_ibitmap/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_ibitmap/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_ibitmap/image.gz b/tests/f_bad_ibitmap/image.gz Binary files differnew file mode 100644 index 0000000..3a52398 --- /dev/null +++ b/tests/f_bad_ibitmap/image.gz diff --git a/tests/f_bad_ibitmap/name b/tests/f_bad_ibitmap/name new file mode 100644 index 0000000..76ec12d --- /dev/null +++ b/tests/f_bad_ibitmap/name @@ -0,0 +1 @@ +corrupt inode bitmap (metadata_csum) diff --git a/tests/f_bad_inode_csum/expect.1 b/tests/f_bad_inode_csum/expect.1 new file mode 100644 index 0000000..b3c628d --- /dev/null +++ b/tests/f_bad_inode_csum/expect.1 @@ -0,0 +1,126 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 33 has a extra size (65535) which is invalid +Fix? yes + +Inode 49 passes checks, but checksum does not match inode. Fix? yes + +Inode 65 passes checks, but checksum does not match inode. Fix? yes + +Inode 81 passes checks, but checksum does not match inode. Fix? yes + +Inode 97 seems to contain garbage. Clear? yes + +Inode 98 seems to contain garbage. Clear? yes + +Inode 99 seems to contain garbage. Clear? yes + +Inode 100 seems to contain garbage. Clear? yes + +Inode 101 seems to contain garbage. Clear? yes + +Inode 102 seems to contain garbage. Clear? yes + +Inode 103 seems to contain garbage. Clear? yes + +Inode 104 seems to contain garbage. Clear? yes + +Inode 105 seems to contain garbage. Clear? yes + +Inode 106 seems to contain garbage. Clear? yes + +Inode 107 seems to contain garbage. Clear? yes + +Inode 108 seems to contain garbage. Clear? yes + +Inode 109 seems to contain garbage. Clear? yes + +Inode 110 seems to contain garbage. Clear? yes + +Inode 111 seems to contain garbage. Clear? yes + +Inode 112 seems to contain garbage. Clear? yes + +Pass 2: Checking directory structure +Extended attribute block for inode 49 (/38) is invalid (4294967295). +Clear? yes + +Entry '86' in / (2) has deleted/unused inode 97. Clear? yes + +Entry '87' in / (2) has deleted/unused inode 98. Clear? yes + +Entry '88' in / (2) has deleted/unused inode 99. Clear? yes + +Entry '89' in / (2) has deleted/unused inode 100. Clear? yes + +Entry '90' in / (2) has deleted/unused inode 101. Clear? yes + +Entry '91' in / (2) has deleted/unused inode 102. Clear? yes + +Entry '92' in / (2) has deleted/unused inode 103. Clear? yes + +Entry '93' in / (2) has deleted/unused inode 104. Clear? yes + +Entry '94' in / (2) has deleted/unused inode 105. Clear? yes + +Entry '95' in / (2) has deleted/unused inode 106. Clear? yes + +Entry '96' in / (2) has deleted/unused inode 107. Clear? yes + +Entry '97' in / (2) has deleted/unused inode 108. Clear? yes + +Entry '98' in / (2) has deleted/unused inode 109. Clear? yes + +Entry '99' in / (2) has deleted/unused inode 110. Clear? yes + +Entry '100' in / (2) has deleted/unused inode 111. Clear? yes + +Entry '101' in / (2) has deleted/unused inode 112. Clear? yes + +Entry '102' in / (2) has deleted/unused inode 113. Clear? yes + +Entry '103' in / (2) has deleted/unused inode 114. Clear? yes + +Entry '104' in / (2) has deleted/unused inode 115. Clear? yes + +Entry '105' in / (2) has deleted/unused inode 116. Clear? yes + +Entry '106' in / (2) has deleted/unused inode 117. Clear? yes + +Entry '107' in / (2) has deleted/unused inode 118. Clear? yes + +Entry '108' in / (2) has deleted/unused inode 119. Clear? yes + +Entry '109' in / (2) has deleted/unused inode 120. Clear? yes + +Entry '110' in / (2) has deleted/unused inode 121. Clear? yes + +Entry '111' in / (2) has deleted/unused inode 122. Clear? yes + +Entry '112' in / (2) has deleted/unused inode 123. Clear? yes + +Entry '113' in / (2) has deleted/unused inode 124. Clear? yes + +Entry '114' in / (2) has deleted/unused inode 125. Clear? yes + +Entry '115' in / (2) has deleted/unused inode 126. Clear? yes + +Entry '116' in / (2) has deleted/unused inode 127. Clear? yes + +Entry '117' in / (2) has deleted/unused inode 128. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -(97--128) +Fix? yes + +Free inodes count wrong for group #0 (0, counted=32). +Fix? yes + +Free inodes count wrong (0, counted=32). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 96/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_inode_csum/expect.2 b/tests/f_bad_inode_csum/expect.2 new file mode 100644 index 0000000..b97a902 --- /dev/null +++ b/tests/f_bad_inode_csum/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: 96/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_inode_csum/image.gz b/tests/f_bad_inode_csum/image.gz Binary files differnew file mode 100644 index 0000000..221920b --- /dev/null +++ b/tests/f_bad_inode_csum/image.gz diff --git a/tests/f_bad_inode_csum/name b/tests/f_bad_inode_csum/name new file mode 100644 index 0000000..68bf7ce --- /dev/null +++ b/tests/f_bad_inode_csum/name @@ -0,0 +1 @@ +inode table corruption (metadata_csum) diff --git a/tests/f_bad_local_jnl/expect.1 b/tests/f_bad_local_jnl/expect.1 new file mode 100644 index 0000000..10140b5 --- /dev/null +++ b/tests/f_bad_local_jnl/expect.1 @@ -0,0 +1,14 @@ +Found invalid V2 journal superblock fields (from V1 journal). +Clearing fields beyond the V1 journal superblock... + +Backing up journal inode block information. + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 1080/8192 blocks +Exit status is 1 diff --git a/tests/f_bad_local_jnl/expect.2 b/tests/f_bad_local_jnl/expect.2 new file mode 100644 index 0000000..632dc71 --- /dev/null +++ b/tests/f_bad_local_jnl/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: 11/256 files (0.0% non-contiguous), 1080/8192 blocks +Exit status is 0 diff --git a/tests/f_bad_local_jnl/image b/tests/f_bad_local_jnl/image Binary files differnew file mode 100644 index 0000000..6f2b550 --- /dev/null +++ b/tests/f_bad_local_jnl/image diff --git a/tests/f_bad_local_jnl/image.gz b/tests/f_bad_local_jnl/image.gz Binary files differnew file mode 100644 index 0000000..addd58a --- /dev/null +++ b/tests/f_bad_local_jnl/image.gz diff --git a/tests/f_bad_local_jnl/name b/tests/f_bad_local_jnl/name new file mode 100644 index 0000000..8b77264 --- /dev/null +++ b/tests/f_bad_local_jnl/name @@ -0,0 +1 @@ +test for corrupt local journal (bad V1->V2 journal upgrade) diff --git a/tests/f_badbblocks/expect.1 b/tests/f_badbblocks/expect.1 new file mode 100644 index 0000000..3107a29 --- /dev/null +++ b/tests/f_badbblocks/expect.1 @@ -0,0 +1,28 @@ +Filesystem did not have a UUID; generating one. + +../e2fsck/e2fsck: Illegal indirect block found while reading bad blocks inode +This doesn't bode well, but we'll try to go on... +Pass 1: Checking inodes, blocks, and sizes +Bad block inode has illegal block(s). Clear? yes + +Illegal block #1 (101) in bad block inode. CLEARED. +Illegal block #2 (103) in bad block inode. CLEARED. +Illegal block #3 (234523) in bad block inode. CLEARED. +Illegal indirect block (200) in bad block inode. CLEARED. +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +50 +Fix? yes + +Free blocks count wrong for group #0 (78, counted=77). +Fix? yes + +Free blocks count wrong (78, counted=77). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 23/100 blocks +Exit status is 1 diff --git a/tests/f_badbblocks/expect.2 b/tests/f_badbblocks/expect.2 new file mode 100644 index 0000000..fda217d --- /dev/null +++ b/tests/f_badbblocks/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: 11/32 files (0.0% non-contiguous), 23/100 blocks +Exit status is 0 diff --git a/tests/f_badbblocks/image.gz b/tests/f_badbblocks/image.gz Binary files differnew file mode 100644 index 0000000..fe39b7f --- /dev/null +++ b/tests/f_badbblocks/image.gz diff --git a/tests/f_badbblocks/name b/tests/f_badbblocks/name new file mode 100644 index 0000000..ab20f38 --- /dev/null +++ b/tests/f_badbblocks/name @@ -0,0 +1 @@ +illegal blocks in bad block inode diff --git a/tests/f_badcluster/expect b/tests/f_badcluster/expect new file mode 100644 index 0000000..b44e65d --- /dev/null +++ b/tests/f_badcluster/expect @@ -0,0 +1,194 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 logical block 2 (physical block 1154) violates cluster allocation rules. +Will fix in pass 1B. +Inode 12, i_blocks is 32, should be 64. Fix? yes + +Inode 16 logical block 5 (physical block 1173) violates cluster allocation rules. +Will fix in pass 1B. +Inode 16, i_size is 3072, should be 6144. Fix? yes + +Inode 16, i_blocks is 32, should be 64. Fix? yes + +Inode 17 logical block 0 (physical block 1186) violates cluster allocation rules. +Will fix in pass 1B. +Inode 17 logical block 2 (physical block 1184) violates cluster allocation rules. +Will fix in pass 1B. +Inode 18 logical block 3 (physical block 1201) violates cluster allocation rules. +Will fix in pass 1B. +Inode 18, i_blocks is 32, should be 64. Fix? yes + +Inode 15 on bigalloc filesystem cannot be block mapped. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 1154 +Multiply-claimed block(s) in inode 13: 1152--1154 +Multiply-claimed block(s) in inode 14: 1648--1650 +Multiply-claimed block(s) in inode 15: 1650 +Multiply-claimed block(s) in inode 16: 1173 +Multiply-claimed block(s) in inode 17: 1186 1185 1184 +Multiply-claimed block(s) in inode 18: 1201 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 7 inodes containing multiply-claimed blocks.) + +File /a (inode #12, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 1 file(s): + /b (inode #13, mod time Tue Jun 17 08:00:50 2014) +Clone multiply-claimed blocks? yes + +File /b (inode #13, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 1 file(s): + /a (inode #12, mod time Tue Jun 17 08:00:50 2014) +Multiply-claimed blocks already reassigned or cloned. + +File /c (inode #14, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 1 file(s): + /d (inode #15, mod time Tue Jun 17 08:00:50 2014) +Clone multiply-claimed blocks? yes + +File /d (inode #15, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 1 file(s): + /c (inode #14, mod time Tue Jun 17 08:00:50 2014) +Multiply-claimed blocks already reassigned or cloned. + +File /e (inode #16, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +File /f (inode #17, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +File /g (inode #18, mod time Tue Jun 17 08:00:50 2014) + has 1 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (51, counted=48). +Fix? yes + +Free blocks count wrong (816, counted=768). +Fix? yes + + +test_fs: ***** FILE SYSTEM WAS MODIFIED ***** +test_fs: 18/128 files (22.2% non-contiguous), 1280/2048 blocks +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_blocks is 64, should be 32. Fix? yes + +Inode 16, i_blocks is 64, should be 32. Fix? yes + +Inode 18, i_blocks is 64, should be 32. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1168--1200) +Fix? yes + +Free blocks count wrong for group #0 (48, counted=51). +Fix? yes + +Free blocks count wrong (768, counted=816). +Fix? yes + + +test_fs: ***** FILE SYSTEM WAS MODIFIED ***** +test_fs: 18/128 files (5.6% non-contiguous), 1232/2048 blocks +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_fs: 18/128 files (5.6% non-contiguous), 1232/2048 blocks +debugfs: stat /a +Inode: 12 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152157 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0-1):1136-1137, (2):1138 +debugfs: stat /b +Inode: 13 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152158 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0-2):1152-1154 +debugfs: stat /c +Inode: 14 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152159 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0-1):1216-1217, (2):1218 +debugfs: stat /d +Inode: 15 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152160 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +debugfs: stat /e +Inode: 16 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152161 Version: 0x00000001 +User: 0 Group: 0 Size: 6144 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0-2):1664-1666, (5):1669 +debugfs: stat /f +Inode: 17 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152162 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0):1232, (1):1233, (2):1234 +debugfs: stat /g +Inode: 18 Type: regular Mode: 0644 Flags: 0x80000 +Generation: 1117152163 Version: 0x00000001 +User: 0 Group: 0 Size: 3072 +File ACL: 0 +Links: 1 Blockcount: 32 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +atime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +mtime: 0x539ff5b2 -- Tue Jun 17 08:00:50 2014 +EXTENTS: +(0-2):1680-1682, (3):1683 +debugfs: quit diff --git a/tests/f_badcluster/image.gz b/tests/f_badcluster/image.gz Binary files differnew file mode 100644 index 0000000..3f21e98 --- /dev/null +++ b/tests/f_badcluster/image.gz diff --git a/tests/f_badcluster/name b/tests/f_badcluster/name new file mode 100644 index 0000000..06bad7c --- /dev/null +++ b/tests/f_badcluster/name @@ -0,0 +1 @@ +test alignment problems with bigalloc clusters diff --git a/tests/f_badcluster/script b/tests/f_badcluster/script new file mode 100644 index 0000000..6c9e1cf --- /dev/null +++ b/tests/f_badcluster/script @@ -0,0 +1,29 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/../f_badcluster/image.gz +OUT=$test_name.log +EXP=$test_dir/expect +gzip -d < $IMAGE > $TMPFILE +$FSCK -fy $TMPFILE > $OUT.new 2>&1 +$FSCK -fy $TMPFILE >> $OUT.new 2>&1 +$FSCK -fy $TMPFILE >> $OUT.new 2>&1 +for i in a b c d e f g; do echo "stat /$i"; done > $TMPFILE.cmd +echo "quit" >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi diff --git a/tests/f_baddir/expect.1 b/tests/f_baddir/expect.1 new file mode 100644 index 0000000..cf46a60 --- /dev/null +++ b/tests/f_baddir/expect.1 @@ -0,0 +1,54 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 182, should be 1024. Fix? yes + +Inode 13 is a zero-length directory. Clear? yes + +Pass 2: Checking directory structure +Entry 'zero' in / (2) has deleted/unused inode 13. Clear? yes + +Entry 'foo/bar' in / (2) has illegal characters in its name. +Fix? yes + +Entry 'root' in /test (14) is a link to the root inode. +Clear? yes + +Entry 'badino' in /test (14) has invalid inode #: 123456. +Clear? yes + +Entry 'dot' in /test (14) is a link to '.' Clear? yes + +Directory inode 12, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 12. +Fix? yes + +Missing '..' in directory inode 12. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in /block.h (12) is <The NULL inode> (0), should be / (2). +Fix? yes + +Pass 4: Checking reference counts +Inode 12 ref count is 1, should be 2. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -22 +Fix? yes + +Free blocks count wrong (74, counted=75). +Fix? yes + +Inode bitmap differences: -13 +Fix? yes + +Directories count wrong for group #0 (5, counted=4). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 1 diff --git a/tests/f_baddir/expect.2 b/tests/f_baddir/expect.2 new file mode 100644 index 0000000..e848eff --- /dev/null +++ b/tests/f_baddir/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: 14/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 0 diff --git a/tests/f_baddir/image.gz b/tests/f_baddir/image.gz Binary files differnew file mode 100644 index 0000000..9d593fe --- /dev/null +++ b/tests/f_baddir/image.gz diff --git a/tests/f_baddir/name b/tests/f_baddir/name new file mode 100644 index 0000000..9822221 --- /dev/null +++ b/tests/f_baddir/name @@ -0,0 +1 @@ +corrupted directory entries diff --git a/tests/f_baddir2/expect.1 b/tests/f_baddir2/expect.1 new file mode 100644 index 0000000..ec6ed32 --- /dev/null +++ b/tests/f_baddir2/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 12, block #0, offset 60: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/16 files (0.0% non-contiguous), 23/100 blocks +Exit status is 1 diff --git a/tests/f_baddir2/expect.2 b/tests/f_baddir2/expect.2 new file mode 100644 index 0000000..b85bbab --- /dev/null +++ b/tests/f_baddir2/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: 15/16 files (0.0% non-contiguous), 23/100 blocks +Exit status is 0 diff --git a/tests/f_baddir2/image.gz b/tests/f_baddir2/image.gz Binary files differnew file mode 100644 index 0000000..0d9fcdf --- /dev/null +++ b/tests/f_baddir2/image.gz diff --git a/tests/f_baddir2/name b/tests/f_baddir2/name new file mode 100644 index 0000000..568a7c9 --- /dev/null +++ b/tests/f_baddir2/name @@ -0,0 +1 @@ +salvage last directory entry diff --git a/tests/f_baddotdir/expect.1 b/tests/f_baddotdir/expect.1 new file mode 100644 index 0000000..a7ca4e4 --- /dev/null +++ b/tests/f_baddotdir/expect.1 @@ -0,0 +1,62 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Missing '.' in directory inode 12. +Fix? yes + +Missing '..' in directory inode 12. +Fix? yes + +First entry 'X' (inode=11) in directory inode 13 (/b) should be '.' +Fix? yes + +Missing '..' in directory inode 14. +Fix? yes + +Second entry 'XX' (inode=11) in directory inode 15 should be '..' +Fix? yes + +'.' directory entry in directory inode 17 is not NULL terminated +Fix? yes + +'..' directory entry in directory inode 17 is not NULL terminated +Fix? yes + +Missing '.' in directory inode 16. +Fix? yes + +Missing '..' in directory inode 16. +Fix? yes + +Directory entry for '.' in ... (19) is big. +Split? yes + +Pass 3: Checking directory connectivity +'..' in /a (12) is <The NULL inode> (0), should be / (2). +Fix? yes + +'..' in /c (14) is <The NULL inode> (0), should be / (2). +Fix? yes + +'..' in /d (15) is <The NULL inode> (0), should be / (2). +Fix? yes + +'..' in /e (16) is <The NULL inode> (0), should be / (2). +Fix? yes + +'..' in /f (17) is <The NULL inode> (0), should be / (2). +Fix? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (69, counted=70). +Fix? yes + +Free blocks count wrong (69, counted=70). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 19/32 files (0.0% non-contiguous), 30/100 blocks +Exit status is 1 diff --git a/tests/f_baddotdir/expect.2 b/tests/f_baddotdir/expect.2 new file mode 100644 index 0000000..0838aa3 --- /dev/null +++ b/tests/f_baddotdir/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: 19/32 files (0.0% non-contiguous), 30/100 blocks +Exit status is 0 diff --git a/tests/f_baddotdir/image.gz b/tests/f_baddotdir/image.gz Binary files differnew file mode 100644 index 0000000..71df18f --- /dev/null +++ b/tests/f_baddotdir/image.gz diff --git a/tests/f_baddotdir/name b/tests/f_baddotdir/name new file mode 100644 index 0000000..c13ba75 --- /dev/null +++ b/tests/f_baddotdir/name @@ -0,0 +1 @@ +bad '.' and '..' entries diff --git a/tests/f_badinode/expect.1 b/tests/f_badinode/expect.1 new file mode 100644 index 0000000..8caa2cc --- /dev/null +++ b/tests/f_badinode/expect.1 @@ -0,0 +1,40 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_blocks is 2, should be 0. Fix? yes + +Pass 2: Checking directory structure +Inode 12 (/motd) has invalid mode (0110444). +Clear? yes + +i_file_acl for inode 13 (/timings) is 39, should be zero. +Clear? yes + +i_blocks_hi for inode 13 (/timings) is 1024, should be zero. +Clear? yes + +Inode 14 (/block_dev) is an illegal block device. +Clear? yes + +Inode 15 (/char_dev) is an illegal character device. +Clear? yes + +Symlink /test-symlink (inode #16) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -25 +Fix? yes + +Free blocks count wrong for group #0 (76, counted=77). +Fix? yes + +Free blocks count wrong (76, counted=77). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/32 files (0.0% non-contiguous), 23/100 blocks +Exit status is 1 diff --git a/tests/f_badinode/expect.2 b/tests/f_badinode/expect.2 new file mode 100644 index 0000000..628a376 --- /dev/null +++ b/tests/f_badinode/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/32 files (0.0% non-contiguous), 23/100 blocks +Exit status is 0 diff --git a/tests/f_badinode/image.gz b/tests/f_badinode/image.gz Binary files differnew file mode 100644 index 0000000..7b4a0d1 --- /dev/null +++ b/tests/f_badinode/image.gz diff --git a/tests/f_badinode/name b/tests/f_badinode/name new file mode 100644 index 0000000..38ee2d9 --- /dev/null +++ b/tests/f_badinode/name @@ -0,0 +1 @@ +corrupted inode entries diff --git a/tests/f_badjour_encrypted/expect.1 b/tests/f_badjour_encrypted/expect.1 new file mode 100644 index 0000000..0b13b9e --- /dev/null +++ b/tests/f_badjour_encrypted/expect.1 @@ -0,0 +1,30 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(24--25) -(27--41) -(107--1113) +Fix? yes + +Free blocks count wrong for group #0 (934, counted=1958). +Fix? yes + +Free blocks count wrong (934, counted=1958). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 1114/2048 blocks +Exit status is 1 diff --git a/tests/f_badjour_encrypted/expect.2 b/tests/f_badjour_encrypted/expect.2 new file mode 100644 index 0000000..76934be --- /dev/null +++ b/tests/f_badjour_encrypted/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: 11/256 files (9.1% non-contiguous), 1114/2048 blocks +Exit status is 0 diff --git a/tests/f_badjour_encrypted/name b/tests/f_badjour_encrypted/name new file mode 100644 index 0000000..e8f4c04 --- /dev/null +++ b/tests/f_badjour_encrypted/name @@ -0,0 +1 @@ +journal inode has encrypt flag diff --git a/tests/f_badjour_encrypted/script b/tests/f_badjour_encrypted/script new file mode 100644 index 0000000..e6778f1 --- /dev/null +++ b/tests/f_badjour_encrypted/script @@ -0,0 +1,11 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +touch $TMPFILE +$MKE2FS -t ext4 -b 1024 $TMPFILE 2M +$DEBUGFS -w -R 'set_inode_field <8> flags 0x80800' $TMPFILE + +SKIP_GUNZIP="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_badjour_indblks/expect.1 b/tests/f_badjour_indblks/expect.1 new file mode 100644 index 0000000..cb8054c --- /dev/null +++ b/tests/f_badjour_indblks/expect.1 @@ -0,0 +1,32 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Adding dirhash hint to filesystem. + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(82--1111) +Fix? yes + +Free blocks count wrong for group #0 (7080, counted=8110). +Fix? yes + +Free blocks count wrong (7080, counted=8110). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 1111/8192 blocks +Exit status is 1 diff --git a/tests/f_badjour_indblks/expect.2 b/tests/f_badjour_indblks/expect.2 new file mode 100644 index 0000000..3fbb8b3 --- /dev/null +++ b/tests/f_badjour_indblks/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: 11/256 files (0.0% non-contiguous), 1111/8192 blocks +Exit status is 0 diff --git a/tests/f_badjour_indblks/image.gz b/tests/f_badjour_indblks/image.gz Binary files differnew file mode 100644 index 0000000..67190c8 --- /dev/null +++ b/tests/f_badjour_indblks/image.gz diff --git a/tests/f_badjour_indblks/name b/tests/f_badjour_indblks/name new file mode 100644 index 0000000..674b99a --- /dev/null +++ b/tests/f_badjour_indblks/name @@ -0,0 +1 @@ +corruption in journal inode's indirect blocks diff --git a/tests/f_badjourblks/expect.1 b/tests/f_badjourblks/expect.1 new file mode 100644 index 0000000..5483a0d --- /dev/null +++ b/tests/f_badjourblks/expect.1 @@ -0,0 +1,30 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(50--1079) +Fix? yes + +Free blocks count wrong for group #0 (7112, counted=8142). +Fix? yes + +Free blocks count wrong (7112, counted=8142). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 1079/8192 blocks +Exit status is 1 diff --git a/tests/f_badjourblks/expect.2 b/tests/f_badjourblks/expect.2 new file mode 100644 index 0000000..7c50703 --- /dev/null +++ b/tests/f_badjourblks/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: 11/256 files (0.0% non-contiguous), 1079/8192 blocks +Exit status is 0 diff --git a/tests/f_badjourblks/image.gz b/tests/f_badjourblks/image.gz Binary files differnew file mode 100644 index 0000000..e336a4b --- /dev/null +++ b/tests/f_badjourblks/image.gz diff --git a/tests/f_badjourblks/name b/tests/f_badjourblks/name new file mode 100644 index 0000000..fc9cef9 --- /dev/null +++ b/tests/f_badjourblks/name @@ -0,0 +1 @@ +illegal blocks in journal inode (and backup in superblock) diff --git a/tests/f_badorphan/expect.1 b/tests/f_badorphan/expect.1 new file mode 100644 index 0000000..ecf0bf7 --- /dev/null +++ b/tests/f_badorphan/expect.1 @@ -0,0 +1,77 @@ +Clearing orphaned inode 54 (uid=0, gid=0, mode=0100600, size=44610) +Clearing orphaned inode 32 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 67 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 55 (uid=0, gid=0, mode=040700, size=1024) +Backing up journal inode block information. + +Pass 1: Checking inodes, blocks, and sizes +Inodes that were part of a corrupted orphan linked list found. Fix? yes + +Inode 13 was part of the orphaned inode list. FIXED. +Inode 17 was part of the orphaned inode list. FIXED. +Deleted inode 18 has zero dtime. Fix? yes + +Inode 19 was part of the orphaned inode list. FIXED. +Inode 22 was part of the orphaned inode list. FIXED. +Inode 23 was part of the orphaned inode list. FIXED. +Inode 24 was part of the orphaned inode list. FIXED. +Inode 25 was part of the orphaned inode list. FIXED. +Inode 26 was part of the orphaned inode list. FIXED. +Inode 27 was part of the orphaned inode list. FIXED. +Inode 28 was part of the orphaned inode list. FIXED. +Inode 30 was part of the orphaned inode list. FIXED. +Inode 33 was part of the orphaned inode list. FIXED. +Inode 36 was part of the orphaned inode list. FIXED. +Inode 38 was part of the orphaned inode list. FIXED. +Inode 43 was part of the orphaned inode list. FIXED. +Inode 44 was part of the orphaned inode list. FIXED. +Inode 46 was part of the orphaned inode list. FIXED. +Inode 47 was part of the orphaned inode list. FIXED. +Inode 51 was part of the orphaned inode list. FIXED. +Inode 53 was part of the orphaned inode list. FIXED. +Inode 56 was part of the orphaned inode list. FIXED. +Inode 61 was part of the orphaned inode list. FIXED. +Inode 65 was part of the orphaned inode list. FIXED. +Inode 70 was part of the orphaned inode list. FIXED. +Inode 71 was part of the orphaned inode list. FIXED. +Inode 75 was part of the orphaned inode list. FIXED. +Inode 77 was part of the orphaned inode list. FIXED. +Inode 83 was part of the orphaned inode list. FIXED. +Inode 84 was part of the orphaned inode list. FIXED. +Inode 85 was part of the orphaned inode list. FIXED. +Inode 87 was part of the orphaned inode list. FIXED. +Inode 91 was part of the orphaned inode list. FIXED. +Inode 93 was part of the orphaned inode list. FIXED. +Inode 96 was part of the orphaned inode list. FIXED. +Inode 97 was part of the orphaned inode list. FIXED. +Inode 99 was part of the orphaned inode list. FIXED. +Inode 109 was part of the orphaned inode list. FIXED. +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1363--1399) -(1401--1405) -1461 -(1505--1533) -(1538--1540) -(1566--1574) -(1593--1600) -(1604--1605) -1654 -(1656--1703) -(1706--1726) -1728 -(1803--1804) -1913 -(2286--2295) -2392 -(2960--2973) -(3118--3154) -3345 -(3451--3452) -3569 -(3748--3749) -4409 -(4411--4414) -(4435--4456) -(4720--4725) -4929 -(4967--4984) -(5258--5275) -(5352--5354) -(5412--5425) -5493 -(5620--5647) -(5676--5677) -(5720--5744) -(5760--5788) -6013 +Fix? yes + +Free blocks count wrong for group #0 (5801, counted=6210). +Fix? yes + +Free blocks count wrong (5801, counted=6210). +Fix? yes + +Inode bitmap differences: -13 -(17--19) -(22--28) -30 -33 -36 -38 -(43--44) -(46--47) -51 -53 -56 -61 -65 -(70--71) -75 -77 -(83--85) -87 -91 -93 -(96--97) -99 -109 +Fix? yes + +Free inodes count wrong for group #0 (1951, counted=1989). +Fix? yes + +Directories count wrong for group #0 (41, counted=22). +Fix? yes + +Free inodes count wrong (1951, counted=1989). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 59/2048 files (22.0% non-contiguous), 1982/8192 blocks +Exit status is 1 diff --git a/tests/f_badorphan/expect.2 b/tests/f_badorphan/expect.2 new file mode 100644 index 0000000..3d928eb --- /dev/null +++ b/tests/f_badorphan/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: 59/2048 files (22.0% non-contiguous), 1982/8192 blocks +Exit status is 0 diff --git a/tests/f_badorphan/image.gz b/tests/f_badorphan/image.gz Binary files differnew file mode 100644 index 0000000..94e3a38 --- /dev/null +++ b/tests/f_badorphan/image.gz diff --git a/tests/f_badorphan/name b/tests/f_badorphan/name new file mode 100644 index 0000000..7c1475b --- /dev/null +++ b/tests/f_badorphan/name @@ -0,0 +1 @@ +corrupted orphan list diff --git a/tests/f_badprimary/expect.1 b/tests/f_badprimary/expect.1 new file mode 100644 index 0000000..21b814b --- /dev/null +++ b/tests/f_badprimary/expect.1 @@ -0,0 +1,27 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +The primary superblock (1) is on the bad block list. + +If the block is really bad, the filesystem can not be fixed. +You can remove this block from the bad block list and hope +that the block is really OK. But there are no guarantees. + +Clear? yes + +Block 2 in the primary group descriptors is on the bad block list + +If the block is really bad, the filesystem can not be fixed. +You can remove this block from the bad block list and hope +that the block is really OK. But there are no guarantees. + +Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_badprimary/expect.2 b/tests/f_badprimary/expect.2 new file mode 100644 index 0000000..a821f87 --- /dev/null +++ b/tests/f_badprimary/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: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_badprimary/image.gz b/tests/f_badprimary/image.gz Binary files differnew file mode 100644 index 0000000..7aeb611 --- /dev/null +++ b/tests/f_badprimary/image.gz diff --git a/tests/f_badprimary/name b/tests/f_badprimary/name new file mode 100644 index 0000000..dacce31 --- /dev/null +++ b/tests/f_badprimary/name @@ -0,0 +1 @@ +bad blocks in the primary superblock and group descriptors diff --git a/tests/f_badroot/expect.1 b/tests/f_badroot/expect.1 new file mode 100644 index 0000000..ff92426 --- /dev/null +++ b/tests/f_badroot/expect.1 @@ -0,0 +1,29 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Entry '..' in <2>/<11> (11) has deleted/unused inode 2. Clear? yes + +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Inode 11 ref count is 3, should be 2. Fix? yes + +Unattached inode 12 +Connect to /lost+found? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (0.0% non-contiguous), 24/100 blocks +Exit status is 1 diff --git a/tests/f_badroot/expect.2 b/tests/f_badroot/expect.2 new file mode 100644 index 0000000..cab021a --- /dev/null +++ b/tests/f_badroot/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: 13/32 files (0.0% non-contiguous), 24/100 blocks +Exit status is 0 diff --git a/tests/f_badroot/image.gz b/tests/f_badroot/image.gz Binary files differnew file mode 100644 index 0000000..72980a3 --- /dev/null +++ b/tests/f_badroot/image.gz diff --git a/tests/f_badroot/name b/tests/f_badroot/name new file mode 100644 index 0000000..399e4f2 --- /dev/null +++ b/tests/f_badroot/name @@ -0,0 +1 @@ +file in root directory inode diff --git a/tests/f_badsymlinks/expect.1 b/tests/f_badsymlinks/expect.1 new file mode 100644 index 0000000..b28b57d --- /dev/null +++ b/tests/f_badsymlinks/expect.1 @@ -0,0 +1,61 @@ +Pass 1: Checking inodes, blocks, and sizes +Special (device/socket/fifo/symlink) file (inode 18) has immutable +or append-only flag set. Clear? yes + +Inode 19 has illegal block(s). Clear? yes + +Illegal block #0 (1234567890) in inode 19. CLEARED. +Inode 19, i_blocks is 2, should be 0. Fix? yes + +Special (device/socket/fifo/symlink) file (inode 20) has immutable +or append-only flag set. Clear? yes + +Inode 21 is too big. Truncate? yes + +Block #1 (22) causes symlink to be too big. CLEARED. +Inode 21, i_blocks is 4, should be 2. Fix? yes + +Pass 2: Checking directory structure +Symlink /empty_link (inode #17) is invalid. +Clear? yes + +Symlink /long_fastlink (inode #13) is invalid. +Clear? yes + +Symlink /long_link (inode #14) is invalid. +Clear? yes + +Symlink /high_fastlink (inode #15) is invalid. +Clear? yes + +Symlink /high_link (inode #16) is invalid. +Clear? yes + +Symlink /empty_fastlink (inode #12) is invalid. +Clear? yes + +Symlink /bad_link_block (inode #19) is invalid. +Clear? yes + +Symlink /extra_link_block (inode #21) is invalid. +Clear? yes + +Symlink /bad_link_size (inode #22) is invalid. +Clear? yes + +Symlink /bad_fastlink_size (inode #23) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (1000, counted=1001). +Fix? yes + +Free blocks count wrong (1000, counted=1001). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (7.7% non-contiguous), 23/1024 blocks +Exit status is 1 diff --git a/tests/f_badsymlinks/expect.2 b/tests/f_badsymlinks/expect.2 new file mode 100644 index 0000000..1499551 --- /dev/null +++ b/tests/f_badsymlinks/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: 13/32 files (0.0% non-contiguous), 23/1024 blocks +Exit status is 0 diff --git a/tests/f_badsymlinks/image.gz b/tests/f_badsymlinks/image.gz Binary files differnew file mode 100644 index 0000000..4ebacde --- /dev/null +++ b/tests/f_badsymlinks/image.gz diff --git a/tests/f_badsymlinks/name b/tests/f_badsymlinks/name new file mode 100644 index 0000000..630858f --- /dev/null +++ b/tests/f_badsymlinks/name @@ -0,0 +1 @@ +corrupted symlinks diff --git a/tests/f_badsymlinks2/expect.1 b/tests/f_badsymlinks2/expect.1 new file mode 100644 index 0000000..939edce --- /dev/null +++ b/tests/f_badsymlinks2/expect.1 @@ -0,0 +1,114 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Symlink /default/empty (inode #13) is invalid. +Clear? yes + +Symlink /default/fast_isize_too_small (inode #15) is invalid. +Clear? yes + +Symlink /default/fast_isize_too_large (inode #16) is invalid. +Clear? yes + +Symlink /default/slow_isize_too_small (inode #19) is invalid. +Clear? yes + +Symlink /default/slow_isize_too_large (inode #20) is invalid. +Clear? yes + +Symlink /default/one_too_long (inode #22) is invalid. +Clear? yes + +Symlink /default/too_long (inode #23) is invalid. +Clear? yes + +Symlink /encrypted/empty (inode #25) is invalid. +Clear? yes + +Symlink /encrypted/fast_isize_too_large (inode #28) is invalid. +Clear? yes + +Symlink /encrypted/fast_isize_too_small (inode #27) is invalid. +Clear? yes + +Symlink /encrypted/one_too_long (inode #34) is invalid. +Clear? yes + +Symlink /encrypted/slow_isize_too_large (inode #32) is invalid. +Clear? yes + +Symlink /encrypted/slow_isize_too_small (inode #31) is invalid. +Clear? yes + +Symlink /encrypted/too_long (inode #35) is invalid. +Clear? yes + +Symlink /extents/empty (inode #38) is invalid. +Clear? yes + +Symlink /extents/fast_isize_too_small (inode #40) is invalid. +Clear? yes + +Symlink /extents/fast_isize_too_large (inode #41) is invalid. +Clear? yes + +Symlink /extents/slow_isize_too_small (inode #44) is invalid. +Clear? yes + +Symlink /extents/slow_isize_too_large (inode #45) is invalid. +Clear? yes + +Symlink /extents/one_too_long (inode #47) is invalid. +Clear? yes + +Symlink /extents/too_long (inode #48) is invalid. +Clear? yes + +Symlink /extents_encrypted/empty (inode #50) is invalid. +Clear? yes + +Symlink /extents_encrypted/fast_isize_too_large (inode #53) is invalid. +Clear? yes + +Symlink /extents_encrypted/fast_isize_too_small (inode #52) is invalid. +Clear? yes + +Symlink /extents_encrypted/one_too_long (inode #59) is invalid. +Clear? yes + +Symlink /extents_encrypted/slow_isize_too_large (inode #57) is invalid. +Clear? yes + +Symlink /extents_encrypted/slow_isize_too_small (inode #56) is invalid. +Clear? yes + +Symlink /extents_encrypted/too_long (inode #60) is invalid. +Clear? yes + +Symlink /inline_data/empty (inode #63) is invalid. +Clear? yes + +Symlink /inline_data/fast_isize_too_small (inode #65) is invalid. +Clear? yes + +Symlink /inline_data/fast_isize_too_large (inode #66) is invalid. +Clear? yes + +Symlink /inline_data/slow_isize_too_small (inode #69) is invalid. +Clear? yes + +Symlink /inline_data/slow_isize_too_large (inode #70) is invalid. +Clear? yes + +Symlink /inline_data/one_too_long (inode #72) is invalid. +Clear? yes + +Symlink /inline_data/too_long (inode #73) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 36/80 files (0.0% non-contiguous), 31/150 blocks +Exit status is 1 diff --git a/tests/f_badsymlinks2/expect.2 b/tests/f_badsymlinks2/expect.2 new file mode 100644 index 0000000..3da98a8 --- /dev/null +++ b/tests/f_badsymlinks2/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: 36/80 files (0.0% non-contiguous), 31/150 blocks +Exit status is 0 diff --git a/tests/f_badsymlinks2/image.gz b/tests/f_badsymlinks2/image.gz Binary files differnew file mode 100644 index 0000000..d1f314c --- /dev/null +++ b/tests/f_badsymlinks2/image.gz diff --git a/tests/f_badsymlinks2/mkimage.sh b/tests/f_badsymlinks2/mkimage.sh new file mode 100755 index 0000000..6bbf020 --- /dev/null +++ b/tests/f_badsymlinks2/mkimage.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# This is the script that was used to create the image.gz in this directory. + +set -e -u + +BLOCKSIZE=4096 + +do_debugfs() { + umount mnt + debugfs -w "$@" image + mount image mnt +} + +do_tune2fs() { + umount mnt + tune2fs $@ image + mount image mnt +} + +symlink() { + local len=$1 + local src=$2 + local target=$(perl -e 'print "A" x '$len) + ln -s $target $src + stat -c %i $src +} + +# Overwrite the length in the header of the encrypted symlink target +set_encrypted_symlink_len() { + local ino=$1 + local len=$2 + + echo "zap_block -f <$ino> -p $((len%256)) -o 0 -l 1 0" + echo "zap_block -f <$ino> -p $((len/256)) -o 1 -l 1 0" +} + +create_symlinks() { + local dir=$1 + local encrypted=${2:-false} + local overhead=0 + local ino + + if $encrypted; then + overhead=2 + fi + + mkdir -p $dir + + { + ino=$(symlink 1 $dir/empty) + echo "set_inode_field <$ino> i_size 10" + echo "set_inode_field <$ino> block[0] 0" + + symlink 1 $dir/fast_min > /dev/null + + ino=$(symlink 10 $dir/fast_isize_too_small) + echo "set_inode_field <$ino> i_size 1" + + ino=$(symlink 10 $dir/fast_isize_too_large) + echo "set_inode_field <$ino> i_size 20" + + symlink $((59 - overhead)) $dir/fast_max > /dev/null + + symlink $((60 - overhead)) $dir/slow_min > /dev/null + + ino=$(symlink 100 $dir/slow_isize_too_small) + echo "set_inode_field <$ino> i_size 80" + + ino=$(symlink 100 $dir/slow_isize_too_large) + echo "set_inode_field <$ino> i_size 120" + + symlink $((BLOCKSIZE - 1 - overhead)) $dir/slow_max > /dev/null + + ino=$(symlink $((BLOCKSIZE - 1 - overhead)) $dir/one_too_long) + echo "set_inode_field <$ino> i_size $BLOCKSIZE" + echo "zap_block -f <$ino> -p 65 0" + if $encrypted; then + set_encrypted_symlink_len $ino $((BLOCKSIZE - overhead)) + fi + + ino=$(symlink $((BLOCKSIZE - 1 - overhead)) $dir/too_long) + echo "set_inode_field <$ino> i_size $((BLOCKSIZE + 1000))" + echo "zap_block -f <$ino> -p 65 0" + if $encrypted; then + set_encrypted_symlink_len $ino $((BLOCKSIZE + 1000 - overhead)) + fi + + } >> debugfs_commands + do_debugfs < debugfs_commands +} + +create_encrypted_symlinks() { + local dir=$1 link + + mkdir $dir + echo | e4crypt add_key $dir + create_symlinks $dir true + + # Move symlinks into an unencrypted directory (leaving their targets + # encrypted). This makes the fsck output consistent. + mv $dir ${dir}~encrypted + mkdir $dir + mv ${dir}~encrypted/* $dir +} + +mkdir -p mnt +umount mnt &> /dev/null || true +dd if=/dev/zero of=image bs=1024 count=600 + +mke2fs -O 'encrypt,^extents,^64bit' -b $BLOCKSIZE -I 256 image +mount image mnt + +create_symlinks mnt/default +create_encrypted_symlinks mnt/encrypted + +do_tune2fs -O extents +create_symlinks mnt/extents +create_encrypted_symlinks mnt/extents_encrypted + +do_debugfs -R 'feature inline_data' +create_symlinks mnt/inline_data + +rm -rf debugfs_commands mnt/*~encrypted +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_badsymlinks2/name b/tests/f_badsymlinks2/name new file mode 100644 index 0000000..81d3285 --- /dev/null +++ b/tests/f_badsymlinks2/name @@ -0,0 +1 @@ +more types of corrupted symlinks diff --git a/tests/f_badtable/expect.1 b/tests/f_badtable/expect.1 new file mode 100644 index 0000000..56881f1 --- /dev/null +++ b/tests/f_badtable/expect.1 @@ -0,0 +1,45 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Group 0's block bitmap (3) is bad. Relocate? yes + +Group 0's inode bitmap (4) is bad. Relocate? yes + +Relocating group 0's block bitmap from 3 to 9... +Relocating group 0's inode bitmap from 4 to 10... +Pass 2: Checking directory structure +Entry 'lost+found' in / (2) points to inode (11) located in a bad block. +Clear? yes + +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(12--20) +Fix? yes + +Free blocks count wrong for group #0 (77, counted=87). +Fix? yes + +Free blocks count wrong (77, counted=87). +Fix? yes + +Inode bitmap differences: +(12--16) +(25--32) +Fix? yes + +Free inodes count wrong for group #0 (20, counted=7). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (20, counted=7). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 25/32 files (0.0% non-contiguous), 13/100 blocks +Exit status is 1 diff --git a/tests/f_badtable/expect.2 b/tests/f_badtable/expect.2 new file mode 100644 index 0000000..c1c554c --- /dev/null +++ b/tests/f_badtable/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: 25/32 files (0.0% non-contiguous), 13/100 blocks +Exit status is 0 diff --git a/tests/f_badtable/image.gz b/tests/f_badtable/image.gz Binary files differnew file mode 100644 index 0000000..48dbac1 --- /dev/null +++ b/tests/f_badtable/image.gz diff --git a/tests/f_badtable/name b/tests/f_badtable/name new file mode 100644 index 0000000..e4a8bae --- /dev/null +++ b/tests/f_badtable/name @@ -0,0 +1 @@ +bad blocks in bitmaps and inode table diff --git a/tests/f_bb_in_bb/expect.1 b/tests/f_bb_in_bb/expect.1 new file mode 100644 index 0000000..1bd697e --- /dev/null +++ b/tests/f_bb_in_bb/expect.1 @@ -0,0 +1,19 @@ +Pass 1: Checking inodes, blocks, and sizes +Bad block list says the bad block list inode is bad. Clear inode? yes + +Restarting e2fsck from the beginning... +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 +Free blocks count wrong for group #0 (493, counted=494). +Fix? yes + +Free blocks count wrong (493, counted=494). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bb_in_bb/expect.2 b/tests/f_bb_in_bb/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bb_in_bb/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bb_in_bb/image.gz b/tests/f_bb_in_bb/image.gz Binary files differnew file mode 100644 index 0000000..e2c46c0 --- /dev/null +++ b/tests/f_bb_in_bb/image.gz diff --git a/tests/f_bb_in_bb/name b/tests/f_bb_in_bb/name new file mode 100644 index 0000000..88727e1 --- /dev/null +++ b/tests/f_bb_in_bb/name @@ -0,0 +1 @@ +bad block inode table block in bad block list diff --git a/tests/f_bbfile/expect.1 b/tests/f_bbfile/expect.1 new file mode 100644 index 0000000..ec1a36e --- /dev/null +++ b/tests/f_bbfile/expect.1 @@ -0,0 +1,48 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Group 0's inode bitmap (4) is bad. Relocate? yes + +Relocating group 0's inode bitmap from 4 to 43... + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 2: 21 +Multiply-claimed block(s) in inode 11: 9--20 +Multiply-claimed block(s) in inode 12: 25--26 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File / (inode #2, mod time Sun Jan 2 08:29:13 1994) + has 1 multiply-claimed block(s), shared with 1 file(s): + <The bad blocks inode> (inode #1, mod time Sun Jul 17 00:47:58 1994) +Clone multiply-claimed blocks? yes + +File /lost+found (inode #11, mod time Sun Jan 2 08:28:40 1994) + has 12 multiply-claimed block(s), shared with 1 file(s): + <The bad blocks inode> (inode #1, mod time Sun Jul 17 00:47:58 1994) +Clone multiply-claimed blocks? yes + +File /termcap (inode #12, mod time Sun Jan 2 08:29:13 1994) + has 2 multiply-claimed block(s), shared with 1 file(s): + <The bad blocks inode> (inode #1, mod time Sun Jul 17 00:47:58 1994) +Clone multiply-claimed blocks? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +43 +Fix? yes + +Free blocks count wrong for group #0 (57, counted=41). +Fix? yes + +Free blocks count wrong (57, counted=41). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/32 files (0.0% non-contiguous), 59/100 blocks +Exit status is 1 diff --git a/tests/f_bbfile/expect.2 b/tests/f_bbfile/expect.2 new file mode 100644 index 0000000..92491da --- /dev/null +++ b/tests/f_bbfile/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/32 files (8.3% non-contiguous), 59/100 blocks +Exit status is 0 diff --git a/tests/f_bbfile/image.gz b/tests/f_bbfile/image.gz Binary files differnew file mode 100644 index 0000000..3b01381 --- /dev/null +++ b/tests/f_bbfile/image.gz diff --git a/tests/f_bbfile/name b/tests/f_bbfile/name new file mode 100644 index 0000000..8843fbb --- /dev/null +++ b/tests/f_bbfile/name @@ -0,0 +1 @@ +bad blocks in files diff --git a/tests/f_bbinode/expect.1 b/tests/f_bbinode/expect.1 new file mode 100644 index 0000000..667d666 --- /dev/null +++ b/tests/f_bbinode/expect.1 @@ -0,0 +1,51 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'a6' in / (2) points to inode (17) located in a bad block. +Clear? yes + +Entry 'a7' in / (2) points to inode (18) located in a bad block. +Clear? yes + +Entry 'a8' in / (2) points to inode (19) located in a bad block. +Clear? yes + +Entry 'b1' in / (2) points to inode (20) located in a bad block. +Clear? yes + +Entry 'b2' in / (2) points to inode (21) located in a bad block. +Clear? yes + +Entry 'b3' in / (2) points to inode (22) located in a bad block. +Clear? yes + +Entry 'b4' in / (2) points to inode (23) located in a bad block. +Clear? yes + +Entry 'b5' in / (2) points to inode (24) located in a bad block. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -83 +Fix? yes + +Free blocks count wrong for group #0 (1962, counted=1965). +Fix? yes + +Free blocks count wrong (1962, counted=1965). +Fix? yes + +Inode bitmap differences: +(41--48) +Fix? yes + +Free inodes count wrong for group #0 (485, counted=477). +Fix? yes + +Free inodes count wrong (485, counted=477). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 35/512 files (0.0% non-contiguous), 83/2048 blocks +Exit status is 1 diff --git a/tests/f_bbinode/expect.2 b/tests/f_bbinode/expect.2 new file mode 100644 index 0000000..c65289d --- /dev/null +++ b/tests/f_bbinode/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: 35/512 files (0.0% non-contiguous), 83/2048 blocks +Exit status is 0 diff --git a/tests/f_bbinode/image.gz b/tests/f_bbinode/image.gz Binary files differnew file mode 100644 index 0000000..34dcf48 --- /dev/null +++ b/tests/f_bbinode/image.gz diff --git a/tests/f_bbinode/name b/tests/f_bbinode/name new file mode 100644 index 0000000..c5db3e5 --- /dev/null +++ b/tests/f_bbinode/name @@ -0,0 +1 @@ +bad blocks in inode table diff --git a/tests/f_big_sparse/expect.1 b/tests/f_big_sparse/expect.1 new file mode 100644 index 0000000..eac82ed --- /dev/null +++ b/tests/f_big_sparse/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 61440, should be 4398050758656. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/64 files (0.0% non-contiguous), 27/100 blocks +Exit status is 1 diff --git a/tests/f_big_sparse/expect.2 b/tests/f_big_sparse/expect.2 new file mode 100644 index 0000000..ae45ec5 --- /dev/null +++ b/tests/f_big_sparse/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/64 files (0.0% non-contiguous), 27/100 blocks +Exit status is 0 diff --git a/tests/f_big_sparse/image.gz b/tests/f_big_sparse/image.gz Binary files differnew file mode 100644 index 0000000..027feeb --- /dev/null +++ b/tests/f_big_sparse/image.gz diff --git a/tests/f_big_sparse/name b/tests/f_big_sparse/name new file mode 100644 index 0000000..b9d9723 --- /dev/null +++ b/tests/f_big_sparse/name @@ -0,0 +1 @@ +big sparse file diff --git a/tests/f_bigalloc_badinode/expect.1 b/tests/f_bigalloc_badinode/expect.1 new file mode 100644 index 0000000..615828a --- /dev/null +++ b/tests/f_bigalloc_badinode/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Symlink /testfile (inode #12) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/64 files (0.0% non-contiguous), 112/1024 blocks +Exit status is 1 diff --git a/tests/f_bigalloc_badinode/expect.2 b/tests/f_bigalloc_badinode/expect.2 new file mode 100644 index 0000000..16d88fa --- /dev/null +++ b/tests/f_bigalloc_badinode/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: 11/64 files (0.0% non-contiguous), 112/1024 blocks +Exit status is 0 diff --git a/tests/f_bigalloc_badinode/name b/tests/f_bigalloc_badinode/name new file mode 100644 index 0000000..e1ed216 --- /dev/null +++ b/tests/f_bigalloc_badinode/name @@ -0,0 +1 @@ +delete bad inode handling for bigalloc filesystems diff --git a/tests/f_bigalloc_badinode/script b/tests/f_bigalloc_badinode/script new file mode 100644 index 0000000..6ceb6ee --- /dev/null +++ b/tests/f_bigalloc_badinode/script @@ -0,0 +1,23 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" +TEST_DATA="$test_name.tmp" + +dd if=$TEST_BITS of=$TEST_DATA bs=4k count=2 seek=1> /dev/null 2>&1 + +touch $TMPFILE +$MKE2FS -Fq -t ext4 -o Linux -O bigalloc -C 16384 $TMPFILE 1M > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +write $TEST_DATA testfile +set_inode_field testfile i_mode 0120000 +quit +EOF + +. $cmd_dir/run_e2fsck + +rm -f $TEST_DATA + +unset E2FSCK_TIME TEST_DATA diff --git a/tests/f_bigalloc_orphan_list/expect.1 b/tests/f_bigalloc_orphan_list/expect.1 new file mode 100644 index 0000000..9b83a2f --- /dev/null +++ b/tests/f_bigalloc_orphan_list/expect.1 @@ -0,0 +1,10 @@ +Clearing orphaned inode 12 (uid=0, gid=0, mode=0100644, size=28672) +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/64 files (0.0% non-contiguous), 112/1024 blocks +Exit status is 0 diff --git a/tests/f_bigalloc_orphan_list/expect.2 b/tests/f_bigalloc_orphan_list/expect.2 new file mode 100644 index 0000000..16d88fa --- /dev/null +++ b/tests/f_bigalloc_orphan_list/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: 11/64 files (0.0% non-contiguous), 112/1024 blocks +Exit status is 0 diff --git a/tests/f_bigalloc_orphan_list/name b/tests/f_bigalloc_orphan_list/name new file mode 100644 index 0000000..5d9566f --- /dev/null +++ b/tests/f_bigalloc_orphan_list/name @@ -0,0 +1 @@ +orphaned list handling with bigalloc file systems diff --git a/tests/f_bigalloc_orphan_list/script b/tests/f_bigalloc_orphan_list/script new file mode 100644 index 0000000..8a062dc --- /dev/null +++ b/tests/f_bigalloc_orphan_list/script @@ -0,0 +1,28 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" +TEST_DATA="$test_name.tmp" + +dd if=$TEST_BITS of=$TEST_DATA bs=28k count=1 > /dev/null 2>&1 + +touch $TMPFILE +$MKE2FS -Fq -t ext4 -o Linux -O bigalloc $TMPFILE 1M > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +write $TEST_DATA testfile +set_inode_field testfile links_count 0 +set_inode_field testfile mode 0100644 +set_inode_field testfile bmap[0] 0 +set_inode_field testfile bmap[2] 0 +set_super_value last_orphan 12 +unlink testfile +quit +EOF + +. $cmd_dir/run_e2fsck + +rm -f $TEST_DATA + +unset E2FSCK_TIME TEST_DATA diff --git a/tests/f_bigalloc_symlink_with_xattr/expect.1 b/tests/f_bigalloc_symlink_with_xattr/expect.1 new file mode 100644 index 0000000..0e6c199 --- /dev/null +++ b/tests/f_bigalloc_symlink_with_xattr/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/16 files (0.0% non-contiguous), 112/128 blocks +Exit status is 0 diff --git a/tests/f_bigalloc_symlink_with_xattr/image.gz b/tests/f_bigalloc_symlink_with_xattr/image.gz Binary files differnew file mode 100644 index 0000000..cbd125d --- /dev/null +++ b/tests/f_bigalloc_symlink_with_xattr/image.gz diff --git a/tests/f_bigalloc_symlink_with_xattr/name b/tests/f_bigalloc_symlink_with_xattr/name new file mode 100644 index 0000000..8adbd9a --- /dev/null +++ b/tests/f_bigalloc_symlink_with_xattr/name @@ -0,0 +1 @@ +fast symlink + xattr block on bigalloc fs diff --git a/tests/f_bigalloc_symlink_with_xattr/script b/tests/f_bigalloc_symlink_with_xattr/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_bigalloc_symlink_with_xattr/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_bitmaps/expect.1 b/tests/f_bitmaps/expect.1 new file mode 100644 index 0000000..2e91113 --- /dev/null +++ b/tests/f_bitmaps/expect.1 @@ -0,0 +1,19 @@ +Filesystem did not have a UUID; generating one. + +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 +Block bitmap differences: +12 -20 +41 -50 +Fix? yes + +Inode bitmap differences: +11 -15 +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (9.1% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_bitmaps/expect.2 b/tests/f_bitmaps/expect.2 new file mode 100644 index 0000000..73d1c27 --- /dev/null +++ b/tests/f_bitmaps/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: 11/32 files (9.1% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_bitmaps/image.gz b/tests/f_bitmaps/image.gz Binary files differnew file mode 100644 index 0000000..1c533eb --- /dev/null +++ b/tests/f_bitmaps/image.gz diff --git a/tests/f_bitmaps/name b/tests/f_bitmaps/name new file mode 100644 index 0000000..a309bfa --- /dev/null +++ b/tests/f_bitmaps/name @@ -0,0 +1 @@ +corrupted inode and block bitmaps diff --git a/tests/f_boundscheck/expect.1 b/tests/f_boundscheck/expect.1 new file mode 100644 index 0000000..c2170b8 --- /dev/null +++ b/tests/f_boundscheck/expect.1 @@ -0,0 +1,25 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode table +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while using the backup blocks../e2fsck/e2fsck: going back to original superblock +Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +Inode table for group 1 is not in group. (block 4294967295) +WARNING: SEVERE DATA LOSS POSSIBLE. +Relocate? yes + +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 1 checksum is 0x6ea2, should be 0x7edd. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Error allocating 256 contiguous block(s) in block group 1 for inode table: Could not allocate block in ext2 filesystem +e2fsck: aborted + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +Exit status is 0 diff --git a/tests/f_boundscheck/expect.2 b/tests/f_boundscheck/expect.2 new file mode 100644 index 0000000..c2170b8 --- /dev/null +++ b/tests/f_boundscheck/expect.2 @@ -0,0 +1,25 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode table +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while using the backup blocks../e2fsck/e2fsck: going back to original superblock +Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +Inode table for group 1 is not in group. (block 4294967295) +WARNING: SEVERE DATA LOSS POSSIBLE. +Relocate? yes + +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 1 checksum is 0x6ea2, should be 0x7edd. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Error allocating 256 contiguous block(s) in block group 1 for inode table: Could not allocate block in ext2 filesystem +e2fsck: aborted + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +Exit status is 0 diff --git a/tests/f_boundscheck/image.bz2 b/tests/f_boundscheck/image.bz2 Binary files differnew file mode 100644 index 0000000..098d02e --- /dev/null +++ b/tests/f_boundscheck/image.bz2 diff --git a/tests/f_boundscheck/name b/tests/f_boundscheck/name new file mode 100644 index 0000000..7d71be5 --- /dev/null +++ b/tests/f_boundscheck/name @@ -0,0 +1 @@ +infinite loop when finding table free space diff --git a/tests/f_boundscheck/script b/tests/f_boundscheck/script new file mode 100755 index 0000000..7a07265 --- /dev/null +++ b/tests/f_boundscheck/script @@ -0,0 +1,31 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE +#e2label $TMPFILE test_filesys + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/f_clear_xattr/expect.1 b/tests/f_clear_xattr/expect.1 new file mode 100644 index 0000000..5cfbeaf --- /dev/null +++ b/tests/f_clear_xattr/expect.1 @@ -0,0 +1,38 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 14, i_blocks is 2, should be 0. Fix? yes + +Inode 12, i_blocks is 4, should be 2. Fix? yes + +Inode 13, i_blocks is 2, should be 0. Fix? yes + +Inode 15, i_blocks is 4, should be 2. Fix? yes + +Pass 2: Checking directory structure +i_file_acl for inode 12 (/dir) is 22, should be zero. +Clear? yes + +i_file_acl for inode 13 (/file) is 22, should be zero. +Clear? yes + +i_file_acl for inode 14 (/symlink) is 22, should be zero. +Clear? yes + +i_file_acl for inode 15 (/long-symlink) is 23, should be zero. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(22--23) +Fix? yes + +Free blocks count wrong for group #0 (76, counted=78). +Fix? yes + +Free blocks count wrong (76, counted=78). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_clear_xattr/expect.2 b/tests/f_clear_xattr/expect.2 new file mode 100644 index 0000000..306d267 --- /dev/null +++ b/tests/f_clear_xattr/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: 15/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_clear_xattr/image.gz b/tests/f_clear_xattr/image.gz Binary files differnew file mode 100644 index 0000000..99aca14 --- /dev/null +++ b/tests/f_clear_xattr/image.gz diff --git a/tests/f_clear_xattr/name b/tests/f_clear_xattr/name new file mode 100644 index 0000000..2ead690 --- /dev/null +++ b/tests/f_clear_xattr/name @@ -0,0 +1 @@ +clearing i_file_acl when !ext_attr feature diff --git a/tests/f_cloneblock_alloc_error/expect.1 b/tests/f_cloneblock_alloc_error/expect.1 new file mode 100644 index 0000000..24fe1ff --- /dev/null +++ b/tests/f_cloneblock_alloc_error/expect.1 @@ -0,0 +1,36 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 0, should be 2015232. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 13: 8 +Multiply-claimed block(s) in inode 14: 8 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) + +File /b (inode #13, mod time Wed Jan 21 03:41:55 2015) + has 1 multiply-claimed block(s), shared with 1 file(s): + /c (inode #14, mod time Wed Jan 21 03:42:37 2015) +Clone multiply-claimed blocks? yes + +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +Delete file? yes + +File /c (inode #14, mod time Wed Jan 21 03:42:37 2015) + has 1 multiply-claimed block(s), shared with 1 file(s): + /b (inode #13, mod time Wed Jan 21 03:41:55 2015) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Entry 'b' in / (2) has deleted/unused inode 13. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/128 files (7.7% non-contiguous), 512/512 blocks +Exit status is 1 diff --git a/tests/f_cloneblock_alloc_error/expect.2 b/tests/f_cloneblock_alloc_error/expect.2 new file mode 100644 index 0000000..f7781ec --- /dev/null +++ b/tests/f_cloneblock_alloc_error/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: 13/128 files (7.7% non-contiguous), 512/512 blocks +Exit status is 0 diff --git a/tests/f_cloneblock_alloc_error/image.gz b/tests/f_cloneblock_alloc_error/image.gz Binary files differnew file mode 100644 index 0000000..ed01df1 --- /dev/null +++ b/tests/f_cloneblock_alloc_error/image.gz diff --git a/tests/f_cloneblock_alloc_error/name b/tests/f_cloneblock_alloc_error/name new file mode 100644 index 0000000..9196e89 --- /dev/null +++ b/tests/f_cloneblock_alloc_error/name @@ -0,0 +1 @@ +decrement badcount after remapping duplicate block diff --git a/tests/f_collapse_extent_tree/expect.1 b/tests/f_collapse_extent_tree/expect.1 new file mode 100644 index 0000000..a62e99d --- /dev/null +++ b/tests/f_collapse_extent_tree/expect.1 @@ -0,0 +1,16 @@ +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 0 9 1 + 1/ 1 1/ 1 0 - 0 10 - 10 1 +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent tree (at level 1) could be shorter. Optimize? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 diff --git a/tests/f_collapse_extent_tree/expect.2 b/tests/f_collapse_extent_tree/expect.2 new file mode 100644 index 0000000..a1d28b1 --- /dev/null +++ b/tests/f_collapse_extent_tree/expect.2 @@ -0,0 +1,10 @@ +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/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 0 1/ 1 0 - 0 10 - 10 1 diff --git a/tests/f_collapse_extent_tree/image.gz b/tests/f_collapse_extent_tree/image.gz Binary files differnew file mode 100644 index 0000000..97036cc --- /dev/null +++ b/tests/f_collapse_extent_tree/image.gz diff --git a/tests/f_collapse_extent_tree/name b/tests/f_collapse_extent_tree/name new file mode 100644 index 0000000..83e506f --- /dev/null +++ b/tests/f_collapse_extent_tree/name @@ -0,0 +1 @@ +extent tree can be collapsed one level diff --git a/tests/f_collapse_extent_tree/script b/tests/f_collapse_extent_tree/script new file mode 100644 index 0000000..daea6a8 --- /dev/null +++ b/tests/f_collapse_extent_tree/script @@ -0,0 +1,115 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +eval $PREP_CMD + +echo 'ex /a' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +rm -f $TMPFILE.cmd +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 +rm -f $OUT1.new + +if [ "$ONE_PASS_ONLY" != "true" ]; then + $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 + status=$? + echo Exit status is $status >> $OUT2.new + echo 'ex /a' > $TMPFILE.cmd + $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 + sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 + rm -f $TMPFILE.cmd $OUT2.new +fi + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_compress_extent_tree_level/expect.1 b/tests/f_compress_extent_tree_level/expect.1 new file mode 100644 index 0000000..241faa3 --- /dev/null +++ b/tests/f_compress_extent_tree_level/expect.1 @@ -0,0 +1,23 @@ +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 1 1/ 2 0 - 16 9 17 + 1/ 1 1/ 4 0 - 0 10 - 10 1 + 1/ 1 2/ 4 11 - 11 100 - 100 1 + 1/ 1 3/ 4 13 - 13 101 - 101 1 + 1/ 1 4/ 4 15 - 15 102 - 102 1 + 0/ 1 2/ 2 17 - 21 12 5 + 1/ 1 1/ 3 17 - 17 103 - 103 1 + 1/ 1 2/ 3 19 - 19 104 - 104 1 + 1/ 1 3/ 3 21 - 21 105 - 105 1 +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent tree (at level 1) could be narrower. Optimize? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 26/512 blocks +Exit status is 0 diff --git a/tests/f_compress_extent_tree_level/expect.2 b/tests/f_compress_extent_tree_level/expect.2 new file mode 100644 index 0000000..07d1082 --- /dev/null +++ b/tests/f_compress_extent_tree_level/expect.2 @@ -0,0 +1,17 @@ +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/128 files (8.3% non-contiguous), 26/512 blocks +Exit status is 0 +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 21 9 22 + 1/ 1 1/ 7 0 - 0 10 - 10 1 + 1/ 1 2/ 7 11 - 11 100 - 100 1 + 1/ 1 3/ 7 13 - 13 101 - 101 1 + 1/ 1 4/ 7 15 - 15 102 - 102 1 + 1/ 1 5/ 7 17 - 17 103 - 103 1 + 1/ 1 6/ 7 19 - 19 104 - 104 1 + 1/ 1 7/ 7 21 - 21 105 - 105 1 diff --git a/tests/f_compress_extent_tree_level/image.gz b/tests/f_compress_extent_tree_level/image.gz Binary files differnew file mode 100644 index 0000000..a552a58 --- /dev/null +++ b/tests/f_compress_extent_tree_level/image.gz diff --git a/tests/f_compress_extent_tree_level/name b/tests/f_compress_extent_tree_level/name new file mode 100644 index 0000000..fde4f4a --- /dev/null +++ b/tests/f_compress_extent_tree_level/name @@ -0,0 +1 @@ +compress an extent tree level diff --git a/tests/f_compress_extent_tree_level/script b/tests/f_compress_extent_tree_level/script new file mode 100644 index 0000000..c5ffa22 --- /dev/null +++ b/tests/f_compress_extent_tree_level/script @@ -0,0 +1,117 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +cp /dev/null $OUT1 + +eval $PREP_CMD + +echo 'ex /a' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +rm -f $TMPFILE.cmd +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 +rm -f $OUT1.new + +if [ "$ONE_PASS_ONLY" != "true" ]; then + $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 + status=$? + echo Exit status is $status >> $OUT2.new + echo 'ex /a' > $TMPFILE.cmd + $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 + sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 + rm -f $TMPFILE.cmd $OUT2.new +fi + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_convert_bmap/expect.1 b/tests/f_convert_bmap/expect.1 new file mode 100644 index 0000000..716dbcb --- /dev/null +++ b/tests/f_convert_bmap/expect.1 @@ -0,0 +1,26 @@ +debugfs: stat /a +Inode: 12 Type: regular Mode: 0644 Flags: 0x0 +Generation: 1573716129 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 524288 +File ACL: 0 +Links: 1 Blockcount: 1030 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x5457f87a:62ae2980 -- Mon Nov 3 21:49:46 2014 + atime: 0x5457f87a:61ba0598 -- Mon Nov 3 21:49:46 2014 + mtime: 0x5457f87a:62ae2980 -- Mon Nov 3 21:49:46 2014 +crtime: 0x5457f87a:61ba0598 -- Mon Nov 3 21:49:46 2014 +Size of extra inode fields: 28 +BLOCKS: +(0-11):1025-1036, (IND):24, (12-267):1037-1292, (DIND):25, (IND):41, (268-511):1293-1536 +TOTAL: 515 + +Pass 1: Checking inodes, blocks, and sizes +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 570/2048 blocks +Exit status is 0 diff --git a/tests/f_convert_bmap/expect.2 b/tests/f_convert_bmap/expect.2 new file mode 100644 index 0000000..632d411 --- /dev/null +++ b/tests/f_convert_bmap/expect.2 @@ -0,0 +1,10 @@ +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/128 files (0.0% non-contiguous), 570/2048 blocks +Exit status is 0 +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 0 1/ 1 0 - 511 1025 - 1536 512 diff --git a/tests/f_convert_bmap/image.gz b/tests/f_convert_bmap/image.gz Binary files differnew file mode 100644 index 0000000..7c22532 --- /dev/null +++ b/tests/f_convert_bmap/image.gz diff --git a/tests/f_convert_bmap/name b/tests/f_convert_bmap/name new file mode 100644 index 0000000..67e0d47 --- /dev/null +++ b/tests/f_convert_bmap/name @@ -0,0 +1 @@ +convert blockmap file to extents file diff --git a/tests/f_convert_bmap/script b/tests/f_convert_bmap/script new file mode 100644 index 0000000..960a2f8 --- /dev/null +++ b/tests/f_convert_bmap/script @@ -0,0 +1,115 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +cp /dev/null $OUT1 + +eval $PREP_CMD + +echo 'stat /a' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +rm -f $TMPFILE.cmd +$TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1 +$FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 + +$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 +status=$? +echo Exit status is $status >> $OUT2.new +echo 'ex /a' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 +rm -f $TMPFILE.cmd $OUT1.new $OUT2.new + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_convert_bmap_and_extent/expect.1 b/tests/f_convert_bmap_and_extent/expect.1 new file mode 100644 index 0000000..eafd64a --- /dev/null +++ b/tests/f_convert_bmap_and_extent/expect.1 @@ -0,0 +1,33 @@ +debugfs: stat /a +Inode: 12 Type: regular Mode: 0644 Flags: 0x0 +Generation: 1573716129 Version: 0x00000000:00000001 +User: 0 Group: 0 Size: 524288 +File ACL: 0 +Links: 1 Blockcount: 1030 +Fragment: Address: 0 Number: 0 Size: 0 + ctime: 0x5457f87a:62ae2980 -- Mon Nov 3 21:49:46 2014 + atime: 0x5457f87a:61ba0598 -- Mon Nov 3 21:49:46 2014 + mtime: 0x5457f87a:62ae2980 -- Mon Nov 3 21:49:46 2014 +crtime: 0x5457f87a:61ba0598 -- Mon Nov 3 21:49:46 2014 +Size of extra inode fields: 28 +BLOCKS: +(0-11):1025-1036, (IND):24, (12-267):1037-1292, (DIND):25, (IND):41, (268-511):1293-1536 +TOTAL: 515 + +debugfs: ex /zero +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 8 28 9 + 1/ 1 1/ 4 0 - 0 27 - 27 1 + 1/ 1 2/ 4 2 - 2 29 - 29 1 + 1/ 1 3/ 4 4 - 4 31 - 31 1 + 1/ 1 4/ 4 6 - 6 33 - 33 1 +Pass 1: Checking inodes, blocks, and sizes +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/128 files (15.4% non-contiguous), 574/2048 blocks +Exit status is 0 diff --git a/tests/f_convert_bmap_and_extent/expect.2 b/tests/f_convert_bmap_and_extent/expect.2 new file mode 100644 index 0000000..73765ea --- /dev/null +++ b/tests/f_convert_bmap_and_extent/expect.2 @@ -0,0 +1,16 @@ +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: 13/128 files (7.7% non-contiguous), 574/2048 blocks +Exit status is 0 +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 0 1/ 1 0 - 511 1025 - 1536 512 +debugfs: ex /zero +Level Entries Logical Physical Length Flags + 0/ 0 1/ 4 0 - 0 27 - 27 1 + 0/ 0 2/ 4 2 - 2 29 - 29 1 + 0/ 0 3/ 4 4 - 4 31 - 31 1 + 0/ 0 4/ 4 6 - 6 33 - 33 1 diff --git a/tests/f_convert_bmap_and_extent/image.gz b/tests/f_convert_bmap_and_extent/image.gz Binary files differnew file mode 100644 index 0000000..916b493 --- /dev/null +++ b/tests/f_convert_bmap_and_extent/image.gz diff --git a/tests/f_convert_bmap_and_extent/name b/tests/f_convert_bmap_and_extent/name new file mode 100644 index 0000000..1a58794 --- /dev/null +++ b/tests/f_convert_bmap_and_extent/name @@ -0,0 +1 @@ +convert blockmap to extents files diff --git a/tests/f_convert_bmap_and_extent/script b/tests/f_convert_bmap_and_extent/script new file mode 100644 index 0000000..f61c8e2 --- /dev/null +++ b/tests/f_convert_bmap_and_extent/script @@ -0,0 +1,117 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +cp /dev/null $OUT1 + +eval $PREP_CMD + +echo 'stat /a' > $TMPFILE.cmd +echo 'ex /zero' >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +rm -f $TMPFILE.cmd +$TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1 +$FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 + +$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 +status=$? +echo Exit status is $status >> $OUT2.new +echo 'ex /a' > $TMPFILE.cmd +echo 'ex /zero' >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 +rm -f $TMPFILE.cmd $OUT1.new $OUT2.new + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_convert_bmap_sparse/expect.1 b/tests/f_convert_bmap_sparse/expect.1 new file mode 100644 index 0000000..095fb2b --- /dev/null +++ b/tests/f_convert_bmap_sparse/expect.1 @@ -0,0 +1,24 @@ +debugfs: stat /realmode.bin +Inode: 12 Type: regular Mode: 0775 Flags: 0x0 +Generation: 2022334337 Version: 0x00000001 +User: 1000 Group: 1000 Size: 21080 +File ACL: 0 +Links: 1 Blockcount: 16 +Fragment: Address: 0 Number: 0 Size: 0 +ctime: 0x5924849d -- Tue May 23 18:51:09 2017 +atime: 0x59247d36 -- Tue May 23 18:19:34 2017 +mtime: 0x591e1764 -- Thu May 18 21:51:32 2017 +BLOCKS: +(0):513, (4-8):514-518, (IND):58, (20):2005 +TOTAL: 8 + +Pass 1: Checking inodes, blocks, and sizes +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/256 files (8.3% non-contiguous), 65/2048 blocks +Exit status is 0 diff --git a/tests/f_convert_bmap_sparse/expect.2 b/tests/f_convert_bmap_sparse/expect.2 new file mode 100644 index 0000000..e5a3d44 --- /dev/null +++ b/tests/f_convert_bmap_sparse/expect.2 @@ -0,0 +1,12 @@ +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/256 files (8.3% non-contiguous), 65/2048 blocks +Exit status is 0 +debugfs: ex /realmode.bin +Level Entries Logical Physical Length Flags + 0/ 0 1/ 3 0 - 0 513 - 513 1 + 0/ 0 2/ 3 4 - 8 514 - 518 5 + 0/ 0 3/ 3 20 - 20 2005 - 2005 1 diff --git a/tests/f_convert_bmap_sparse/image.gz b/tests/f_convert_bmap_sparse/image.gz Binary files differnew file mode 100644 index 0000000..1f594fd --- /dev/null +++ b/tests/f_convert_bmap_sparse/image.gz diff --git a/tests/f_convert_bmap_sparse/name b/tests/f_convert_bmap_sparse/name new file mode 100644 index 0000000..dc3b985 --- /dev/null +++ b/tests/f_convert_bmap_sparse/name @@ -0,0 +1 @@ +convert sparse blockmap file to extents file diff --git a/tests/f_convert_bmap_sparse/script b/tests/f_convert_bmap_sparse/script new file mode 100644 index 0000000..e78a4bd --- /dev/null +++ b/tests/f_convert_bmap_sparse/script @@ -0,0 +1,115 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +cp /dev/null $OUT1 + +eval $PREP_CMD + +echo 'stat /realmode.bin' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +rm -f $TMPFILE.cmd +$TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1 +$FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 + +$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 +status=$? +echo Exit status is $status >> $OUT2.new +echo 'ex /realmode.bin' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 +rm -f $TMPFILE.cmd $OUT1.new $OUT2.new + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_corrupt_dirent_tail/expect.1 b/tests/f_corrupt_dirent_tail/expect.1 new file mode 100644 index 0000000..0813755 --- /dev/null +++ b/tests/f_corrupt_dirent_tail/expect.1 @@ -0,0 +1,16 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 2, block #0, offset 0: directory has no checksum. +Fix? yes + +Directory inode 2, block #0, offset 1012: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (9.1% non-contiguous), 1090/2048 blocks +Exit status is 1 diff --git a/tests/f_corrupt_dirent_tail/expect.2 b/tests/f_corrupt_dirent_tail/expect.2 new file mode 100644 index 0000000..c42466d --- /dev/null +++ b/tests/f_corrupt_dirent_tail/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: 11/128 files (9.1% non-contiguous), 1090/2048 blocks +Exit status is 0 diff --git a/tests/f_corrupt_dirent_tail/image.gz b/tests/f_corrupt_dirent_tail/image.gz Binary files differnew file mode 100644 index 0000000..f275308 --- /dev/null +++ b/tests/f_corrupt_dirent_tail/image.gz diff --git a/tests/f_corrupt_dirent_tail/name b/tests/f_corrupt_dirent_tail/name new file mode 100644 index 0000000..08259a3 --- /dev/null +++ b/tests/f_corrupt_dirent_tail/name @@ -0,0 +1 @@ +rebuild a directory with corrupt dirent tail diff --git a/tests/f_crashdisk/expect.1 b/tests/f_crashdisk/expect.1 new file mode 100644 index 0000000..6898030 --- /dev/null +++ b/tests/f_crashdisk/expect.1 @@ -0,0 +1,17 @@ +ext2fs_open2: The ext2 superblock is corrupt +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img +../e2fsck/e2fsck: Trying to load superblock despite errors... +ext2fs_open2: The ext2 superblock is corrupt +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +Exit status is 8 diff --git a/tests/f_crashdisk/image.gz b/tests/f_crashdisk/image.gz Binary files differnew file mode 100644 index 0000000..060e7a0 --- /dev/null +++ b/tests/f_crashdisk/image.gz diff --git a/tests/f_crashdisk/name b/tests/f_crashdisk/name new file mode 100644 index 0000000..2b28207 --- /dev/null +++ b/tests/f_crashdisk/name @@ -0,0 +1 @@ +superblock with illegal values diff --git a/tests/f_crashdisk/script b/tests/f_crashdisk/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_crashdisk/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_create_symlinks/expect b/tests/f_create_symlinks/expect new file mode 100644 index 0000000..3033f8a --- /dev/null +++ b/tests/f_create_symlinks/expect @@ -0,0 +1,81 @@ +mke2fs -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 test.img 1024 +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: 11/128 files (0.0% non-contiguous), 441/1024 blocks +Exit status is 0 +debugfs -R "symlink /l_30 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +debugfs -R "symlink /l_60 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +debugfs -R "symlink /l_70 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +debugfs -R "symlink /l_500 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +debugfs -R "symlink /l_1023 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +debugfs -R "symlink /l_1024 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +ext2fs_symlink: Invalid argument passed to ext2 library while creating symlink "l_1024" +symlink: Invalid argument passed to ext2 library +debugfs -R "symlink /l_1500 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img +ext2fs_symlink: Invalid argument passed to ext2 library while creating symlink "l_1500" +symlink: Invalid argument passed to ext2 library +debugfs -R "stat /l_30" test.img +Inode: 12 Type: symlink Mode: 0777 Flags: 0x0 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 30 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +debugfs -R "stat /l_60" test.img +Inode: 13 Type: symlink Mode: 0777 Flags: 0x10000000 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 60 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +Extended attributes: + system.data (0) +Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +debugfs -R "stat /l_70" test.img +Inode: 14 Type: symlink Mode: 0777 Flags: 0x10000000 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 70 +File ACL: 0 +Links: 1 Blockcount: 0 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +Extended attributes: + system.data (10) +Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +debugfs -R "stat /l_500" test.img +Inode: 15 Type: symlink Mode: 0777 Flags: 0x80000 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 500 +File ACL: 0 +Links: 1 Blockcount: 2 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +EXTENTS: +(0):153 +debugfs -R "stat /l_1023" test.img +Inode: 16 Type: symlink Mode: 0777 Flags: 0x80000 +Generation: 0 Version: 0x00000000:00000000 +User: 0 Group: 0 Project: 0 Size: 1023 +File ACL: 0 +Links: 1 Blockcount: 2 +Fragment: Address: 0 Number: 0 Size: 0 +Size of extra inode fields: 32 +EXTENTS: +(0):154 +debugfs -R "stat /l_1024" test.img +/l_1024: File not found by ext2_lookup +debugfs -R "stat /l_1500" test.img +/l_1500: File not found by ext2_lookup +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: 16/128 files (0.0% non-contiguous), 443/1024 blocks +Exit status is 0 diff --git a/tests/f_create_symlinks/name b/tests/f_create_symlinks/name new file mode 100644 index 0000000..0930e79 --- /dev/null +++ b/tests/f_create_symlinks/name @@ -0,0 +1 @@ +create fast, inlinedata, and regular symlinks diff --git a/tests/f_create_symlinks/script b/tests/f_create_symlinks/script new file mode 100644 index 0000000..169f58d --- /dev/null +++ b/tests/f_create_symlinks/script @@ -0,0 +1,54 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 test.img 1024 > $OUT.new +$MKE2FS -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 $TMPFILE 1024 >> $OUT 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +for i in 30 60 70 500 1023 1024 1500; do + echo "debugfs -R \"symlink /l_$i $(perl -e "print 'x' x $i;")\" test.img" >> $OUT.new + $DEBUGFS -w -R "symlink /l_$i $(perl -e "print 'x' x $i;")" $TMPFILE \ + 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT.new +done + +for i in 30 60 70 500 1023 1024 1500; do + echo "debugfs -R \"stat /l_$i\" test.img" >> $OUT.new + $DEBUGFS -R "stat /l_$i" $TMPFILE 2>&1 | \ + grep -v "time: " >> $OUT.new +done + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new >> $OUT +rm -f $OUT.new $TMPFILE + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_del_dup_quota/expect.1 b/tests/f_del_dup_quota/expect.1 new file mode 100644 index 0000000..71b7440 --- /dev/null +++ b/tests/f_del_dup_quota/expect.1 @@ -0,0 +1,39 @@ +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 8129 +Multiply-claimed block(s) in inode 13: 8129 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) + +File /testfile1 (inode #12, mod time Wed May 24 23:10:38 2017) + has 1 multiply-claimed block(s), shared with 1 file(s): + /testfile2 (inode #13, mod time Wed May 24 23:10:45 2017) +Clone multiply-claimed blocks<y>? no +Delete file<y>? yes +File /testfile2 (inode #13, mod time Wed May 24 23:10:45 2017) + has 1 multiply-claimed block(s), shared with 1 file(s): + /testfile1 (inode #12, mod time Wed May 24 23:10:38 2017) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Entry 'testfile1' in / (2) has deleted/unused inode 12. Clear<y>? yes +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -1374 +Fix<y>? yes +Free blocks count wrong for group #0 (6815, counted=6816). +Fix<y>? yes +Free blocks count wrong (6815, counted=6816). +Fix<y>? yes +[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 3) != expected (17408, 4) +Update quota info for quota type 0<y>? yes +[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 3) != expected (17408, 4) +Update quota info for quota type 1<y>? yes + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/2048 files (33.3% non-contiguous), 1376/8192 blocks +Exit status is 0 diff --git a/tests/f_del_dup_quota/expect.2 b/tests/f_del_dup_quota/expect.2 new file mode 100644 index 0000000..14f99b8 --- /dev/null +++ b/tests/f_del_dup_quota/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/2048 files (25.0% non-contiguous), 1376/8192 blocks +Exit status is 0 diff --git a/tests/f_del_dup_quota/image.bz2 b/tests/f_del_dup_quota/image.bz2 Binary files differnew file mode 100644 index 0000000..fc91e2a --- /dev/null +++ b/tests/f_del_dup_quota/image.bz2 diff --git a/tests/f_del_dup_quota/name b/tests/f_del_dup_quota/name new file mode 100644 index 0000000..8b29fd4 --- /dev/null +++ b/tests/f_del_dup_quota/name @@ -0,0 +1 @@ +delete file containing multiply claimed blocks with quota diff --git a/tests/f_del_dup_quota/script b/tests/f_del_dup_quota/script new file mode 100644 index 0000000..5480c3f --- /dev/null +++ b/tests/f_del_dup_quota/script @@ -0,0 +1,34 @@ +#!/bin/bash + +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix the multiply-claimed block breakage +FSCK_OPT=-f +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +echo "nyyyyyyy" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time to verify that fsck completely repaired everything in +# the first run, including quota corrections +FSCK_OPT=-fn +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +rm -f $test_name.failed $test_name.ok +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi +unset EXP1 OUT1 EXP2 OUT2 FSCK_OPT IMAGE diff --git a/tests/f_deleted_inode_bad_csum/expect.1 b/tests/f_deleted_inode_bad_csum/expect.1 new file mode 100644 index 0000000..8420361 --- /dev/null +++ b/tests/f_deleted_inode_bad_csum/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 passes checks, but checksum does not match inode. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_deleted_inode_bad_csum/expect.2 b/tests/f_deleted_inode_bad_csum/expect.2 new file mode 100644 index 0000000..eb48b40 --- /dev/null +++ b/tests/f_deleted_inode_bad_csum/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/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_deleted_inode_bad_csum/image.gz b/tests/f_deleted_inode_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..a27e50e --- /dev/null +++ b/tests/f_deleted_inode_bad_csum/image.gz diff --git a/tests/f_deleted_inode_bad_csum/name b/tests/f_deleted_inode_bad_csum/name new file mode 100644 index 0000000..c034ace --- /dev/null +++ b/tests/f_deleted_inode_bad_csum/name @@ -0,0 +1 @@ +deleted inode with bad metadata_csum wasn't fixed diff --git a/tests/f_desc_size_128/expect.1 b/tests/f_desc_size_128/expect.1 new file mode 100644 index 0000000..a62f112 --- /dev/null +++ b/tests/f_desc_size_128/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: 11/256 files (0.0% non-contiguous), 150/8192 blocks +Exit status is 0 diff --git a/tests/f_desc_size_128/expect.2 b/tests/f_desc_size_128/expect.2 new file mode 100644 index 0000000..a62f112 --- /dev/null +++ b/tests/f_desc_size_128/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: 11/256 files (0.0% non-contiguous), 150/8192 blocks +Exit status is 0 diff --git a/tests/f_desc_size_128/image.gz b/tests/f_desc_size_128/image.gz Binary files differnew file mode 100644 index 0000000..eda0cab --- /dev/null +++ b/tests/f_desc_size_128/image.gz diff --git a/tests/f_desc_size_128/name b/tests/f_desc_size_128/name new file mode 100644 index 0000000..f09e003 --- /dev/null +++ b/tests/f_desc_size_128/name @@ -0,0 +1 @@ +128-byte group descriptors diff --git a/tests/f_desc_size_bad/expect.1 b/tests/f_desc_size_bad/expect.1 new file mode 100644 index 0000000..84b852a --- /dev/null +++ b/tests/f_desc_size_bad/expect.1 @@ -0,0 +1,13 @@ +../e2fsck/e2fsck: Block group descriptor size incorrect while trying to open test.img +../e2fsck/e2fsck: Trying to load superblock despite errors... +ext2fs_check_desc: Block group descriptor size incorrect +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 805/2048 blocks +Exit status is 1 diff --git a/tests/f_desc_size_bad/expect.2 b/tests/f_desc_size_bad/expect.2 new file mode 100644 index 0000000..012f837 --- /dev/null +++ b/tests/f_desc_size_bad/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: 11/32 files (0.0% non-contiguous), 805/2048 blocks +Exit status is 0 diff --git a/tests/f_desc_size_bad/script b/tests/f_desc_size_bad/script new file mode 100644 index 0000000..ae29627 --- /dev/null +++ b/tests/f_desc_size_bad/script @@ -0,0 +1,17 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +DESCRIPTION="bad superblock s_desc_size" +SKIP_GUNZIP=true +touch $TMPFILE +$MKE2FS -F -o Linux -O 64bit,extents -N 32 -b 1024 -g 512 -E desc_size=128 $TMPFILE 2048 > $test_name.log 2>&1 +$DEBUGFS -R "ssv desc_size 129" -w $TMPFILE >> $test_name.log 2>&1 + +E2FSCK_TIME=200704102100 +export E2FSCK_TIME + +. $cmd_dir/run_e2fsck + +unset E2FSCK_TIME diff --git a/tests/f_detect_junk/expect b/tests/f_detect_junk/expect new file mode 100644 index 0000000..39f99af --- /dev/null +++ b/tests/f_detect_junk/expect @@ -0,0 +1,22 @@ +*** e2fsck +ext2fs_open2: Bad magic number in super-block +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +*** debugfs +debugfs: Bad magic number in super-block while trying to open test.img +*** tune2fs +../misc/tune2fs: Bad magic number in super-block while trying to open test.img +*** mke2fs +Creating filesystem with 16384 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193 + diff --git a/tests/f_detect_junk/expect.nodebugfs b/tests/f_detect_junk/expect.nodebugfs new file mode 100644 index 0000000..b528046 --- /dev/null +++ b/tests/f_detect_junk/expect.nodebugfs @@ -0,0 +1,21 @@ +*** e2fsck +ext2fs_open2: Bad magic number in super-block +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +*** debugfs +*** tune2fs +../misc/tune2fs: Bad magic number in super-block while trying to open test.img +*** mke2fs +Creating filesystem with 16384 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193 + diff --git a/tests/f_detect_junk/image.bz2 b/tests/f_detect_junk/image.bz2 Binary files differnew file mode 100644 index 0000000..3d52600 --- /dev/null +++ b/tests/f_detect_junk/image.bz2 diff --git a/tests/f_detect_junk/name b/tests/f_detect_junk/name new file mode 100644 index 0000000..81cf655 --- /dev/null +++ b/tests/f_detect_junk/name @@ -0,0 +1 @@ +detect non-fs file data diff --git a/tests/f_detect_junk/script b/tests/f_detect_junk/script new file mode 100644 index 0000000..2577842 --- /dev/null +++ b/tests/f_detect_junk/script @@ -0,0 +1,43 @@ +#!/bin/bash + +if [ "$(grep -c 'define HAVE_MAGIC_H' ../lib/config.h)" -eq 0 ]; then + echo "$test_name: skipped (no magic)" + exit 0 +fi + +FSCK_OPT=-fn +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE +$DD if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1 + +# Run fsck to fix things? +if [ -x $DEBUGFS_EXE ]; then + EXP=$test_dir/expect +else + EXP=$test_dir/expect.nodebugfs +fi +OUT=$test_name.log +rm -f $test_name.failed $test_name.ok + +echo "*** e2fsck" > $OUT +$FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 +echo "*** debugfs" >> $OUT +test -x $DEBUGFS_EXE && $DEBUGFS -R 'quit' $TMPFILE >> $OUT 2>&1 +echo "*** tune2fs" >> $OUT +$TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 +echo "*** mke2fs" >> $OUT +$MKE2FS -n $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed < $OUT > $OUT.new +mv $OUT.new $OUT + +# Figure out what happened +if cmp -s $EXP $OUT; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT >> $test_name.failed +fi +unset EXP OUT FSCK_OPT IMAGE diff --git a/tests/f_detect_xfs/expect b/tests/f_detect_xfs/expect new file mode 100644 index 0000000..a48e8af --- /dev/null +++ b/tests/f_detect_xfs/expect @@ -0,0 +1,25 @@ +*** e2fsck +ext2fs_open2: Bad magic number in super-block +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +test.img contains a xfs file system labelled 'test_filsys' +*** debugfs +debugfs: Bad magic number in super-block while trying to open test.img +test.img contains a xfs file system labelled 'test_filsys' +*** tune2fs +../misc/tune2fs: Bad magic number in super-block while trying to open test.img +test.img contains a xfs file system labelled 'test_filsys' +*** mke2fs +Creating filesystem with 16384 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193 + diff --git a/tests/f_detect_xfs/expect.nodebugfs b/tests/f_detect_xfs/expect.nodebugfs new file mode 100644 index 0000000..26a8a4a --- /dev/null +++ b/tests/f_detect_xfs/expect.nodebugfs @@ -0,0 +1,24 @@ +*** e2fsck +ext2fs_open2: Bad magic number in super-block +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +test.img contains a xfs file system labelled 'test_filsys' +*** debugfs +*** tune2fs +../misc/tune2fs: Bad magic number in super-block while trying to open test.img +test.img contains a xfs file system labelled 'test_filsys' +*** mke2fs +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 16384 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 8193 + diff --git a/tests/f_detect_xfs/image.bz2 b/tests/f_detect_xfs/image.bz2 Binary files differnew file mode 100644 index 0000000..9dc5e44 --- /dev/null +++ b/tests/f_detect_xfs/image.bz2 diff --git a/tests/f_detect_xfs/name b/tests/f_detect_xfs/name new file mode 100644 index 0000000..d5b9b82 --- /dev/null +++ b/tests/f_detect_xfs/name @@ -0,0 +1 @@ +detect xfs filesystem diff --git a/tests/f_detect_xfs/script b/tests/f_detect_xfs/script new file mode 100644 index 0000000..bd2c1e8 --- /dev/null +++ b/tests/f_detect_xfs/script @@ -0,0 +1,37 @@ +#!/bin/bash + +FSCK_OPT=-fn +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +if [ -x $DEBUGFS_EXE ]; then + EXP=$test_dir/expect +else + EXP=$test_dir/expect.nodebugfs +fi +OUT=$test_name.log +rm -f $test_name.failed $test_name.ok + +echo "*** e2fsck" > $OUT +$FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 +echo "*** debugfs" >> $OUT +test -x $DEBUGFS_EXE && $DEBUGFS -R 'quit' $TMPFILE >> $OUT 2>&1 +echo "*** tune2fs" >> $OUT +$TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 +echo "*** mke2fs" >> $OUT +$MKE2FS -n -b 1024 $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed < $OUT > $OUT.new +mv $OUT.new $OUT + +# Figure out what happened +if cmp -s $EXP $OUT; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT >> $test_name.failed +fi +unset EXP OUT FSCK_OPT IMAGE diff --git a/tests/f_dir_bad_csum/expect.1 b/tests/f_dir_bad_csum/expect.1 new file mode 100644 index 0000000..ae4b410 --- /dev/null +++ b/tests/f_dir_bad_csum/expect.1 @@ -0,0 +1,48 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 12, block #0: directory passes checks but fails checksum. +Fix? yes + +Directory inode 13, block #0, offset 0: directory has no checksum. +Fix? yes + +Directory inode 14, block #0, offset 0: directory has no checksum. +Fix? yes + +Directory inode 15, block #0, offset 1000: directory corrupted +Salvage? yes + +Entry '' in ??? (15) has rec_len of 0, should be 12. +Fix? yes + +Directory inode 16, block #0, offset 12: directory corrupted +Salvage? yes + +Directory inode 17, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 17. +Fix? yes + +Missing '..' in directory inode 17. +Fix? yes + +Entry 'file' in ??? (18) has invalid inode #: 4294967295. +Clear? yes + +Pass 3: Checking directory connectivity +'..' in /6 (17) is <The NULL inode> (0), should be / (2). +Fix? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Unattached inode 19 +Connect to /lost+found? yes + +Inode 19 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 19/128 files (5.3% non-contiguous), 1098/2048 blocks +Exit status is 1 diff --git a/tests/f_dir_bad_csum/expect.2 b/tests/f_dir_bad_csum/expect.2 new file mode 100644 index 0000000..f5a3e5f --- /dev/null +++ b/tests/f_dir_bad_csum/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: 19/128 files (5.3% non-contiguous), 1098/2048 blocks +Exit status is 0 diff --git a/tests/f_dir_bad_csum/image.gz b/tests/f_dir_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..4b58187 --- /dev/null +++ b/tests/f_dir_bad_csum/image.gz diff --git a/tests/f_dir_bad_csum/name b/tests/f_dir_bad_csum/name new file mode 100644 index 0000000..6397e9d --- /dev/null +++ b/tests/f_dir_bad_csum/name @@ -0,0 +1 @@ +dir block w/ missing/bad csum/tail or block corruption diff --git a/tests/f_dir_bad_mode/expect.1 b/tests/f_dir_bad_mode/expect.1 new file mode 100644 index 0000000..10b4a99 --- /dev/null +++ b/tests/f_dir_bad_mode/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 is a socket but it looks like it is really a directory. +Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/16 files (0.0% non-contiguous), 25/100 blocks +Exit status is 1 diff --git a/tests/f_dir_bad_mode/expect.2 b/tests/f_dir_bad_mode/expect.2 new file mode 100644 index 0000000..7d2352d --- /dev/null +++ b/tests/f_dir_bad_mode/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: 15/16 files (0.0% non-contiguous), 25/100 blocks +Exit status is 0 diff --git a/tests/f_dir_bad_mode/image.gz b/tests/f_dir_bad_mode/image.gz Binary files differnew file mode 100644 index 0000000..2f647a1 --- /dev/null +++ b/tests/f_dir_bad_mode/image.gz diff --git a/tests/f_dir_bad_mode/name b/tests/f_dir_bad_mode/name new file mode 100644 index 0000000..7cbacc2 --- /dev/null +++ b/tests/f_dir_bad_mode/name @@ -0,0 +1 @@ +directory with corrupted i_mode diff --git a/tests/f_dirlink/expect.1 b/tests/f_dirlink/expect.1 new file mode 100644 index 0000000..f53c0e1 --- /dev/null +++ b/tests/f_dirlink/expect.1 @@ -0,0 +1,14 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'quux' in /foo (12) is a link to directory /bar (13). +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (0.0% non-contiguous), 24/100 blocks +Exit status is 1 diff --git a/tests/f_dirlink/expect.2 b/tests/f_dirlink/expect.2 new file mode 100644 index 0000000..cab021a --- /dev/null +++ b/tests/f_dirlink/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: 13/32 files (0.0% non-contiguous), 24/100 blocks +Exit status is 0 diff --git a/tests/f_dirlink/image.gz b/tests/f_dirlink/image.gz Binary files differnew file mode 100644 index 0000000..2e8def4 --- /dev/null +++ b/tests/f_dirlink/image.gz diff --git a/tests/f_dirlink/name b/tests/f_dirlink/name new file mode 100644 index 0000000..30dbdce --- /dev/null +++ b/tests/f_dirlink/name @@ -0,0 +1 @@ +directory hard links diff --git a/tests/f_dup/expect.1 b/tests/f_dup/expect.1 new file mode 100644 index 0000000..635a0df --- /dev/null +++ b/tests/f_dup/expect.1 @@ -0,0 +1,40 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 25--26 +Multiply-claimed block(s) in inode 13: 25--26 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) + +File /termcap (inode #12, mod time Tue Sep 21 03:19:14 1993) + has 2 multiply-claimed block(s), shared with 1 file(s): + /motd (inode #13, mod time Tue Sep 21 03:19:20 1993) +Clone multiply-claimed blocks? yes + +File /motd (inode #13, mod time Tue Sep 21 03:19:20 1993) + has 2 multiply-claimed block(s), shared with 1 file(s): + /termcap (inode #12, mod time Tue Sep 21 03:19:14 1993) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (44, counted=60). +Fix? yes + +Free blocks count wrong (62, counted=60). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Padding at end of block bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (7.7% non-contiguous), 40/100 blocks +Exit status is 1 diff --git a/tests/f_dup/expect.2 b/tests/f_dup/expect.2 new file mode 100644 index 0000000..1aeb159 --- /dev/null +++ b/tests/f_dup/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: 13/16 files (15.4% non-contiguous), 40/100 blocks +Exit status is 0 diff --git a/tests/f_dup/image.gz b/tests/f_dup/image.gz Binary files differnew file mode 100644 index 0000000..3e04690 --- /dev/null +++ b/tests/f_dup/image.gz diff --git a/tests/f_dup/name b/tests/f_dup/name new file mode 100644 index 0000000..6296b83 --- /dev/null +++ b/tests/f_dup/name @@ -0,0 +1 @@ +blocks claimed by two different files diff --git a/tests/f_dup2/expect.1 b/tests/f_dup2/expect.1 new file mode 100644 index 0000000..04d7304 --- /dev/null +++ b/tests/f_dup2/expect.1 @@ -0,0 +1,47 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 25--26 +Multiply-claimed block(s) in inode 13: 25--26 57--58 +Multiply-claimed block(s) in inode 14: 57--58 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File /termcap (inode #12, mod time Tue Sep 21 03:19:14 1993) + has 2 multiply-claimed block(s), shared with 1 file(s): + /motd (inode #13, mod time Tue Sep 21 03:19:20 1993) +Clone multiply-claimed blocks? yes + +File /motd (inode #13, mod time Tue Sep 21 03:19:20 1993) + has 4 multiply-claimed block(s), shared with 2 file(s): + /pass1.c (inode #14, mod time Tue Sep 21 04:28:37 1993) + /termcap (inode #12, mod time Tue Sep 21 03:19:14 1993) +Clone multiply-claimed blocks? yes + +File /pass1.c (inode #14, mod time Tue Sep 21 04:28:37 1993) + has 2 multiply-claimed block(s), shared with 1 file(s): + /motd (inode #13, mod time Tue Sep 21 03:19:20 1993) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (8, counted=22). +Fix? yes + +Free blocks count wrong (26, counted=22). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Padding at end of block bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/16 files (6.3% non-contiguous), 78/100 blocks +Exit status is 1 diff --git a/tests/f_dup2/expect.2 b/tests/f_dup2/expect.2 new file mode 100644 index 0000000..0508b09 --- /dev/null +++ b/tests/f_dup2/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: 16/16 files (12.5% non-contiguous), 78/100 blocks +Exit status is 0 diff --git a/tests/f_dup2/image.gz b/tests/f_dup2/image.gz Binary files differnew file mode 100644 index 0000000..e9b853d --- /dev/null +++ b/tests/f_dup2/image.gz diff --git a/tests/f_dup2/name b/tests/f_dup2/name new file mode 100644 index 0000000..3d636e0 --- /dev/null +++ b/tests/f_dup2/name @@ -0,0 +1 @@ +blocks claimed by three different files diff --git a/tests/f_dup3/expect.1 b/tests/f_dup3/expect.1 new file mode 100644 index 0000000..5f79cb8 --- /dev/null +++ b/tests/f_dup3/expect.1 @@ -0,0 +1,47 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 16, i_blocks is 22, should be 24. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 11: 24 24 +Multiply-claimed block(s) in inode 14: 69 69 +Multiply-claimed block(s) in inode 16: 99 99 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File /lost+found (inode #11, mod time Mon Sep 20 03:26:36 1993) + has 2 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +File /pass1.c (inode #14, mod time Tue Sep 21 04:28:37 1993) + has 2 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +File /e2fsck (inode #16, mod time Tue Sep 21 04:32:22 1993) + has 2 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +Pass 2: Checking directory structure +Directory inode 11, block #12, offset 0: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -68 +Fix? yes + +Free blocks count wrong for group #0 (20, counted=19). +Fix? yes + +Free blocks count wrong (20, counted=19). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/16 files (25.0% non-contiguous), 81/100 blocks +Exit status is 1 diff --git a/tests/f_dup3/expect.2 b/tests/f_dup3/expect.2 new file mode 100644 index 0000000..2a31ae6 --- /dev/null +++ b/tests/f_dup3/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: 16/16 files (25.0% non-contiguous), 81/100 blocks +Exit status is 0 diff --git a/tests/f_dup3/image.gz b/tests/f_dup3/image.gz Binary files differnew file mode 100644 index 0000000..3712cbc --- /dev/null +++ b/tests/f_dup3/image.gz diff --git a/tests/f_dup3/name b/tests/f_dup3/name new file mode 100644 index 0000000..4f312ad --- /dev/null +++ b/tests/f_dup3/name @@ -0,0 +1 @@ +blocks claimed by one file multiple times diff --git a/tests/f_dup4/expect.1 b/tests/f_dup4/expect.1 new file mode 100644 index 0000000..8b6565c --- /dev/null +++ b/tests/f_dup4/expect.1 @@ -0,0 +1,130 @@ +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 15: 30 +Multiply-claimed block(s) in inode 16: 30 +Multiply-claimed block(s) in inode 17: 30 +Multiply-claimed block(s) in inode 18: 30 +Multiply-claimed block(s) in inode 19: 34 +Multiply-claimed block(s) in inode 20: 34 +Multiply-claimed block(s) in inode 21: 34 +Multiply-claimed block(s) in inode 22: 34 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 8 inodes containing multiply-claimed blocks.) + +File /dir4 (inode #15, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/baz (inode #18, mod time Tue Apr 10 21:00:00 2007) + /dir2/bar (inode #17, mod time Tue Apr 10 21:00:00 2007) + /dir/foo (inode #16, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir/foo (inode #16, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/baz (inode #18, mod time Tue Apr 10 21:00:00 2007) + /dir2/bar (inode #17, mod time Tue Apr 10 21:00:00 2007) + /dir4 (inode #15, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir2/bar (inode #17, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/baz (inode #18, mod time Tue Apr 10 21:00:00 2007) + /dir/foo (inode #16, mod time Tue Apr 10 21:00:00 2007) + /dir4 (inode #15, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir3/baz (inode #18, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir2/bar (inode #17, mod time Tue Apr 10 21:00:00 2007) + /dir/foo (inode #16, mod time Tue Apr 10 21:00:00 2007) + /dir4 (inode #15, mod time Tue Apr 10 21:00:00 2007) +Multiply-claimed blocks already reassigned or cloned. + +File /dir/quux1 (inode #19, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/foe (inode #22, mod time Tue Apr 10 21:00:00 2007) + /dir2/fie (inode #21, mod time Tue Apr 10 21:00:00 2007) + /dir/fee (inode #20, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir/fee (inode #20, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/foe (inode #22, mod time Tue Apr 10 21:00:00 2007) + /dir2/fie (inode #21, mod time Tue Apr 10 21:00:00 2007) + /dir/quux1 (inode #19, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir2/fie (inode #21, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir3/foe (inode #22, mod time Tue Apr 10 21:00:00 2007) + /dir/fee (inode #20, mod time Tue Apr 10 21:00:00 2007) + /dir/quux1 (inode #19, mod time Tue Apr 10 21:00:00 2007) +Clone multiply-claimed blocks? yes + +File /dir3/foe (inode #22, mod time Tue Apr 10 21:00:00 2007) + has 1 multiply-claimed block(s), shared with 3 file(s): + /dir2/fie (inode #21, mod time Tue Apr 10 21:00:00 2007) + /dir/fee (inode #20, mod time Tue Apr 10 21:00:00 2007) + /dir/quux1 (inode #19, mod time Tue Apr 10 21:00:00 2007) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Directory inode 22, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 22. +Fix? yes + +Missing '..' in directory inode 22. +Fix? yes + +Directory inode 20, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 20. +Fix? yes + +Missing '..' in directory inode 20. +Fix? yes + +Directory inode 21, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 21. +Fix? yes + +Missing '..' in directory inode 21. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in /dir/fee (20) is <The NULL inode> (0), should be /dir (12). +Fix? yes + +'..' in /dir2/fie (21) is <The NULL inode> (0), should be /dir2 (13). +Fix? yes + +'..' in /dir3/foe (22) is <The NULL inode> (0), should be /dir3 (14). +Fix? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 7. Fix? yes + +Inode 12 ref count is 4, should be 3. Fix? yes + +Inode 13 ref count is 4, should be 3. Fix? yes + +Inode 14 ref count is 4, should be 3. Fix? yes + +Inode 16 ref count is 1, should be 3. Fix? yes + +Inode 17 ref count is 1, should be 2. Fix? yes + +Inode 19 ref count is 1, should be 3. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 23/32 files (0.0% non-contiguous), 39/100 blocks +Exit status is 1 diff --git a/tests/f_dup4/expect.2 b/tests/f_dup4/expect.2 new file mode 100644 index 0000000..fe9c7e2 --- /dev/null +++ b/tests/f_dup4/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: 23/32 files (0.0% non-contiguous), 39/100 blocks +Exit status is 0 diff --git a/tests/f_dup4/name b/tests/f_dup4/name new file mode 100644 index 0000000..91cc5a3 --- /dev/null +++ b/tests/f_dup4/name @@ -0,0 +1 @@ +find all directory pathnames diff --git a/tests/f_dup4/script b/tests/f_dup4/script new file mode 100644 index 0000000..aec862d --- /dev/null +++ b/tests/f_dup4/script @@ -0,0 +1,55 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" +TEST_DATA="$test_name.tmp" + +echo "/ Murphy Magic. The SeCrEt of the UnIvErSe is 43, NOT 42" > $TEST_DATA + +touch $TMPFILE +$MKE2FS -N 32 -F -o Linux -b 1024 $TMPFILE 100 > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +set_current_time 20070410210000 +set_super_value lastcheck 0 +set_super_value hash_seed null +set_super_value mkfs_time 0 +mkdir dir +mkdir dir2 +mkdir dir3 +mkdir dir4 +cd /dir +write $TEST_DATA foo +cd /dir2 +write $TEST_DATA bar +cd /dir3 +write $TEST_DATA baz +cd /dir4 +write $TEST_DATA quux +mkdir /dir/fee +mkdir /dir2/fie +mkdir /dir3/foe +mkdir /dir4/fum +link /dir/foo /dir2/foo1 +link /dir/foo /dir3/foo2 +link /dir2/bar /dir3/bar1 +link /dir4/quux /dir/quux1 +link /dir4/quux /dir2/quux2 +set_inode_field /dir/foo block[0] 30 +set_inode_field /dir2/bar block[0] 30 +set_inode_field /dir3/baz block[0] 30 +set_inode_field /dir/fee block[0] 34 +set_inode_field /dir2/fie block[0] 34 +set_inode_field /dir3/foe block[0] 34 +q +EOF + +E2FSCK_TIME=200704102100 +export E2FSCK_TIME + +. $cmd_dir/run_e2fsck + +rm -f $TEST_DATA + +unset E2FSCK_TIME TEST_DATA diff --git a/tests/f_dup_ba/expect.1 b/tests/f_dup_ba/expect.1 new file mode 100644 index 0000000..f4581c4 --- /dev/null +++ b/tests/f_dup_ba/expect.1 @@ -0,0 +1,69 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 16, i_size is 8192, should be 409600. Fix? yes + +Inode 16, i_blocks is 128, should be 896. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 16: 160--239 +Multiply-claimed block(s) in inode 17: 160--161 +Multiply-claimed block(s) in inode 18: 176--177 +Multiply-claimed block(s) in inode 19: 192--193 +Multiply-claimed block(s) in inode 20: 208--209 +Multiply-claimed block(s) in inode 21: 224--225 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 6 inodes containing multiply-claimed blocks.) + +File /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) + has 5 multiply-claimed block(s), shared with 5 file(s): + /10 (inode #21, mod time Sun Nov 27 04:39:36 2011) + /9 (inode #20, mod time Sun Nov 27 04:39:35 2011) + /8 (inode #19, mod time Sun Nov 27 04:39:34 2011) + /7 (inode #18, mod time Sun Nov 27 04:39:33 2011) + /6 (inode #17, mod time Sun Nov 27 04:39:32 2011) +Clone multiply-claimed blocks? yes + +File /6 (inode #17, mod time Sun Nov 27 04:39:32 2011) + has 1 multiply-claimed block(s), shared with 1 file(s): + /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) +Multiply-claimed blocks already reassigned or cloned. + +File /7 (inode #18, mod time Sun Nov 27 04:39:33 2011) + has 1 multiply-claimed block(s), shared with 1 file(s): + /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) +Multiply-claimed blocks already reassigned or cloned. + +File /8 (inode #19, mod time Sun Nov 27 04:39:34 2011) + has 1 multiply-claimed block(s), shared with 1 file(s): + /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) +Multiply-claimed blocks already reassigned or cloned. + +File /9 (inode #20, mod time Sun Nov 27 04:39:35 2011) + has 1 multiply-claimed block(s), shared with 1 file(s): + /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) +Multiply-claimed blocks already reassigned or cloned. + +File /10 (inode #21, mod time Sun Nov 27 04:39:36 2011) + has 1 multiply-claimed block(s), shared with 1 file(s): + /5 (inode #16, mod time Sun Nov 27 04:39:31 2011) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +240 +Fix? yes + +Free blocks count wrong for group #0 (49, counted=43). +Fix? yes + +Free blocks count wrong (784, counted=688). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 21/64 files (0.0% non-contiguous), 336/1024 blocks +Exit status is 1 diff --git a/tests/f_dup_ba/expect.2 b/tests/f_dup_ba/expect.2 new file mode 100644 index 0000000..ec04450 --- /dev/null +++ b/tests/f_dup_ba/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: 21/64 files (4.8% non-contiguous), 336/1024 blocks +Exit status is 0 diff --git a/tests/f_dup_ba/image.gz b/tests/f_dup_ba/image.gz Binary files differnew file mode 100644 index 0000000..4b31863 --- /dev/null +++ b/tests/f_dup_ba/image.gz diff --git a/tests/f_dup_ba/name b/tests/f_dup_ba/name new file mode 100644 index 0000000..a1a8b80 --- /dev/null +++ b/tests/f_dup_ba/name @@ -0,0 +1 @@ +multiply claimed blocks with bigalloc diff --git a/tests/f_dup_de/expect-nohtree.1 b/tests/f_dup_de/expect-nohtree.1 new file mode 100644 index 0000000..64415cc --- /dev/null +++ b/tests/f_dup_de/expect-nohtree.1 @@ -0,0 +1,31 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INDEX_FL flag set on filesystem without htree support. +Clear HTree index? yes + +Pass 2: Checking directory structure +Duplicate entry 'mailcap.dpkg-old' found. + Marking /etc (12) to be rebuilt. + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Duplicate entry 'fstab' in /etc (12) found. Clear? yes + +Duplicate entry 'localtime' in /etc (12) found. Clear? yes + +Duplicate entry 'mailcap.dpkg-old' in /etc (12) found. Clear? yes + +Duplicate entry 'modules.conf.old' in /etc (12) found. Clear? yes + +Entry 'modules.conf.old' in /etc (12) has a non-unique filename. +Rename to modules.conf.o~0? yes + +Duplicate entry 'resolv.conf' in /etc (12) found. Clear? yes + +Duplicate entry 'usb.permissions' in /etc (12) found. Clear? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 18/2048 files (5.6% non-contiguous), 324/330 blocks +Exit status is 1 diff --git a/tests/f_dup_de/expect-nohtree.2 b/tests/f_dup_de/expect-nohtree.2 new file mode 100644 index 0000000..4d680af --- /dev/null +++ b/tests/f_dup_de/expect-nohtree.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: 18/2048 files (5.6% non-contiguous), 324/330 blocks +Exit status is 0 diff --git a/tests/f_dup_de/expect.1 b/tests/f_dup_de/expect.1 new file mode 100644 index 0000000..e421547 --- /dev/null +++ b/tests/f_dup_de/expect.1 @@ -0,0 +1,28 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Duplicate entry 'mailcap.dpkg-old' found. + Marking /etc (12) to be rebuilt. + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Duplicate entry 'fstab' in /etc (12) found. Clear? yes + +Duplicate entry 'localtime' in /etc (12) found. Clear? yes + +Duplicate entry 'mailcap.dpkg-old' in /etc (12) found. Clear? yes + +Duplicate entry 'modules.conf.old' in /etc (12) found. Clear? yes + +Entry 'modules.conf.old' in /etc (12) has a non-unique filename. +Rename to modules.conf.o~0? yes + +Duplicate entry 'resolv.conf' in /etc (12) found. Clear? yes + +Duplicate entry 'usb.permissions' in /etc (12) found. Clear? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 18/2048 files (5.6% non-contiguous), 324/330 blocks +Exit status is 1 diff --git a/tests/f_dup_de/expect.2 b/tests/f_dup_de/expect.2 new file mode 100644 index 0000000..4d680af --- /dev/null +++ b/tests/f_dup_de/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: 18/2048 files (5.6% non-contiguous), 324/330 blocks +Exit status is 0 diff --git a/tests/f_dup_de/image.gz b/tests/f_dup_de/image.gz Binary files differnew file mode 100644 index 0000000..8bdb12f --- /dev/null +++ b/tests/f_dup_de/image.gz diff --git a/tests/f_dup_de/name b/tests/f_dup_de/name new file mode 100644 index 0000000..bd90734 --- /dev/null +++ b/tests/f_dup_de/name @@ -0,0 +1 @@ +duplicate directory entries diff --git a/tests/f_dup_de/script b/tests/f_dup_de/script new file mode 100644 index 0000000..dcda9d8 --- /dev/null +++ b/tests/f_dup_de/script @@ -0,0 +1,15 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +if test "$HTREE"x = x ; then + gunzip < $test_dir/image.gz > $TMPFILE + $DEBUGFS -w -R "feature ^dir_index" $TMPFILE >/dev/null 2>&1 + gzip $TMPFILE + IMAGE="$TMPFILE".gz + EXP1=$test_dir/expect-nohtree.1 + EXP2=$test_dir/expect-nohtree.2 +fi +. $cmd_dir/run_e2fsck +rm -f "$TMPFILE".gz diff --git a/tests/f_dup_de2/expect.1 b/tests/f_dup_de2/expect.1 new file mode 100644 index 0000000..8dd3d91 --- /dev/null +++ b/tests/f_dup_de2/expect.1 @@ -0,0 +1,16 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Duplicate entry 'test-008' found. + Marking / (2) to be rebuilt. + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Entry 'test-008' in / (2) has a non-unique filename. +Rename to test-0~0? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 21/256 files (0.0% non-contiguous), 1087/2048 blocks +Exit status is 1 diff --git a/tests/f_dup_de2/expect.2 b/tests/f_dup_de2/expect.2 new file mode 100644 index 0000000..8781274 --- /dev/null +++ b/tests/f_dup_de2/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: 21/256 files (0.0% non-contiguous), 1087/2048 blocks +Exit status is 0 diff --git a/tests/f_dup_de2/image.gz b/tests/f_dup_de2/image.gz Binary files differnew file mode 100644 index 0000000..a8e4db3 --- /dev/null +++ b/tests/f_dup_de2/image.gz diff --git a/tests/f_dup_de2/name b/tests/f_dup_de2/name new file mode 100644 index 0000000..e337f10 --- /dev/null +++ b/tests/f_dup_de2/name @@ -0,0 +1 @@ +duplicate directory entries for non-indexed dirs diff --git a/tests/f_dup_de_crypt/expect.1 b/tests/f_dup_de_crypt/expect.1 new file mode 100644 index 0000000..03e0ad6 --- /dev/null +++ b/tests/f_dup_de_crypt/expect.1 @@ -0,0 +1,18 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Duplicate entry '+M-^AT^EM-1M-^CM-/)*M-L^RM-^L^@M-WM-)M-+' found. + Marking /test (12) to be rebuilt. + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Duplicate filename entry '+M-^AT^EM-1M-^CM-/)*M-L^RM-^L^@M-WM-)M-+' in /test (12) found. Clear? yes + +Pass 4: Checking reference counts +Unattached inode 13 +Connect to /lost+found? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/16 files (0.0% non-contiguous), 26/60 blocks +Exit status is 1 diff --git a/tests/f_dup_de_crypt/expect.2 b/tests/f_dup_de_crypt/expect.2 new file mode 100644 index 0000000..cfca772 --- /dev/null +++ b/tests/f_dup_de_crypt/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: 14/16 files (0.0% non-contiguous), 26/60 blocks +Exit status is 0 diff --git a/tests/f_dup_de_crypt/image.gz b/tests/f_dup_de_crypt/image.gz Binary files differnew file mode 100644 index 0000000..07a44d7 --- /dev/null +++ b/tests/f_dup_de_crypt/image.gz diff --git a/tests/f_dup_de_crypt/name b/tests/f_dup_de_crypt/name new file mode 100644 index 0000000..aff30a8 --- /dev/null +++ b/tests/f_dup_de_crypt/name @@ -0,0 +1 @@ +duplicate directory entries for encrypted dirs diff --git a/tests/f_dup_resize/expect.1 b/tests/f_dup_resize/expect.1 new file mode 100644 index 0000000..8a2764d --- /dev/null +++ b/tests/f_dup_resize/expect.1 @@ -0,0 +1,35 @@ +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 7: 4--7 +Multiply-claimed block(s) in inode 12: 4--7 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 1 inodes containing multiply-claimed blocks.) + +File /debugfs (inode #12, mod time Mon Apr 11 00:00:00 2005) + has 4 multiply-claimed block(s), shared with 2 file(s): + <filesystem metadata> + <The group descriptor inode> (inode #7, mod time Mon Apr 11 06:13:20 2005) +Clone multiply-claimed blocks? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(8195--8198) +Fix? yes + +Free blocks count wrong for group #0 (7750, counted=7751). +Fix? yes + +Free blocks count wrong (9434, counted=9435). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/2560 files (8.3% non-contiguous), 805/10240 blocks +Exit status is 1 diff --git a/tests/f_dup_resize/expect.2 b/tests/f_dup_resize/expect.2 new file mode 100644 index 0000000..d91b0af --- /dev/null +++ b/tests/f_dup_resize/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/2560 files (8.3% non-contiguous), 805/10240 blocks +Exit status is 0 diff --git a/tests/f_dup_resize/name b/tests/f_dup_resize/name new file mode 100644 index 0000000..6c5befa --- /dev/null +++ b/tests/f_dup_resize/name @@ -0,0 +1 @@ +blocks claimed by the resize inode and another inode diff --git a/tests/f_dup_resize/script b/tests/f_dup_resize/script new file mode 100644 index 0000000..0fd350b --- /dev/null +++ b/tests/f_dup_resize/script @@ -0,0 +1,29 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" +TEST_DATA="$test_name.tmp" + +dd if=$TEST_BITS of=$TEST_DATA bs=63k count=1 conv=sync > /dev/null 2>&1 + +touch $TMPFILE +$MKE2FS -F -o Linux -O resize_inode $TMPFILE 10240 > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +freeb 4 4 +freeb 8195 4 +write $TEST_DATA debugfs +set_current_time 20050411000000 +set_inode_field debugfs mtime 20050411000000 +q +EOF + +E2FSCK_TIME=1113200000 +export E2FSCK_TIME + +. $cmd_dir/run_e2fsck + +rm -f $TEST_DATA + +unset E2FSCK_TIME TEST_DATA diff --git a/tests/f_dupdot/expect.1 b/tests/f_dupdot/expect.1 new file mode 100644 index 0000000..afce8d6 --- /dev/null +++ b/tests/f_dupdot/expect.1 @@ -0,0 +1,22 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry '.' in <14>/<12> (12) is duplicate '.' entry. +Fix? yes + +Entry '..' in <14>/<12> (12) is duplicate '..' entry. +Fix? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Unattached zero-length inode 14. Clear? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_dupdot/expect.2 b/tests/f_dupdot/expect.2 new file mode 100644 index 0000000..c547be3 --- /dev/null +++ b/tests/f_dupdot/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: 13/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_dupdot/image.gz b/tests/f_dupdot/image.gz Binary files differnew file mode 100644 index 0000000..6a2207e --- /dev/null +++ b/tests/f_dupdot/image.gz diff --git a/tests/f_dupdot/name b/tests/f_dupdot/name new file mode 100644 index 0000000..a7a0afc --- /dev/null +++ b/tests/f_dupdot/name @@ -0,0 +1 @@ +duplicate '.' and '..' entries diff --git a/tests/f_dupfsblks/expect.1 b/tests/f_dupfsblks/expect.1 new file mode 100644 index 0000000..6751986 --- /dev/null +++ b/tests/f_dupfsblks/expect.1 @@ -0,0 +1,65 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 4096, should be 5120. Fix? yes + +Inode 13, i_size is 0, should be 2048. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 3--4 6 1 +Multiply-claimed block(s) in inode 13: 2--3 +Multiply-claimed block(s) in inode 14: 2 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File /foo (inode #12, mod time Thu Apr 28 17:57:53 1994) + has 4 multiply-claimed block(s), shared with 2 file(s): + <filesystem metadata> + /bar (inode #13, mod time Thu Aug 5 07:17:17 1999) +Clone multiply-claimed blocks? yes + +File /bar (inode #13, mod time Thu Aug 5 07:17:17 1999) + has 2 multiply-claimed block(s), shared with 3 file(s): + <filesystem metadata> + /foo (inode #12, mod time Thu Apr 28 17:57:53 1994) + /quux (inode #14, mod time Thu Aug 5 07:18:09 1999) +Clone multiply-claimed blocks? yes + +File /quux (inode #14, mod time Thu Aug 5 07:18:09 1999) + has 1 multiply-claimed block(s), shared with 2 file(s): + <filesystem metadata> + /bar (inode #13, mod time Thu Aug 5 07:17:17 1999) +Clone multiply-claimed blocks? yes + +Pass 2: Checking directory structure +Directory inode 12, block #1, offset 0: directory corrupted +Salvage? yes + +Directory inode 12, block #2, offset 0: directory corrupted +Salvage? yes + +Directory inode 12, block #3, offset 0: directory corrupted +Salvage? yes + +Entry '' in ??? (12) has a zero-length name. +Clear? yes + +Directory inode 12, block #4, offset 100: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (77, counted=70). +Fix? yes + +Free blocks count wrong (77, counted=70). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/32 files (7.1% non-contiguous), 30/100 blocks +Exit status is 1 diff --git a/tests/f_dupfsblks/expect.2 b/tests/f_dupfsblks/expect.2 new file mode 100644 index 0000000..c1726b6 --- /dev/null +++ b/tests/f_dupfsblks/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: 14/32 files (0.0% non-contiguous), 30/100 blocks +Exit status is 0 diff --git a/tests/f_dupfsblks/image.gz b/tests/f_dupfsblks/image.gz Binary files differnew file mode 100644 index 0000000..109dad0 --- /dev/null +++ b/tests/f_dupfsblks/image.gz diff --git a/tests/f_dupfsblks/name b/tests/f_dupfsblks/name new file mode 100644 index 0000000..84124c9 --- /dev/null +++ b/tests/f_dupfsblks/name @@ -0,0 +1 @@ +blocks claimed by a file and bitmaps or inode tables diff --git a/tests/f_dupsuper/expect.1 b/tests/f_dupsuper/expect.1 new file mode 100644 index 0000000..2107e2d --- /dev/null +++ b/tests/f_dupsuper/expect.1 @@ -0,0 +1,27 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 2--3 1 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 1 inodes containing multiply-claimed blocks.) + +File /termcap (inode #12, mod time Sun Jan 2 08:29:13 1994) + has 3 multiply-claimed block(s), shared with 1 file(s): + <filesystem metadata> +Clone multiply-claimed blocks? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(29--31) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/32 files (8.3% non-contiguous), 39/100 blocks +Exit status is 1 diff --git a/tests/f_dupsuper/expect.2 b/tests/f_dupsuper/expect.2 new file mode 100644 index 0000000..8735c4e --- /dev/null +++ b/tests/f_dupsuper/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/32 files (8.3% non-contiguous), 39/100 blocks +Exit status is 0 diff --git a/tests/f_dupsuper/image.gz b/tests/f_dupsuper/image.gz Binary files differnew file mode 100644 index 0000000..d919e07 --- /dev/null +++ b/tests/f_dupsuper/image.gz diff --git a/tests/f_dupsuper/name b/tests/f_dupsuper/name new file mode 100644 index 0000000..560a707 --- /dev/null +++ b/tests/f_dupsuper/name @@ -0,0 +1 @@ +blocks claimed by a file and superblock or group descriptors diff --git a/tests/f_ea_bad_csum/expect.1 b/tests/f_ea_bad_csum/expect.1 new file mode 100644 index 0000000..4fc365f --- /dev/null +++ b/tests/f_ea_bad_csum/expect.1 @@ -0,0 +1,29 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has a bad extended attribute block 1074. Clear? yes + +Inode 12, i_blocks is 2, should be 0. Fix? yes + +Extended attribute in inode 13 has a hash (1631637196) which is invalid +Clear? yes + +Inode 13, i_blocks is 2, should be 0. Fix? yes + +Inode 14 extended attribute block 1076 passes checks, but checksum does not match block. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1074--1075) +Fix? yes + +Free blocks count wrong for group #0 (971, counted=973). +Fix? yes + +Free blocks count wrong (971, counted=973). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (7.1% non-contiguous), 1075/2048 blocks +Exit status is 1 diff --git a/tests/f_ea_bad_csum/expect.2 b/tests/f_ea_bad_csum/expect.2 new file mode 100644 index 0000000..d83fdfb --- /dev/null +++ b/tests/f_ea_bad_csum/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: 14/128 files (7.1% non-contiguous), 1075/2048 blocks +Exit status is 0 diff --git a/tests/f_ea_bad_csum/image.gz b/tests/f_ea_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..e7a25c5 --- /dev/null +++ b/tests/f_ea_bad_csum/image.gz diff --git a/tests/f_ea_bad_csum/name b/tests/f_ea_bad_csum/name new file mode 100644 index 0000000..958b244 --- /dev/null +++ b/tests/f_ea_bad_csum/name @@ -0,0 +1 @@ +EA block with bad checksum (metadata_csum) diff --git a/tests/f_ea_checks/expect.1 b/tests/f_ea_checks/expect.1 new file mode 100644 index 0000000..eb215a2 --- /dev/null +++ b/tests/f_ea_checks/expect.1 @@ -0,0 +1,57 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 13 has a bad extended attribute block 26. Clear? yes + +Inode 13, i_blocks is 4, should be 2. Fix? yes + +Extended attribute in inode 14 has a hash (1649340189) which is invalid +Clear? yes + +Inode 14, i_blocks is 2, should be 0. Fix? yes + +Inode 17 has a bad extended attribute block 28. Clear? yes + +Inode 17, i_blocks is 4, should be 2. Fix? yes + +Inode 16 has a bad extended attribute block 29. Clear? yes + +Inode 16, i_blocks is 2, should be 0. Fix? yes + +Inode 19 has a bad extended attribute block 33. Clear? yes + +Inode 19, i_blocks is 2, should be 0. Fix? yes + +Inode 12 has a bad extended attribute block 55. Clear? yes + +Inode 12, i_blocks is 2, should be 0. Fix? yes + +Inode 15, i_blocks is 2, should be 0. Fix? yes + +Pass 2: Checking directory structure +Extended attribute block for inode 15 (/far) is invalid (999). +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(26--29) -33 -55 +Fix? yes + +Free blocks count wrong for group #0 (481, counted=484). +Fix? yes + +Free blocks count wrong (481, counted=484). +Fix? yes + +Inode bitmap differences: -18 +Fix? yes + +Free inodes count wrong for group #0 (47, counted=46). +Fix? yes + +Free inodes count wrong (47, counted=46). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 18/64 files (0.0% non-contiguous), 28/512 blocks +Exit status is 1 diff --git a/tests/f_ea_checks/expect.2 b/tests/f_ea_checks/expect.2 new file mode 100644 index 0000000..2a11cd2 --- /dev/null +++ b/tests/f_ea_checks/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: 18/64 files (0.0% non-contiguous), 28/512 blocks +Exit status is 0 diff --git a/tests/f_ea_checks/image.gz b/tests/f_ea_checks/image.gz Binary files differnew file mode 100644 index 0000000..253da06 --- /dev/null +++ b/tests/f_ea_checks/image.gz diff --git a/tests/f_ea_checks/name b/tests/f_ea_checks/name new file mode 100644 index 0000000..160fdea --- /dev/null +++ b/tests/f_ea_checks/name @@ -0,0 +1 @@ +extended attribute block checks diff --git a/tests/f_ea_inode/expect.1 b/tests/f_ea_inode/expect.1 new file mode 100644 index 0000000..aaa0bea --- /dev/null +++ b/tests/f_ea_inode/expect.1 @@ -0,0 +1,31 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 17 has illegal extended attribute value inode 4008636142. +Clear? yes + +Inode 17, i_blocks is 8, should be 0. Fix? yes + +Inode 18 has illegal extended attribute value inode 19. +Clear? yes + +Inode 18, i_blocks is 8, should be 0. Fix? yes + +Extended attribute in inode 20 has a hash (1145324612) which is invalid +Clear? yes + +Inode 20, i_blocks is 8, should be 0. Fix? yes + +EA inode 19 for parent inode 21 missing EA_INODE flag. + Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Extended attribute inode 16 ref count is 51, should be 2. Fix? yes + +Extended attribute inode 19 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 21/32 files (0.0% non-contiguous), 18/64 blocks +Exit status is 1 diff --git a/tests/f_ea_inode/expect.2 b/tests/f_ea_inode/expect.2 new file mode 100644 index 0000000..f9276fb --- /dev/null +++ b/tests/f_ea_inode/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: 21/32 files (0.0% non-contiguous), 18/64 blocks +Exit status is 0 diff --git a/tests/f_ea_inode/image.gz b/tests/f_ea_inode/image.gz Binary files differnew file mode 100644 index 0000000..68a3975 --- /dev/null +++ b/tests/f_ea_inode/image.gz diff --git a/tests/f_ea_inode_self_ref/expect.1 b/tests/f_ea_inode_self_ref/expect.1 new file mode 100644 index 0000000..f94c04d --- /dev/null +++ b/tests/f_ea_inode_self_ref/expect.1 @@ -0,0 +1,17 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 16 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Extended attribute in inode 16 has a hash (553648128) which is invalid +Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -20 +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_ea_inode_self_ref/expect.2 b/tests/f_ea_inode_self_ref/expect.2 new file mode 100644 index 0000000..9398061 --- /dev/null +++ b/tests/f_ea_inode_self_ref/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: 16/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_ea_inode_self_ref/image.gz b/tests/f_ea_inode_self_ref/image.gz Binary files differnew file mode 100644 index 0000000..3cc733b --- /dev/null +++ b/tests/f_ea_inode_self_ref/image.gz diff --git a/tests/f_ea_inode_self_ref/name b/tests/f_ea_inode_self_ref/name new file mode 100644 index 0000000..4e68da8 --- /dev/null +++ b/tests/f_ea_inode_self_ref/name @@ -0,0 +1 @@ +corrupted, self-referential ea_in_inode diff --git a/tests/f_ea_signed_hash/expect.1 b/tests/f_ea_signed_hash/expect.1 new file mode 100644 index 0000000..5f2b47a --- /dev/null +++ b/tests/f_ea_signed_hash/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: 16/24 files (0.0% non-contiguous), 29/200 blocks +Exit status is 0 diff --git a/tests/f_ea_signed_hash/image.gz b/tests/f_ea_signed_hash/image.gz Binary files differnew file mode 100644 index 0000000..dbbc97f --- /dev/null +++ b/tests/f_ea_signed_hash/image.gz diff --git a/tests/f_ea_signed_hash/script b/tests/f_ea_signed_hash/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_ea_signed_hash/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_ea_unsigned_hash/expect.1 b/tests/f_ea_unsigned_hash/expect.1 new file mode 100644 index 0000000..5f2b47a --- /dev/null +++ b/tests/f_ea_unsigned_hash/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: 16/24 files (0.0% non-contiguous), 29/200 blocks +Exit status is 0 diff --git a/tests/f_ea_unsigned_hash/image.gz b/tests/f_ea_unsigned_hash/image.gz Binary files differnew file mode 100644 index 0000000..795cece --- /dev/null +++ b/tests/f_ea_unsigned_hash/image.gz diff --git a/tests/f_ea_unsigned_hash/script b/tests/f_ea_unsigned_hash/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_ea_unsigned_hash/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_ea_value_crash/expect.1 b/tests/f_ea_value_crash/expect.1 new file mode 100644 index 0000000..8315358 --- /dev/null +++ b/tests/f_ea_value_crash/expect.1 @@ -0,0 +1,15 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Inode 12 extended attribute is corrupt (allocation collision). Clear? yes + +Inode 13 extended attribute is corrupt (allocation collision). Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_ea_value_crash/expect.2 b/tests/f_ea_value_crash/expect.2 new file mode 100644 index 0000000..06886a4 --- /dev/null +++ b/tests/f_ea_value_crash/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: 13/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_ea_value_crash/image.gz b/tests/f_ea_value_crash/image.gz Binary files differnew file mode 100644 index 0000000..c45fb0e --- /dev/null +++ b/tests/f_ea_value_crash/image.gz diff --git a/tests/f_ea_value_crash/name b/tests/f_ea_value_crash/name new file mode 100644 index 0000000..194bbed --- /dev/null +++ b/tests/f_ea_value_crash/name @@ -0,0 +1 @@ +extended attribute value conflicts with key diff --git a/tests/f_emptydir/expect.1 b/tests/f_emptydir/expect.1 new file mode 100644 index 0000000..c612621 --- /dev/null +++ b/tests/f_emptydir/expect.1 @@ -0,0 +1,19 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 1024, should be 0. Fix? yes + +Pass 2: Checking directory structure +Directory inode 12 has an unallocated block #0. Allocate? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (957, counted=956). +Fix? yes + +Free blocks count wrong (957, counted=956). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/256 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 1 diff --git a/tests/f_emptydir/expect.2 b/tests/f_emptydir/expect.2 new file mode 100644 index 0000000..75c0515 --- /dev/null +++ b/tests/f_emptydir/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/256 files (16.7% non-contiguous), 1092/2048 blocks +Exit status is 0 diff --git a/tests/f_emptydir/image.gz b/tests/f_emptydir/image.gz Binary files differnew file mode 100644 index 0000000..1b6f8f8 --- /dev/null +++ b/tests/f_emptydir/image.gz diff --git a/tests/f_emptydir/name b/tests/f_emptydir/name new file mode 100644 index 0000000..3e0ab60 --- /dev/null +++ b/tests/f_emptydir/name @@ -0,0 +1 @@ +always iterate dir block 0 or e2fsck goes into infinite loop diff --git a/tests/f_encrypted_lpf/expect.1 b/tests/f_encrypted_lpf/expect.1 new file mode 100644 index 0000000..63ac5f3 --- /dev/null +++ b/tests/f_encrypted_lpf/expect.1 @@ -0,0 +1,27 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Unconnected directory inode 12 (was in /) +Connect to /lost+found? yes + +/lost+found is encrypted +Clear? yes + +/lost+found not found. Create? yes + +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 12 ref count is 3, should be 2. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/64 files (0.0% non-contiguous), 13/100 blocks +Exit status is 1 diff --git a/tests/f_encrypted_lpf/expect.2 b/tests/f_encrypted_lpf/expect.2 new file mode 100644 index 0000000..6a59947 --- /dev/null +++ b/tests/f_encrypted_lpf/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: 13/64 files (0.0% non-contiguous), 13/100 blocks +Exit status is 0 diff --git a/tests/f_encrypted_lpf/image.gz b/tests/f_encrypted_lpf/image.gz Binary files differnew file mode 100644 index 0000000..7c89e07 --- /dev/null +++ b/tests/f_encrypted_lpf/image.gz diff --git a/tests/f_encrypted_lpf/name b/tests/f_encrypted_lpf/name new file mode 100644 index 0000000..b74259c --- /dev/null +++ b/tests/f_encrypted_lpf/name @@ -0,0 +1 @@ +encrypted lost+found directory diff --git a/tests/f_end-bitmap/expect.1 b/tests/f_end-bitmap/expect.1 new file mode 100644 index 0000000..85c7e67 --- /dev/null +++ b/tests/f_end-bitmap/expect.1 @@ -0,0 +1,18 @@ +Filesystem did not have a UUID; generating one. + +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 +Free blocks count wrong for group #0 (44, counted=63). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Padding at end of block bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 37/100 blocks +Exit status is 1 diff --git a/tests/f_end-bitmap/expect.2 b/tests/f_end-bitmap/expect.2 new file mode 100644 index 0000000..8109f99 --- /dev/null +++ b/tests/f_end-bitmap/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/16 files (0.0% non-contiguous), 37/100 blocks +Exit status is 0 diff --git a/tests/f_end-bitmap/image.gz b/tests/f_end-bitmap/image.gz Binary files differnew file mode 100644 index 0000000..cb20d0a --- /dev/null +++ b/tests/f_end-bitmap/image.gz diff --git a/tests/f_end-bitmap/name b/tests/f_end-bitmap/name new file mode 100644 index 0000000..b63b6d7 --- /dev/null +++ b/tests/f_end-bitmap/name @@ -0,0 +1 @@ +corruption at end of block bitmap diff --git a/tests/f_eofblocks/expect.1 b/tests/f_eofblocks/expect.1 new file mode 100644 index 0000000..f224b7d --- /dev/null +++ b/tests/f_eofblocks/expect.1 @@ -0,0 +1,13 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 30, i_size is 2048, should be 4096. Fix? yes + +Inode 31, i_size is 2048, should be 6144. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 31/56 files (29.0% non-contiguous), 85/400 blocks +Exit status is 1 diff --git a/tests/f_eofblocks/expect.2 b/tests/f_eofblocks/expect.2 new file mode 100644 index 0000000..0cce314 --- /dev/null +++ b/tests/f_eofblocks/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: 31/56 files (29.0% non-contiguous), 85/400 blocks +Exit status is 0 diff --git a/tests/f_eofblocks/image.gz b/tests/f_eofblocks/image.gz Binary files differnew file mode 100644 index 0000000..e1177b3 --- /dev/null +++ b/tests/f_eofblocks/image.gz diff --git a/tests/f_eofblocks/name b/tests/f_eofblocks/name new file mode 100644 index 0000000..d93adc1 --- /dev/null +++ b/tests/f_eofblocks/name @@ -0,0 +1 @@ +blocks after i_size diff --git a/tests/f_expand/expect.1.gz b/tests/f_expand/expect.1.gz Binary files differnew file mode 100644 index 0000000..81fe7dd --- /dev/null +++ b/tests/f_expand/expect.1.gz diff --git a/tests/f_expand/expect.2 b/tests/f_expand/expect.2 new file mode 100644 index 0000000..40c00c6 --- /dev/null +++ b/tests/f_expand/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: 5109/5504 files (0.0% non-contiguous), 803/900 blocks +Exit status is 0 diff --git a/tests/f_expand/image.gz b/tests/f_expand/image.gz Binary files differnew file mode 100644 index 0000000..c4c18fb --- /dev/null +++ b/tests/f_expand/image.gz diff --git a/tests/f_expand/name b/tests/f_expand/name new file mode 100644 index 0000000..feebe0f --- /dev/null +++ b/tests/f_expand/name @@ -0,0 +1 @@ +expanding lost+found diff --git a/tests/f_expandroot_create_lnf/expect.1 b/tests/f_expandroot_create_lnf/expect.1 new file mode 100644 index 0000000..9593dbf --- /dev/null +++ b/tests/f_expandroot_create_lnf/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/64 files (0.0% non-contiguous), 33/1024 blocks +Exit status is 1 diff --git a/tests/f_expandroot_create_lnf/expect.2 b/tests/f_expandroot_create_lnf/expect.2 new file mode 100644 index 0000000..5eec1f0 --- /dev/null +++ b/tests/f_expandroot_create_lnf/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: 16/64 files (6.3% non-contiguous), 33/1024 blocks +Exit status is 0 diff --git a/tests/f_expandroot_create_lnf/image.gz b/tests/f_expandroot_create_lnf/image.gz Binary files differnew file mode 100644 index 0000000..ccdbfa7 --- /dev/null +++ b/tests/f_expandroot_create_lnf/image.gz diff --git a/tests/f_expandroot_create_lnf/name b/tests/f_expandroot_create_lnf/name new file mode 100644 index 0000000..f22542b --- /dev/null +++ b/tests/f_expandroot_create_lnf/name @@ -0,0 +1 @@ +no space in root to create lost+found entry diff --git a/tests/f_ext_journal/expect.1 b/tests/f_ext_journal/expect.1 new file mode 100644 index 0000000..e5c8201 --- /dev/null +++ b/tests/f_ext_journal/expect.1 @@ -0,0 +1,8 @@ +test_filesys: recovering journal +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: 89/2560 files (0.0% non-contiguous), 170/2560 blocks +Exit status is 0 diff --git a/tests/f_ext_journal/expect.2 b/tests/f_ext_journal/expect.2 new file mode 100644 index 0000000..e2d0dc6 --- /dev/null +++ b/tests/f_ext_journal/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: 89/2560 files (0.0% non-contiguous), 170/2560 blocks +Exit status is 0 diff --git a/tests/f_ext_journal/image.gz b/tests/f_ext_journal/image.gz Binary files differnew file mode 100644 index 0000000..5538371 --- /dev/null +++ b/tests/f_ext_journal/image.gz diff --git a/tests/f_ext_journal/journal.gz b/tests/f_ext_journal/journal.gz Binary files differnew file mode 100644 index 0000000..ab2c72a --- /dev/null +++ b/tests/f_ext_journal/journal.gz diff --git a/tests/f_ext_journal/name b/tests/f_ext_journal/name new file mode 100644 index 0000000..10e950c --- /dev/null +++ b/tests/f_ext_journal/name @@ -0,0 +1 @@ +test external journal device diff --git a/tests/f_ext_journal/script b/tests/f_ext_journal/script new file mode 100644 index 0000000..dd81ef5 --- /dev/null +++ b/tests/f_ext_journal/script @@ -0,0 +1,8 @@ +FSCK_OPT="-fy -j journal.img" +SECOND_FSCK_OPT="-fy -j journal.img" + +gunzip < $test_dir/journal.gz > journal.img + +. $cmd_dir/run_e2fsck + +rm -f journal.img diff --git a/tests/f_ext_zero_len/expect.1 b/tests/f_ext_zero_len/expect.1 new file mode 100644 index 0000000..40109b3 --- /dev/null +++ b/tests/f_ext_zero_len/expect.1 @@ -0,0 +1,13 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has zero length extent + (invalid logical block 0, physical block 37) +Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_ext_zero_len/expect.2 b/tests/f_ext_zero_len/expect.2 new file mode 100644 index 0000000..4ee5d96 --- /dev/null +++ b/tests/f_ext_zero_len/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/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_ext_zero_len/image.gz b/tests/f_ext_zero_len/image.gz Binary files differnew file mode 100644 index 0000000..a03e5fd --- /dev/null +++ b/tests/f_ext_zero_len/image.gz diff --git a/tests/f_ext_zero_len/name b/tests/f_ext_zero_len/name new file mode 100644 index 0000000..ada4a72 --- /dev/null +++ b/tests/f_ext_zero_len/name @@ -0,0 +1 @@ +extent with zero length diff --git a/tests/f_extent_bad_node/expect.1 b/tests/f_extent_bad_node/expect.1 new file mode 100644 index 0000000..e6cdf97 --- /dev/null +++ b/tests/f_extent_bad_node/expect.1 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent node (blk 22, lblk 0) +Clear? yes + +Inode 12 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 12, i_blocks is 16, should be 8. Fix? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(21--23) -25 +Fix? yes + +Free blocks count wrong for group #0 (73, counted=77). +Fix? yes + +Free blocks count wrong (73, counted=77). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 23/100 blocks +Exit status is 1 diff --git a/tests/f_extent_bad_node/expect.2 b/tests/f_extent_bad_node/expect.2 new file mode 100644 index 0000000..b78b193 --- /dev/null +++ b/tests/f_extent_bad_node/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/16 files (0.0% non-contiguous), 23/100 blocks +Exit status is 0 diff --git a/tests/f_extent_bad_node/image.gz b/tests/f_extent_bad_node/image.gz Binary files differnew file mode 100644 index 0000000..01d9b45 --- /dev/null +++ b/tests/f_extent_bad_node/image.gz diff --git a/tests/f_extent_bad_node/name b/tests/f_extent_bad_node/name new file mode 100644 index 0000000..0b4ab8c --- /dev/null +++ b/tests/f_extent_bad_node/name @@ -0,0 +1 @@ +bad interior node in extent tree (metadata_csum) diff --git a/tests/f_extent_htree/expect.1 b/tests/f_extent_htree/expect.1 new file mode 100644 index 0000000..63d1415 --- /dev/null +++ b/tests/f_extent_htree/expect.1 @@ -0,0 +1,29 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + + 352 inodes used (29.53%, out of 1192) + 0 non-contiguous files (0.0%) + 1 non-contiguous directory (0.3%) + # of inodes with ind/dind/tind blocks: 0/0/0 + Extent depth histogram: 342/1 + 778 blocks used (65.38%, out of 1190) + 0 bad blocks + 0 large files + + 340 regular files + 3 directories + 0 character device files + 0 block device files + 0 fifos + 0 links + 0 symbolic links (0 fast symbolic links) + 0 sockets +------------ + 343 files +Exit status is 0 diff --git a/tests/f_extent_htree/expect.2 b/tests/f_extent_htree/expect.2 new file mode 100644 index 0000000..7c0ef95 --- /dev/null +++ b/tests/f_extent_htree/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: 352/1192 files (0.3% non-contiguous), 778/1190 blocks +Exit status is 0 diff --git a/tests/f_extent_htree/expect.pre.1 b/tests/f_extent_htree/expect.pre.1 new file mode 100644 index 0000000..fb0e84a --- /dev/null +++ b/tests/f_extent_htree/expect.pre.1 @@ -0,0 +1,29 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + + 522 inodes used (43.79%, out of 1192) + 0 non-contiguous files (0.0%) + 1 non-contiguous directory (0.2%) + # of inodes with ind/dind/tind blocks: 0/0/0 + Extent depth histogram: 512/1 + 1007 blocks used (84.62%, out of 1190) + 0 bad blocks + 0 large files + + 510 regular files + 3 directories + 0 character device files + 0 block device files + 0 fifos + 0 links + 0 symbolic links (0 fast symbolic links) + 0 sockets +------------ + 513 files +Exit status is 0 diff --git a/tests/f_extent_htree/expect.pre.2 b/tests/f_extent_htree/expect.pre.2 new file mode 100644 index 0000000..54beb0e --- /dev/null +++ b/tests/f_extent_htree/expect.pre.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: 522/1192 files (0.2% non-contiguous), 1007/1190 blocks +Exit status is 0 diff --git a/tests/f_extent_htree/name b/tests/f_extent_htree/name new file mode 100644 index 0000000..fc3812d --- /dev/null +++ b/tests/f_extent_htree/name @@ -0,0 +1 @@ +htree extent compression diff --git a/tests/f_extent_htree/script b/tests/f_extent_htree/script new file mode 100644 index 0000000..fb24a63 --- /dev/null +++ b/tests/f_extent_htree/script @@ -0,0 +1,56 @@ +#!/bin/bash +TMPDIR=${TMPDIR:-"/tmp"} +OUT=$test_name.log + +FSCK_OPT="-fyvD" +SKIP_GUNZIP="true" + +NAMELEN=250 +SRC=$TMPDIR/$test_name.tmp +SUB=subdir +BASE=$SRC/$SUB/$(yes | tr -d '\n' | dd bs=$NAMELEN count=1 2> /dev/null) +TMPFILE=${TMPFILE:-"$TMPDIR/image"} +BSIZE=1024 + +> $OUT +mkdir -p $SRC/$SUB +# calculate the number of files needed to create the directory extent tree +# deep enough to exceed the in-inode index and spill into an index block. +# +# dirents per block * extents per block * (index blocks > i_blocks) +NUM=$(((BSIZE / (NAMELEN + 8)) * (BSIZE / 12) * 2)) +# Create source files. Unfortunately hard links will be copied as links, +# and blocks with only NULs will be turned into holes. +if [ ! -f $BASE.1 ]; then + for N in $(seq $NUM); do + echo "foo" > $BASE.$N + done >> $OUT +fi + +# make filesystem with enough inodes and blocks to hold all the test files +> $TMPFILE +NUM=$((NUM * 7 / 3)) +echo "mke2fs -b $BSIZE -O dir_index,extent -E no_copy_xattrs -d$SRC -N$NUM $TMPFILE $NUM" >> $OUT +$MKE2FS -b $BSIZE -O dir_index,extent -E no_copy_xattrs -d$SRC -N$NUM $TMPFILE $NUM >> $OUT 2>&1 +rm -r $SRC + +# Run e2fsck to convert dir to htree before deleting the files, as mke2fs +# doesn't do this. Run second e2fsck to verify there is no corruption yet. +( + EXP1=$test_dir/expect.pre.1 + EXP2=$test_dir/expect.pre.2 + OUT1=$test_name.pre.1.log + OUT2=$test_name.pre.2.log + DESCRIPTION="$(cat $test_dir/name) setup" + . $cmd_dir/run_e2fsck +) + +# generate a list of filenames for debugfs to delete, one from each leaf block +DELETE_LIST=$TMPDIR/delete.$$ +$DEBUGFS -c -R "htree subdir" $TMPFILE 2>> $OUT | + grep -A2 "Reading directory block" | + awk '/yyyyy/ { print "rm '$SUB'/"$4 }' > $DELETE_LIST +$DEBUGFS -w -f $DELETE_LIST $TMPFILE >> $OUT 2>&1 +rm $DELETE_LIST + +. $cmd_dir/run_e2fsck diff --git a/tests/f_extent_int_bad_csum/expect.1 b/tests/f_extent_int_bad_csum/expect.1 new file mode 100644 index 0000000..7b412b8 --- /dev/null +++ b/tests/f_extent_int_bad_csum/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent block passes checks, but checksum does not match extent + (logical block 698, physical block 1788, len 1) +Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (16.7% non-contiguous), 1446/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_int_bad_csum/expect.2 b/tests/f_extent_int_bad_csum/expect.2 new file mode 100644 index 0000000..6f73d98 --- /dev/null +++ b/tests/f_extent_int_bad_csum/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/128 files (16.7% non-contiguous), 1446/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_int_bad_csum/image.gz b/tests/f_extent_int_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..f387898 --- /dev/null +++ b/tests/f_extent_int_bad_csum/image.gz diff --git a/tests/f_extent_int_bad_csum/name b/tests/f_extent_int_bad_csum/name new file mode 100644 index 0000000..87317e3 --- /dev/null +++ b/tests/f_extent_int_bad_csum/name @@ -0,0 +1 @@ +bad csum in internal extent (metadata_csum) diff --git a/tests/f_extent_int_bad_extent/expect.1 b/tests/f_extent_int_bad_extent/expect.1 new file mode 100644 index 0000000..3d2fb58 --- /dev/null +++ b/tests/f_extent_int_bad_extent/expect.1 @@ -0,0 +1,24 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 4294967295, len 168) +Clear? yes + +Inode 12, i_blocks is 712, should be 542. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1090--1091) -1093 -1095 -1097 -1099 -1101 -1103 -1105 -1107 -1109 -1111 -1113 -1115 -1117 -1119 -1121 -1123 -1125 -1127 -1129 -1131 -1133 -1135 -1137 -1139 -1141 -1143 -1145 -1147 -1149 -1151 -1153 -1155 -1157 -1159 -1161 -1163 -1165 -1167 -1169 -1171 -1173 -1175 -1177 -1179 -1181 -1183 -1185 -1187 -1189 -1191 -1193 -1195 -1197 -1199 -1201 -1203 -1205 -1207 -1209 -1211 -1213 -1215 -1217 -1219 -1221 -1223 -1225 -1227 -1229 -1231 -1233 -1235 -1237 -1239 -1241 -1243 -1245 -1247 -1249 -1251 -1253 -1255 -1257 +Fix? yes + +Free blocks count wrong for group #0 (602, counted=687). +Fix? yes + +Free blocks count wrong (602, counted=687). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (16.7% non-contiguous), 1361/2048 blocks +Exit status is 1 diff --git a/tests/f_extent_int_bad_extent/expect.2 b/tests/f_extent_int_bad_extent/expect.2 new file mode 100644 index 0000000..4e72e41 --- /dev/null +++ b/tests/f_extent_int_bad_extent/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/128 files (16.7% non-contiguous), 1361/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_int_bad_extent/image.gz b/tests/f_extent_int_bad_extent/image.gz Binary files differnew file mode 100644 index 0000000..e8745bf --- /dev/null +++ b/tests/f_extent_int_bad_extent/image.gz diff --git a/tests/f_extent_int_bad_extent/name b/tests/f_extent_int_bad_extent/name new file mode 100644 index 0000000..e22f6b4 --- /dev/null +++ b/tests/f_extent_int_bad_extent/name @@ -0,0 +1 @@ +bad extent in internal extent (metadata_csum) diff --git a/tests/f_extent_int_bad_magic/expect.1 b/tests/f_extent_int_bad_magic/expect.1 new file mode 100644 index 0000000..096be4c --- /dev/null +++ b/tests/f_extent_int_bad_magic/expect.1 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent node (blk 1295, lblk 0) +Clear? yes + +Inode 12 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 12, i_blocks is 712, should be 0. Fix? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1090--1093) -1095 -1097 -1099 -1101 -1103 -1105 -1107 -1109 -1111 -1113 -1115 -1117 -1119 -1121 -1123 -1125 -1127 -1129 -1131 -1133 -1135 -1137 -1139 -1141 -1143 -1145 -1147 -1149 -1151 -1153 -1155 -1157 -1159 -1161 -1163 -1165 -1167 -1169 -1171 -1173 -1175 -1177 -1179 -1181 -1183 -1185 -1187 -1189 -1191 -1193 -1195 -1197 -1199 -1201 -1203 -1205 -1207 -1209 -1211 -1213 -1215 -1217 -1219 -1221 -1223 -1225 -1227 -1229 -1231 -1233 -1235 -1237 -1239 -1241 -1243 -1245 -1247 -1249 -1251 -1253 -1255 -1257 -1259 -1261 -1263 -1265 -1267 -1269 -1271 -1273 -1275 -1277 -1279 -1281 -1283 -1285 -1287 -(1289--1298) -1300 -1302 -1304 -1306 -1308 -1310 -1312 -1314 -1316 -1318 -1320 -1322 -1324 -1326 -1328 -1330 -1332 -1334 -1336 -1338 -1340 -1342 -1344 -1346 -1348 -1350 -1352 -1354 -1356 -1358 -1360 -1362 -1364 -1366 -1368 -1370 -1372 -1374 -1376 -1378 -1380 -1382 -1384 -1386 -1388 -1390 -1392 -1394 -1396 -1398 -1400 -1402 -1404 -1406 -1408 -1410 -1412 -1414 -1416 -1418 -1420 -1422 -1424 -1426 -1428 -1430 -1432 -1434 -1436 -1438 -1440 -1442 -1444 -1446 -1448 -1450 -1452 -1454 -1456 -1458 -1460 -1462 -1464 -1466 -1468 -1470 -1472 -1474 -1476 -1478 -1480 -1482 -1484 -1486 -1488 -1490 -1492 -1494 -1496 -1498 -1500 -1502 -1504 -1506 -1508 -1510 -1512 -1514 -1516 -1518 -1520 -1522 -1524 -1526 -1528 -1530 -1532 -1534 -1536 -1538 -1540 -1542 -1544 -1546 -1548 -1550 -1552 -1554 -1556 -1558 -1560 -1562 -1564 -1566 -1568 -1570 -1572 -1574 -1576 -1578 -1580 -1582 -1584 -1586 -1588 -1590 -1592 -1594 -1596 -1598 -1600 -1602 -1604 -1606 -1608 -1610 -1612 -1614 -1616 -1618 -1620 -1622 -1624 -1626 -1628 -1630 -1632 -1634 -1636 -1638 -1640 -1642 -1644 -1646 -1648 -1650 -1652 -1654 -1656 -1658 -1660 -1662 -1664 -1666 -1668 -1670 -1672 -1674 -1676 -1678 -1680 -1682 -1684 -1686 -1688 -1690 -1692 -1694 -1696 -1698 -1700 -1702 -1704 -1706 -1708 -1710 -1712 -1714 -1716 -1718 -1720 -1722 -1724 -1726 -1728 -1730 -1732 -1734 -1736 -1738 -1740 -1742 -1744 -1746 -1748 -1750 -1752 -1754 -1756 -1758 -1760 -1762 -1764 -1766 -1768 -1770 -1772 -1774 -1776 -1778 -1780 -1782 -1784 -1786 -1788 +Fix? yes + +Free blocks count wrong for group #0 (602, counted=958). +Fix? yes + +Free blocks count wrong (602, counted=958). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 1090/2048 blocks +Exit status is 1 diff --git a/tests/f_extent_int_bad_magic/expect.2 b/tests/f_extent_int_bad_magic/expect.2 new file mode 100644 index 0000000..283cc1f --- /dev/null +++ b/tests/f_extent_int_bad_magic/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/128 files (8.3% non-contiguous), 1090/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_int_bad_magic/image.gz b/tests/f_extent_int_bad_magic/image.gz Binary files differnew file mode 100644 index 0000000..e00f887 --- /dev/null +++ b/tests/f_extent_int_bad_magic/image.gz diff --git a/tests/f_extent_int_bad_magic/name b/tests/f_extent_int_bad_magic/name new file mode 100644 index 0000000..a451e9a --- /dev/null +++ b/tests/f_extent_int_bad_magic/name @@ -0,0 +1 @@ +bad magic number in internal extent (metadata_csum) diff --git a/tests/f_extent_interior_start_lblk/expect.1 b/tests/f_extent_interior_start_lblk/expect.1 new file mode 100644 index 0000000..f5b7d46 --- /dev/null +++ b/tests/f_extent_interior_start_lblk/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Interior extent node level 0 of inode 12: +Logical start 0 does not match logical start 2 at next level. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 29/100 blocks +Exit status is 1 diff --git a/tests/f_extent_interior_start_lblk/expect.2 b/tests/f_extent_interior_start_lblk/expect.2 new file mode 100644 index 0000000..06c6082 --- /dev/null +++ b/tests/f_extent_interior_start_lblk/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/16 files (0.0% non-contiguous), 29/100 blocks +Exit status is 0 diff --git a/tests/f_extent_interior_start_lblk/image.gz b/tests/f_extent_interior_start_lblk/image.gz Binary files differnew file mode 100644 index 0000000..0ed7128 --- /dev/null +++ b/tests/f_extent_interior_start_lblk/image.gz diff --git a/tests/f_extent_interior_start_lblk/name b/tests/f_extent_interior_start_lblk/name new file mode 100644 index 0000000..fbd5f58 --- /dev/null +++ b/tests/f_extent_interior_start_lblk/name @@ -0,0 +1 @@ +incorrect starting lblk in an interior node diff --git a/tests/f_extent_leaf_bad_csum/expect.1 b/tests/f_extent_leaf_bad_csum/expect.1 new file mode 100644 index 0000000..86e501a --- /dev/null +++ b/tests/f_extent_leaf_bad_csum/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent block passes checks, but checksum does not match extent + (logical block 7, physical block 1090, len 1) +Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (16.7% non-contiguous), 1099/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_leaf_bad_csum/expect.2 b/tests/f_extent_leaf_bad_csum/expect.2 new file mode 100644 index 0000000..a564763 --- /dev/null +++ b/tests/f_extent_leaf_bad_csum/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/128 files (16.7% non-contiguous), 1099/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_leaf_bad_csum/image.gz b/tests/f_extent_leaf_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..6c778f6 --- /dev/null +++ b/tests/f_extent_leaf_bad_csum/image.gz diff --git a/tests/f_extent_leaf_bad_csum/name b/tests/f_extent_leaf_bad_csum/name new file mode 100644 index 0000000..62a2285 --- /dev/null +++ b/tests/f_extent_leaf_bad_csum/name @@ -0,0 +1 @@ +bad csum in leaf extent (metadata_csum) diff --git a/tests/f_extent_leaf_bad_extent/expect.1 b/tests/f_extent_leaf_bad_extent/expect.1 new file mode 100644 index 0000000..f96a8a9 --- /dev/null +++ b/tests/f_extent_leaf_bad_extent/expect.1 @@ -0,0 +1,24 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 2, invalid physical block 4294967295, len 1) +Clear? yes + +Inode 12, i_blocks is 18, should be 16. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -1096 +Fix? yes + +Free blocks count wrong for group #0 (949, counted=950). +Fix? yes + +Free blocks count wrong (949, counted=950). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (16.7% non-contiguous), 1098/2048 blocks +Exit status is 1 diff --git a/tests/f_extent_leaf_bad_extent/expect.2 b/tests/f_extent_leaf_bad_extent/expect.2 new file mode 100644 index 0000000..de1727c --- /dev/null +++ b/tests/f_extent_leaf_bad_extent/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/128 files (16.7% non-contiguous), 1098/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_leaf_bad_extent/image.gz b/tests/f_extent_leaf_bad_extent/image.gz Binary files differnew file mode 100644 index 0000000..d34d4d4 --- /dev/null +++ b/tests/f_extent_leaf_bad_extent/image.gz diff --git a/tests/f_extent_leaf_bad_extent/name b/tests/f_extent_leaf_bad_extent/name new file mode 100644 index 0000000..1bd8bd1 --- /dev/null +++ b/tests/f_extent_leaf_bad_extent/name @@ -0,0 +1 @@ +bad extent in leaf extent (metadata_csum) diff --git a/tests/f_extent_leaf_bad_magic/expect.1 b/tests/f_extent_leaf_bad_magic/expect.1 new file mode 100644 index 0000000..83b8157 --- /dev/null +++ b/tests/f_extent_leaf_bad_magic/expect.1 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent node (blk 1604, lblk 0) +Clear? yes + +Inode 12 extent tree (at level 1) could be shorter. Optimize? yes + +Inode 12, i_blocks is 18, should be 0. Fix? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(1090--1097) -1604 +Fix? yes + +Free blocks count wrong for group #0 (949, counted=958). +Fix? yes + +Free blocks count wrong (949, counted=958). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 1090/2048 blocks +Exit status is 1 diff --git a/tests/f_extent_leaf_bad_magic/expect.2 b/tests/f_extent_leaf_bad_magic/expect.2 new file mode 100644 index 0000000..283cc1f --- /dev/null +++ b/tests/f_extent_leaf_bad_magic/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/128 files (8.3% non-contiguous), 1090/2048 blocks +Exit status is 0 diff --git a/tests/f_extent_leaf_bad_magic/image.gz b/tests/f_extent_leaf_bad_magic/image.gz Binary files differnew file mode 100644 index 0000000..7dd044f --- /dev/null +++ b/tests/f_extent_leaf_bad_magic/image.gz diff --git a/tests/f_extent_leaf_bad_magic/name b/tests/f_extent_leaf_bad_magic/name new file mode 100644 index 0000000..e9f756e --- /dev/null +++ b/tests/f_extent_leaf_bad_magic/name @@ -0,0 +1 @@ +bad magic number in leaf extent (metadata_csum) diff --git a/tests/f_extent_oobounds/expect.1 b/tests/f_extent_oobounds/expect.1 new file mode 100644 index 0000000..126c1fa --- /dev/null +++ b/tests/f_extent_oobounds/expect.1 @@ -0,0 +1,27 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, end of extent exceeds allowed value + (logical block 15, physical block 200, len 30) +Clear? yes + +Inode 12 extent tree (at level 1) could be narrower. Optimize? yes + +Inode 12, i_blocks is 154, should be 94. Fix? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(200--229) +Fix? yes + +Free blocks count wrong for group #0 (158, counted=184). +Fix? yes + +Free blocks count wrong (158, counted=184). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/32 files (8.3% non-contiguous), 72/256 blocks +Exit status is 1 diff --git a/tests/f_extent_oobounds/expect.2 b/tests/f_extent_oobounds/expect.2 new file mode 100644 index 0000000..a423f1c --- /dev/null +++ b/tests/f_extent_oobounds/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/32 files (8.3% non-contiguous), 72/256 blocks +Exit status is 0 diff --git a/tests/f_extent_oobounds/script b/tests/f_extent_oobounds/script new file mode 100644 index 0000000..9c2f667 --- /dev/null +++ b/tests/f_extent_oobounds/script @@ -0,0 +1,41 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" +TEST_DATA="$test_name.tmp" + +dd if=/dev/zero of=$TMPFILE bs=1k count=256 > /dev/null 2>&1 +$MKE2FS -Ft ext4 -o Linux $TMPFILE > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +write /dev/null testfile +setb 100 15 +setb 130 30 +setb 200 30 +extent_open testfile + insert_node 0 15 100 + insert_node --after 15 15 115 + insert_node --after 30 15 130 + insert_node --after 45 15 145 + split + down + split + root + down + next + replace_node 15 30 200 + extent_close +set_inode_field testfile i_size 61400 +set_inode_field testfile i_blocks 154 +set_bg 0 free_blocks_count 156 +set_bg 0 bg_checksum calc +set_super_value free_blocks_count 156 +q +EOF + +. $cmd_dir/run_e2fsck + +rm -f $TEST_DATA + +unset E2FSCK_TIME TEST_DATA diff --git a/tests/f_extent_too_deep/expect.1 b/tests/f_extent_too_deep/expect.1 new file mode 100644 index 0000000..a595482 --- /dev/null +++ b/tests/f_extent_too_deep/expect.1 @@ -0,0 +1,23 @@ +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 7 1/ 1 0 - 0 12 1 + 1/ 7 1/ 1 0 - 0 13 1 + 2/ 7 1/ 1 0 - 0 14 1 + 3/ 7 1/ 1 0 - 0 15 1 + 4/ 7 1/ 1 0 - 0 16 1 + 5/ 7 1/ 1 0 - 0 17 1 + 6/ 7 1/ 1 0 - 0 9 1 + 7/ 7 1/ 1 0 - 0 10 - 10 1 +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent tree could be more shallow (7; could be <= 4) +Fix? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 1 diff --git a/tests/f_extent_too_deep/expect.2 b/tests/f_extent_too_deep/expect.2 new file mode 100644 index 0000000..a1d28b1 --- /dev/null +++ b/tests/f_extent_too_deep/expect.2 @@ -0,0 +1,10 @@ +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/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 +debugfs: ex /a +Level Entries Logical Physical Length Flags + 0/ 0 1/ 1 0 - 0 10 - 10 1 diff --git a/tests/f_extent_too_deep/image.gz b/tests/f_extent_too_deep/image.gz Binary files differnew file mode 100644 index 0000000..0f5adff --- /dev/null +++ b/tests/f_extent_too_deep/image.gz diff --git a/tests/f_extent_too_deep/name b/tests/f_extent_too_deep/name new file mode 100644 index 0000000..7e8654a --- /dev/null +++ b/tests/f_extent_too_deep/name @@ -0,0 +1 @@ +extent tree is deeper than it needs to be diff --git a/tests/f_extent_too_deep/script b/tests/f_extent_too_deep/script new file mode 100644 index 0000000..b32c36f --- /dev/null +++ b/tests/f_extent_too_deep/script @@ -0,0 +1,113 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +eval $PREP_CMD + +echo 'ex /a' > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1 +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1 + +if [ "$ONE_PASS_ONLY" != "true" ]; then + $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 + status=$? + echo Exit status is $status >> $OUT2.new + echo 'ex /a' > $TMPFILE.cmd + $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1 + sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 +fi +rm -f $TMPFILE.cmd $OUT1.new $OUT2.new + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/f_extents/expect.1 b/tests/f_extents/expect.1 new file mode 100644 index 0000000..b4d36d2 --- /dev/null +++ b/tests/f_extents/expect.1 @@ -0,0 +1,67 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 is in extent format, but superblock is missing EXTENTS feature +Fix? yes + +Inode 13 missing EXTENT_FL, but is in extents format +Fix? yes + +Inode 16 has a duplicate extent mapping + (logical block 3, invalid physical block 4613, len 2) +Clear? yes + +Inode 16, i_blocks is 16, should be 12. Fix? yes + +Inode 18 has corrupt extent header. Clear inode? yes + +Inode 18, i_blocks is 2, should be 0. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 5133 5124--5125 5129 5132--5133 5142--5145 +Multiply-claimed block(s) in inode 17: 5124--5125 5129 5132 5142--5145 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) + +File /fdup1 (inode #12, mod time Wed Jul 5 21:55:26 2006) + has 10 multiply-claimed block(s), shared with 1 file(s): + /fdup2 (inode #17, mod time Wed Jul 5 21:55:27 2006) +Clone multiply-claimed blocks? yes + +File /fdup2 (inode #17, mod time Wed Jul 5 21:55:27 2006) + has 8 multiply-claimed block(s), shared with 1 file(s): + /fdup1 (inode #12, mod time Wed Jul 5 21:55:26 2006) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Entry 'fbad-flag' in / (2) has deleted/unused inode 18. Clear? yes + +Inode 19 (/fbad-sock) is an illegal FIFO. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +4611 -(4613--4614) -(5121--5122) +(5143--5146) +Fix? yes + +Free blocks count wrong for group #0 (7081, counted=7067). +Fix? yes + +Free blocks count wrong (7081, counted=7067). +Fix? yes + +Inode bitmap differences: -18 +Fix? yes + +Free inodes count wrong for group #0 (238, counted=239). +Fix? yes + +Free inodes count wrong (238, counted=239). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 17/256 files (17.6% non-contiguous), 1125/8192 blocks +Exit status is 1 diff --git a/tests/f_extents/expect.2 b/tests/f_extents/expect.2 new file mode 100644 index 0000000..c6c9ec2 --- /dev/null +++ b/tests/f_extents/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: 17/256 files (17.6% non-contiguous), 1125/8192 blocks +Exit status is 0 diff --git a/tests/f_extents/image.gz b/tests/f_extents/image.gz Binary files differnew file mode 100644 index 0000000..caeadc4 --- /dev/null +++ b/tests/f_extents/image.gz diff --git a/tests/f_extents/name b/tests/f_extents/name new file mode 100644 index 0000000..edede57 --- /dev/null +++ b/tests/f_extents/name @@ -0,0 +1 @@ +basic extents support diff --git a/tests/f_extents2/expect.1 b/tests/f_extents2/expect.1 new file mode 100644 index 0000000..180568b --- /dev/null +++ b/tests/f_extents2/expect.1 @@ -0,0 +1,70 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has out of order extents + (invalid logical block 0, physical block 23, len 12) +Clear? yes + +Inode 12, i_blocks is 86, should be 62. Fix? yes + +Inode 13, i_size is 13295, should be 14336. Fix? yes + +Inode 13, i_blocks is 26, should be 28. Fix? yes + +Inode 15, i_size is 42197, should be 44032. Fix? yes + +Inode 15, i_blocks is 84, should be 86. Fix? yes + +Inode 16 has an invalid extent + (logical block 0, invalid physical block 500, len 10) +Clear? yes + +Inode 17 has an invalid extent + (logical block 0, physical block 120, invalid len 6000) +Clear? yes + +Inode 18 has out of order extents + (invalid logical block 10, physical block 155, len 45) +Clear? yes + +Inode 18, i_blocks is 116, should be 24. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 13: 80 80 +Multiply-claimed block(s) in inode 14: 85 +Multiply-claimed block(s) in inode 15: 85 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File /block.c (inode #13, mod time Mon Jun 2 05:20:22 2008) + has 2 multiply-claimed block(s), shared with 0 file(s): +Clone multiply-claimed blocks? yes + +File /inode.c (inode #14, mod time Mon Jun 2 05:28:16 2008) + has 1 multiply-claimed block(s), shared with 1 file(s): + /ext2fs.h (inode #15, mod time Mon Jun 2 07:22:57 2008) +Clone multiply-claimed blocks? yes + +File /ext2fs.h (inode #15, mod time Mon Jun 2 07:22:57 2008) + has 1 multiply-claimed block(s), shared with 1 file(s): + /inode.c (inode #14, mod time Mon Jun 2 05:28:16 2008) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(25--33) -(154--199) +Fix? yes + +Free blocks count wrong for group #0 (65535, counted=55). +Fix? yes + +Free blocks count wrong (4294967295, counted=55). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 18/32 files (22.2% non-contiguous), 145/200 blocks +Exit status is 1 diff --git a/tests/f_extents2/expect.2 b/tests/f_extents2/expect.2 new file mode 100644 index 0000000..0082a64 --- /dev/null +++ b/tests/f_extents2/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: 18/32 files (22.2% non-contiguous), 145/200 blocks +Exit status is 0 diff --git a/tests/f_extents2/image.gz b/tests/f_extents2/image.gz Binary files differnew file mode 100644 index 0000000..52df257 --- /dev/null +++ b/tests/f_extents2/image.gz diff --git a/tests/f_extents2/name b/tests/f_extents2/name new file mode 100644 index 0000000..4a7e4eb --- /dev/null +++ b/tests/f_extents2/name @@ -0,0 +1 @@ +multiply claimed blocks in extents and other illegal extents diff --git a/tests/f_extra_journal/expect.1 b/tests/f_extra_journal/expect.1 new file mode 100644 index 0000000..4917396 --- /dev/null +++ b/tests/f_extra_journal/expect.1 @@ -0,0 +1,23 @@ +Superblock has_journal flag is clear, but a journal is present. +Clear? yes + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(50--1079) +Fix? yes + +Free blocks count wrong for group #0 (968, counted=1998). +Fix? yes + +Free blocks count wrong (968, counted=1998). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 50/2048 blocks +Exit status is 1 diff --git a/tests/f_extra_journal/expect.2 b/tests/f_extra_journal/expect.2 new file mode 100644 index 0000000..834a120 --- /dev/null +++ b/tests/f_extra_journal/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: 11/256 files (0.0% non-contiguous), 50/2048 blocks +Exit status is 0 diff --git a/tests/f_extra_journal/image.gz b/tests/f_extra_journal/image.gz Binary files differnew file mode 100644 index 0000000..1139619 --- /dev/null +++ b/tests/f_extra_journal/image.gz diff --git a/tests/f_extra_journal/name b/tests/f_extra_journal/name new file mode 100644 index 0000000..7382f20 --- /dev/null +++ b/tests/f_extra_journal/name @@ -0,0 +1 @@ +valid journal inode, but has_journal feature not present diff --git a/tests/f_fast_symlink_extents/expect.1 b/tests/f_fast_symlink_extents/expect.1 new file mode 100644 index 0000000..dc16c97 --- /dev/null +++ b/tests/f_fast_symlink_extents/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Fast symlink 13 has EXTENT_FL set. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_fast_symlink_extents/expect.2 b/tests/f_fast_symlink_extents/expect.2 new file mode 100644 index 0000000..416f49c --- /dev/null +++ b/tests/f_fast_symlink_extents/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: 13/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_fast_symlink_extents/image.gz b/tests/f_fast_symlink_extents/image.gz Binary files differnew file mode 100644 index 0000000..37eb0af --- /dev/null +++ b/tests/f_fast_symlink_extents/image.gz diff --git a/tests/f_fast_symlink_extents/name b/tests/f_fast_symlink_extents/name new file mode 100644 index 0000000..333cb52 --- /dev/null +++ b/tests/f_fast_symlink_extents/name @@ -0,0 +1 @@ +fast symlink with extents flag set diff --git a/tests/f_file_acl_high/expect.1 b/tests/f_file_acl_high/expect.1 new file mode 100644 index 0000000..24d6e06 --- /dev/null +++ b/tests/f_file_acl_high/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +i_file_acl_hi for inode 12 (/motd) is 2, should be zero. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_file_acl_high/expect.2 b/tests/f_file_acl_high/expect.2 new file mode 100644 index 0000000..4c5476c --- /dev/null +++ b/tests/f_file_acl_high/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/16 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_file_acl_high/image.gz b/tests/f_file_acl_high/image.gz Binary files differnew file mode 100644 index 0000000..6342d58 --- /dev/null +++ b/tests/f_file_acl_high/image.gz diff --git a/tests/f_file_acl_high/name b/tests/f_file_acl_high/name new file mode 100644 index 0000000..fd54b06 --- /dev/null +++ b/tests/f_file_acl_high/name @@ -0,0 +1 @@ +i_file_acl_high should be zero diff --git a/tests/f_filetype/expect.1 b/tests/f_filetype/expect.1 new file mode 100644 index 0000000..1624bfc --- /dev/null +++ b/tests/f_filetype/expect.1 @@ -0,0 +1,49 @@ +Pass 1: Checking inodes, blocks, and sizes +Special (device/socket/fifo/symlink) file (inode 14) has immutable +or append-only flag set. Clear? yes + +Special (device/socket/fifo/symlink) file (inode 15) has immutable +or append-only flag set. Clear? yes + +Special (device/socket/fifo/symlink) file (inode 16) has immutable +or append-only flag set. Clear? yes + +Special (device/socket/fifo/symlink) file (inode 17) has immutable +or append-only flag set. Clear? yes + +Pass 2: Checking directory structure +Setting filetype for entry '.' in / (2) to 2. +Setting filetype for entry '..' in / (2) to 2. +Setting filetype for entry 'lost+found' in / (2) to 2. +Setting filetype for entry 'file' in / (2) to 1. +Setting filetype for entry 'dir' in / (2) to 2. +Setting filetype for entry 'fifo' in / (2) to 5. +Setting filetype for entry 'block' in / (2) to 4. +Setting filetype for entry 'char' in / (2) to 3. +Setting filetype for entry 'symlink' in / (2) to 7. +Inode 18 (/badchar) is an illegal character device. +Clear? yes + +Inode 19 (/badblock) is an illegal block device. +Clear? yes + +Inode 20 (/badfifo) is an illegal FIFO. +Clear? yes + +Setting filetype for entry '.' in /lost+found (11) to 2. +Setting filetype for entry '..' in /lost+found (11) to 2. +Setting filetype for entry '.' in /dir (13) to 2. +Setting filetype for entry '..' in /dir (13) to 2. +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free inodes count wrong for group #0 (50, counted=47). +Fix? yes + +Free inodes count wrong (50, counted=47). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 17/64 files (0.0% non-contiguous), 27/100 blocks +Exit status is 1 diff --git a/tests/f_filetype/expect.2 b/tests/f_filetype/expect.2 new file mode 100644 index 0000000..a8681aa --- /dev/null +++ b/tests/f_filetype/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: 17/64 files (0.0% non-contiguous), 27/100 blocks +Exit status is 0 diff --git a/tests/f_filetype/image.gz b/tests/f_filetype/image.gz Binary files differnew file mode 100644 index 0000000..ad0b2ec --- /dev/null +++ b/tests/f_filetype/image.gz diff --git a/tests/f_filetype/name b/tests/f_filetype/name new file mode 100644 index 0000000..0c021f5 --- /dev/null +++ b/tests/f_filetype/name @@ -0,0 +1 @@ +set filetype information and illegal special files diff --git a/tests/f_first_meta_bg_too_big/expect.1 b/tests/f_first_meta_bg_too_big/expect.1 new file mode 100644 index 0000000..3148513 --- /dev/null +++ b/tests/f_first_meta_bg_too_big/expect.1 @@ -0,0 +1,24 @@ +ext2fs_open2: The ext2 superblock is corrupt +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img +../e2fsck/e2fsck: Trying to load superblock despite errors... +First_meta_bg is too big. (2, max value 1). Clear? yes + +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 +Block bitmap differences: -3 +Fix? yes + +Free blocks count wrong for group #0 (79, counted=80). +Fix? yes + +Free blocks count wrong (79, counted=80). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 1 diff --git a/tests/f_first_meta_bg_too_big/expect.2 b/tests/f_first_meta_bg_too_big/expect.2 new file mode 100644 index 0000000..44bff62 --- /dev/null +++ b/tests/f_first_meta_bg_too_big/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: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 0 diff --git a/tests/f_first_meta_bg_too_big/image.gz b/tests/f_first_meta_bg_too_big/image.gz Binary files differnew file mode 100644 index 0000000..5279370 --- /dev/null +++ b/tests/f_first_meta_bg_too_big/image.gz diff --git a/tests/f_first_meta_bg_too_big/name b/tests/f_first_meta_bg_too_big/name new file mode 100644 index 0000000..47ec96d --- /dev/null +++ b/tests/f_first_meta_bg_too_big/name @@ -0,0 +1 @@ +s_first_meta_bg is too large diff --git a/tests/f_full_bg/expect.1 b/tests/f_full_bg/expect.1 new file mode 100644 index 0000000..3d5453f --- /dev/null +++ b/tests/f_full_bg/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: 11/3744 files (0.0% non-contiguous), 685/769 blocks +Exit status is 0 diff --git a/tests/f_full_bg/expect.2 b/tests/f_full_bg/expect.2 new file mode 100644 index 0000000..3d5453f --- /dev/null +++ b/tests/f_full_bg/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: 11/3744 files (0.0% non-contiguous), 685/769 blocks +Exit status is 0 diff --git a/tests/f_full_bg/image.gz b/tests/f_full_bg/image.gz Binary files differnew file mode 100644 index 0000000..9be419d --- /dev/null +++ b/tests/f_full_bg/image.gz diff --git a/tests/f_full_bg/name b/tests/f_full_bg/name new file mode 100644 index 0000000..b0614de --- /dev/null +++ b/tests/f_full_bg/name @@ -0,0 +1 @@ +inode table in last block of first bg diff --git a/tests/f_h_badnode/expect.1 b/tests/f_h_badnode/expect.1 new file mode 100644 index 0000000..95b1cee --- /dev/null +++ b/tests/f_h_badnode/expect.1 @@ -0,0 +1,18 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Problem in HTREE directory inode 12929: block #531 has bad max hash +Problem in HTREE directory inode 12929: block #993 referenced twice +Problem in HTREE directory inode 12929: block #1061 has bad min hash +Problem in HTREE directory inode 12929: block #1062 has invalid depth (2) +Problem in HTREE directory inode 12929: block #1062 has bad max hash +Problem in HTREE directory inode 12929: block #1062 not referenced +Invalid HTREE directory inode 12929 (/test2). Clear HTree index? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 47730/100192 files (0.0% non-contiguous), 13550/31745 blocks +Exit status is 1 diff --git a/tests/f_h_badnode/expect.2 b/tests/f_h_badnode/expect.2 new file mode 100644 index 0000000..65985d1 --- /dev/null +++ b/tests/f_h_badnode/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: 47730/100192 files (0.0% non-contiguous), 13550/31745 blocks +Exit status is 0 diff --git a/tests/f_h_badnode/image.gz b/tests/f_h_badnode/image.gz Binary files differnew file mode 100644 index 0000000..0ac41db --- /dev/null +++ b/tests/f_h_badnode/image.gz diff --git a/tests/f_h_badnode/name b/tests/f_h_badnode/name new file mode 100644 index 0000000..ab077fd --- /dev/null +++ b/tests/f_h_badnode/name @@ -0,0 +1 @@ +hash directory with bad HTREE nodes diff --git a/tests/f_h_badnode/script b/tests/f_h_badnode/script new file mode 100644 index 0000000..e5fc6b2 --- /dev/null +++ b/tests/f_h_badnode/script @@ -0,0 +1,5 @@ +if test "$HTREE"x = yx ; then +. $cmd_dir/run_e2fsck +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/f_h_badroot/expect.1 b/tests/f_h_badroot/expect.1 new file mode 100644 index 0000000..88eba51 --- /dev/null +++ b/tests/f_h_badroot/expect.1 @@ -0,0 +1,40 @@ +Backing up journal inode block information. + +Pass 1: Checking inodes, blocks, and sizes +HTREE directory inode 13345 has an invalid root node. +Clear HTree index? yes + +HTREE directory inode 26689 has an unsupported hash version (240) +Clear HTree index? yes + +HTREE directory inode 40033 has an invalid root node. +Clear HTree index? yes + +HTREE directory inode 53377 has a tree depth (8) which is too big +Clear HTree index? yes + +HTREE directory inode 66721 uses an incompatible htree root node flag. +Clear HTree index? yes + +Pass 2: Checking directory structure +Problem in HTREE directory inode 80065: block #0 has an unordered hash table +Clear HTree index? yes + +Problem in HTREE directory inode 86737: block #0 has invalid limit (511) +Clear HTree index? yes + +Problem in HTREE directory inode 93409: block #0 has invalid count (234) +Clear HTree index? yes + +Problem in HTREE directory inode 73393: block #1 has bad min hash +Problem in HTREE directory inode 73393: block #2 has bad max hash +Invalid HTREE directory inode 73393 (/test6). Clear HTree index? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 1921/100080 files (0.0% non-contiguous), 13646/15361 blocks +Exit status is 1 diff --git a/tests/f_h_badroot/expect.2 b/tests/f_h_badroot/expect.2 new file mode 100644 index 0000000..d5772c1 --- /dev/null +++ b/tests/f_h_badroot/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: 1921/100080 files (0.0% non-contiguous), 13646/15361 blocks +Exit status is 0 diff --git a/tests/f_h_badroot/image.gz b/tests/f_h_badroot/image.gz Binary files differnew file mode 100644 index 0000000..7160cd5 --- /dev/null +++ b/tests/f_h_badroot/image.gz diff --git a/tests/f_h_badroot/name b/tests/f_h_badroot/name new file mode 100644 index 0000000..b2ac7ff --- /dev/null +++ b/tests/f_h_badroot/name @@ -0,0 +1 @@ +bad htree root nodes diff --git a/tests/f_h_badroot/script b/tests/f_h_badroot/script new file mode 100644 index 0000000..e5fc6b2 --- /dev/null +++ b/tests/f_h_badroot/script @@ -0,0 +1,5 @@ +if test "$HTREE"x = yx ; then +. $cmd_dir/run_e2fsck +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/f_h_normal/expect.1 b/tests/f_h_normal/expect.1 new file mode 100644 index 0000000..ff7579d --- /dev/null +++ b/tests/f_h_normal/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: 47730/100192 files (0.0% non-contiguous), 13378/31745 blocks +Exit status is 0 diff --git a/tests/f_h_normal/expect.2 b/tests/f_h_normal/expect.2 new file mode 100644 index 0000000..ff7579d --- /dev/null +++ b/tests/f_h_normal/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: 47730/100192 files (0.0% non-contiguous), 13378/31745 blocks +Exit status is 0 diff --git a/tests/f_h_normal/image.gz b/tests/f_h_normal/image.gz Binary files differnew file mode 100644 index 0000000..8b4daee --- /dev/null +++ b/tests/f_h_normal/image.gz diff --git a/tests/f_h_normal/name b/tests/f_h_normal/name new file mode 100644 index 0000000..7f0cdb2 --- /dev/null +++ b/tests/f_h_normal/name @@ -0,0 +1 @@ +normal (signed) HTREE directory diff --git a/tests/f_h_normal/script b/tests/f_h_normal/script new file mode 100644 index 0000000..e5fc6b2 --- /dev/null +++ b/tests/f_h_normal/script @@ -0,0 +1,5 @@ +if test "$HTREE"x = yx ; then +. $cmd_dir/run_e2fsck +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/f_h_reindex/expect.1 b/tests/f_h_reindex/expect.1 new file mode 100755 index 0000000..2887239 --- /dev/null +++ b/tests/f_h_reindex/expect.1 @@ -0,0 +1,958 @@ +Backing up journal inode block information. + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Problem in HTREE directory inode 16001: block #1 has bad max hash +Problem in HTREE directory inode 16001: block #2 has bad min hash +Problem in HTREE directory inode 16001: block #2 has bad max hash +Problem in HTREE directory inode 16001: block #3 has bad min hash +Problem in HTREE directory inode 16001: block #3 has bad max hash +Problem in HTREE directory inode 16001: block #4 has bad min hash +Problem in HTREE directory inode 16001: block #4 has bad max hash +Problem in HTREE directory inode 16001: block #5 has bad min hash +Problem in HTREE directory inode 16001: block #5 has bad max hash +Problem in HTREE directory inode 16001: block #6 has bad min hash +Problem in HTREE directory inode 16001: block #6 has bad max hash +Problem in HTREE directory inode 16001: block #7 has bad min hash +Problem in HTREE directory inode 16001: block #7 has bad max hash +Problem in HTREE directory inode 16001: block #8 has bad min hash +Invalid HTREE directory inode 16001 (/test). Clear HTree index? yes + +Problem in HTREE directory inode 24001: block #1 has bad max hash +Problem in HTREE directory inode 24001: block #2 has bad max hash +Problem in HTREE directory inode 24001: block #3 has bad min hash +Problem in HTREE directory inode 24001: block #3 has bad max hash +Problem in HTREE directory inode 24001: block #4 has bad max hash +Problem in HTREE directory inode 24001: block #5 has bad min hash +Problem in HTREE directory inode 24001: block #5 has bad max hash +Problem in HTREE directory inode 24001: block #6 has bad min hash +Problem in HTREE directory inode 24001: block #6 has bad max hash +Problem in HTREE directory inode 24001: block #7 has bad min hash +Problem in HTREE directory inode 24001: block #7 has bad max hash +Problem in HTREE directory inode 24001: block #8 has bad max hash +Problem in HTREE directory inode 24001: block #9 has bad min hash +Problem in HTREE directory inode 24001: block #9 has bad max hash +Problem in HTREE directory inode 24001: block #10 has bad min hash +Problem in HTREE directory inode 24001: block #10 has bad max hash +Problem in HTREE directory inode 24001: block #11 has bad max hash +Problem in HTREE directory inode 24001: block #12 has bad min hash +Problem in HTREE directory inode 24001: block #12 has bad max hash +Problem in HTREE directory inode 24001: block #13 has bad min hash +Problem in HTREE directory inode 24001: block #13 has bad max hash +Problem in HTREE directory inode 24001: block #14 has bad min hash +Problem in HTREE directory inode 24001: block #14 has bad max hash +Problem in HTREE directory inode 24001: block #15 has bad min hash +Problem in HTREE directory inode 24001: block #15 has bad max hash +Problem in HTREE directory inode 24001: block #16 has bad min hash +Problem in HTREE directory inode 24001: block #16 has bad max hash +Problem in HTREE directory inode 24001: block #17 has bad min hash +Problem in HTREE directory inode 24001: block #17 has bad max hash +Problem in HTREE directory inode 24001: block #18 has bad min hash +Problem in HTREE directory inode 24001: block #18 has bad max hash +Problem in HTREE directory inode 24001: block #19 has bad min hash +Problem in HTREE directory inode 24001: block #19 has bad max hash +Problem in HTREE directory inode 24001: block #20 has bad min hash +Problem in HTREE directory inode 24001: block #20 has bad max hash +Problem in HTREE directory inode 24001: block #21 has bad min hash +Problem in HTREE directory inode 24001: block #21 has bad max hash +Problem in HTREE directory inode 24001: block #22 has bad min hash +Problem in HTREE directory inode 24001: block #22 has bad max hash +Problem in HTREE directory inode 24001: block #23 has bad min hash +Problem in HTREE directory inode 24001: block #23 has bad max hash +Problem in HTREE directory inode 24001: block #24 has bad min hash +Problem in HTREE directory inode 24001: block #24 has bad max hash +Problem in HTREE directory inode 24001: block #25 has bad min hash +Problem in HTREE directory inode 24001: block #25 has bad max hash +Problem in HTREE directory inode 24001: block #26 has bad min hash +Problem in HTREE directory inode 24001: block #26 has bad max hash +Problem in HTREE directory inode 24001: block #27 has bad min hash +Problem in HTREE directory inode 24001: block #27 has bad max hash +Problem in HTREE directory inode 24001: block #28 has bad min hash +Problem in HTREE directory inode 24001: block #28 has bad max hash +Problem in HTREE directory inode 24001: block #29 has bad min hash +Problem in HTREE directory inode 24001: block #29 has bad max hash +Problem in HTREE directory inode 24001: block #30 has bad min hash +Problem in HTREE directory inode 24001: block #30 has bad max hash +Problem in HTREE directory inode 24001: block #31 has bad min hash +Problem in HTREE directory inode 24001: block #31 has bad max hash +Problem in HTREE directory inode 24001: block #32 has bad min hash +Problem in HTREE directory inode 24001: block #32 has bad max hash +Problem in HTREE directory inode 24001: block #33 has bad min hash +Problem in HTREE directory inode 24001: block #33 has bad max hash +Problem in HTREE directory inode 24001: block #34 has bad min hash +Problem in HTREE directory inode 24001: block #34 has bad max hash +Problem in HTREE directory inode 24001: block #35 has bad min hash +Problem in HTREE directory inode 24001: block #35 has bad max hash +Problem in HTREE directory inode 24001: block #36 has bad min hash +Problem in HTREE directory inode 24001: block #36 has bad max hash +Problem in HTREE directory inode 24001: block #37 has bad min hash +Problem in HTREE directory inode 24001: block #37 has bad max hash +Problem in HTREE directory inode 24001: block #38 has bad min hash +Problem in HTREE directory inode 24001: block #38 has bad max hash +Problem in HTREE directory inode 24001: block #39 has bad min hash +Problem in HTREE directory inode 24001: block #39 has bad max hash +Problem in HTREE directory inode 24001: block #40 has bad min hash +Problem in HTREE directory inode 24001: block #40 has bad max hash +Problem in HTREE directory inode 24001: block #41 has bad min hash +Problem in HTREE directory inode 24001: block #41 has bad max hash +Problem in HTREE directory inode 24001: block #42 has bad min hash +Problem in HTREE directory inode 24001: block #42 has bad max hash +Problem in HTREE directory inode 24001: block #43 has bad min hash +Problem in HTREE directory inode 24001: block #43 has bad max hash +Problem in HTREE directory inode 24001: block #44 has bad min hash +Problem in HTREE directory inode 24001: block #44 has bad max hash +Problem in HTREE directory inode 24001: block #45 has bad min hash +Problem in HTREE directory inode 24001: block #45 has bad max hash +Problem in HTREE directory inode 24001: block #46 has bad min hash +Problem in HTREE directory inode 24001: block #46 has bad max hash +Problem in HTREE directory inode 24001: block #47 has bad min hash +Problem in HTREE directory inode 24001: block #47 has bad max hash +Problem in HTREE directory inode 24001: block #48 has bad min hash +Problem in HTREE directory inode 24001: block #48 has bad max hash +Problem in HTREE directory inode 24001: block #49 has bad min hash +Problem in HTREE directory inode 24001: block #49 has bad max hash +Problem in HTREE directory inode 24001: block #50 has bad min hash +Problem in HTREE directory inode 24001: block #50 has bad max hash +Problem in HTREE directory inode 24001: block #51 has bad min hash +Problem in HTREE directory inode 24001: block #51 has bad max hash +Problem in HTREE directory inode 24001: block #52 has bad min hash +Problem in HTREE directory inode 24001: block #52 has bad max hash +Problem in HTREE directory inode 24001: block #53 has bad min hash +Problem in HTREE directory inode 24001: block #53 has bad max hash +Problem in HTREE directory inode 24001: block #54 has bad min hash +Problem in HTREE directory inode 24001: block #54 has bad max hash +Problem in HTREE directory inode 24001: block #55 has bad min hash +Problem in HTREE directory inode 24001: block #55 has bad max hash +Problem in HTREE directory inode 24001: block #56 has bad min hash +Problem in HTREE directory inode 24001: block #56 has bad max hash +Problem in HTREE directory inode 24001: block #57 has bad min hash +Problem in HTREE directory inode 24001: block #57 has bad max hash +Problem in HTREE directory inode 24001: block #58 has bad min hash +Problem in HTREE directory inode 24001: block #58 has bad max hash +Problem in HTREE directory inode 24001: block #59 has bad min hash +Problem in HTREE directory inode 24001: block #59 has bad max hash +Problem in HTREE directory inode 24001: block #60 has bad min hash +Problem in HTREE directory inode 24001: block #60 has bad max hash +Problem in HTREE directory inode 24001: block #61 has bad min hash +Problem in HTREE directory inode 24001: block #61 has bad max hash +Problem in HTREE directory inode 24001: block #62 has bad min hash +Problem in HTREE directory inode 24001: block #62 has bad max hash +Problem in HTREE directory inode 24001: block #63 has bad min hash +Problem in HTREE directory inode 24001: block #63 has bad max hash +Problem in HTREE directory inode 24001: block #64 has bad min hash +Problem in HTREE directory inode 24001: block #64 has bad max hash +Problem in HTREE directory inode 24001: block #65 has bad min hash +Problem in HTREE directory inode 24001: block #65 has bad max hash +Problem in HTREE directory inode 24001: block #66 has bad min hash +Problem in HTREE directory inode 24001: block #66 has bad max hash +Problem in HTREE directory inode 24001: block #67 has bad min hash +Problem in HTREE directory inode 24001: block #67 has bad max hash +Problem in HTREE directory inode 24001: block #68 has bad min hash +Problem in HTREE directory inode 24001: block #68 has bad max hash +Problem in HTREE directory inode 24001: block #69 has bad min hash +Problem in HTREE directory inode 24001: block #69 has bad max hash +Problem in HTREE directory inode 24001: block #70 has bad min hash +Problem in HTREE directory inode 24001: block #70 has bad max hash +Problem in HTREE directory inode 24001: block #71 has bad min hash +Problem in HTREE directory inode 24001: block #71 has bad max hash +Problem in HTREE directory inode 24001: block #72 has bad min hash +Problem in HTREE directory inode 24001: block #72 has bad max hash +Problem in HTREE directory inode 24001: block #73 has bad min hash +Problem in HTREE directory inode 24001: block #73 has bad max hash +Problem in HTREE directory inode 24001: block #74 has bad min hash +Problem in HTREE directory inode 24001: block #74 has bad max hash +Problem in HTREE directory inode 24001: block #75 has bad min hash +Problem in HTREE directory inode 24001: block #75 has bad max hash +Problem in HTREE directory inode 24001: block #76 has bad min hash +Problem in HTREE directory inode 24001: block #76 has bad max hash +Problem in HTREE directory inode 24001: block #77 has bad min hash +Problem in HTREE directory inode 24001: block #77 has bad max hash +Problem in HTREE directory inode 24001: block #78 has bad min hash +Problem in HTREE directory inode 24001: block #78 has bad max hash +Problem in HTREE directory inode 24001: block #79 has bad min hash +Problem in HTREE directory inode 24001: block #79 has bad max hash +Problem in HTREE directory inode 24001: block #80 has bad min hash +Problem in HTREE directory inode 24001: block #80 has bad max hash +Problem in HTREE directory inode 24001: block #81 has bad min hash +Problem in HTREE directory inode 24001: block #81 has bad max hash +Problem in HTREE directory inode 24001: block #82 has bad min hash +Problem in HTREE directory inode 24001: block #82 has bad max hash +Problem in HTREE directory inode 24001: block #83 has bad min hash +Problem in HTREE directory inode 24001: block #83 has bad max hash +Problem in HTREE directory inode 24001: block #84 has bad min hash +Problem in HTREE directory inode 24001: block #84 has bad max hash +Problem in HTREE directory inode 24001: block #85 has bad min hash +Problem in HTREE directory inode 24001: block #85 has bad max hash +Problem in HTREE directory inode 24001: block #86 has bad min hash +Problem in HTREE directory inode 24001: block #86 has bad max hash +Problem in HTREE directory inode 24001: block #87 has bad min hash +Problem in HTREE directory inode 24001: block #87 has bad max hash +Problem in HTREE directory inode 24001: block #88 has bad min hash +Problem in HTREE directory inode 24001: block #88 has bad max hash +Problem in HTREE directory inode 24001: block #89 has bad min hash +Problem in HTREE directory inode 24001: block #89 has bad max hash +Problem in HTREE directory inode 24001: block #90 has bad min hash +Problem in HTREE directory inode 24001: block #90 has bad max hash +Problem in HTREE directory inode 24001: block #91 has bad min hash +Problem in HTREE directory inode 24001: block #91 has bad max hash +Problem in HTREE directory inode 24001: block #92 has bad min hash +Problem in HTREE directory inode 24001: block #92 has bad max hash +Problem in HTREE directory inode 24001: block #93 has bad min hash +Problem in HTREE directory inode 24001: block #93 has bad max hash +Problem in HTREE directory inode 24001: block #94 has bad min hash +Problem in HTREE directory inode 24001: block #94 has bad max hash +Problem in HTREE directory inode 24001: block #95 has bad min hash +Problem in HTREE directory inode 24001: block #95 has bad max hash +Problem in HTREE directory inode 24001: block #96 has bad min hash +Problem in HTREE directory inode 24001: block #96 has bad max hash +Problem in HTREE directory inode 24001: block #97 has bad min hash +Problem in HTREE directory inode 24001: block #97 has bad max hash +Problem in HTREE directory inode 24001: block #98 has bad min hash +Problem in HTREE directory inode 24001: block #98 has bad max hash +Problem in HTREE directory inode 24001: block #99 has bad min hash +Problem in HTREE directory inode 24001: block #99 has bad max hash +Problem in HTREE directory inode 24001: block #100 has bad min hash +Problem in HTREE directory inode 24001: block #100 has bad max hash +Problem in HTREE directory inode 24001: block #101 has bad min hash +Problem in HTREE directory inode 24001: block #101 has bad max hash +Problem in HTREE directory inode 24001: block #102 has bad min hash +Problem in HTREE directory inode 24001: block #102 has bad max hash +Problem in HTREE directory inode 24001: block #103 has bad min hash +Problem in HTREE directory inode 24001: block #103 has bad max hash +Problem in HTREE directory inode 24001: block #104 has bad min hash +Problem in HTREE directory inode 24001: block #104 has bad max hash +Problem in HTREE directory inode 24001: block #105 has bad min hash +Problem in HTREE directory inode 24001: block #105 has bad max hash +Problem in HTREE directory inode 24001: block #106 has bad min hash +Problem in HTREE directory inode 24001: block #106 has bad max hash +Problem in HTREE directory inode 24001: block #107 has bad min hash +Problem in HTREE directory inode 24001: block #107 has bad max hash +Problem in HTREE directory inode 24001: block #108 has bad min hash +Problem in HTREE directory inode 24001: block #108 has bad max hash +Problem in HTREE directory inode 24001: block #109 has bad min hash +Problem in HTREE directory inode 24001: block #109 has bad max hash +Problem in HTREE directory inode 24001: block #110 has bad min hash +Problem in HTREE directory inode 24001: block #110 has bad max hash +Problem in HTREE directory inode 24001: block #111 has bad min hash +Problem in HTREE directory inode 24001: block #111 has bad max hash +Problem in HTREE directory inode 24001: block #112 has bad min hash +Problem in HTREE directory inode 24001: block #112 has bad max hash +Problem in HTREE directory inode 24001: block #113 has bad min hash +Problem in HTREE directory inode 24001: block #113 has bad max hash +Problem in HTREE directory inode 24001: block #114 has bad min hash +Problem in HTREE directory inode 24001: block #114 has bad max hash +Problem in HTREE directory inode 24001: block #115 has bad min hash +Problem in HTREE directory inode 24001: block #115 has bad max hash +Problem in HTREE directory inode 24001: block #116 has bad min hash +Problem in HTREE directory inode 24001: block #116 has bad max hash +Problem in HTREE directory inode 24001: block #117 has bad min hash +Problem in HTREE directory inode 24001: block #117 has bad max hash +Problem in HTREE directory inode 24001: block #118 has bad min hash +Problem in HTREE directory inode 24001: block #118 has bad max hash +Problem in HTREE directory inode 24001: block #119 has bad min hash +Problem in HTREE directory inode 24001: block #119 has bad max hash +Problem in HTREE directory inode 24001: block #120 has bad min hash +Problem in HTREE directory inode 24001: block #120 has bad max hash +Problem in HTREE directory inode 24001: block #121 has bad min hash +Problem in HTREE directory inode 24001: block #121 has bad max hash +Problem in HTREE directory inode 24001: block #122 has bad min hash +Problem in HTREE directory inode 24001: block #122 has bad max hash +Problem in HTREE directory inode 24001: block #123 has bad min hash +Problem in HTREE directory inode 24001: block #123 has bad max hash +Problem in HTREE directory inode 24001: block #124 has bad min hash +Problem in HTREE directory inode 24001: block #124 has bad max hash +Problem in HTREE directory inode 24001: block #125 has bad min hash +Problem in HTREE directory inode 24001: block #125 has bad max hash +Problem in HTREE directory inode 24001: block #126 has bad min hash +Problem in HTREE directory inode 24001: block #126 has bad max hash +Problem in HTREE directory inode 24001: block #127 has bad min hash +Problem in HTREE directory inode 24001: block #128 has bad max hash +Problem in HTREE directory inode 24001: block #129 has bad min hash +Problem in HTREE directory inode 24001: block #129 has bad max hash +Problem in HTREE directory inode 24001: block #130 has bad min hash +Problem in HTREE directory inode 24001: block #130 has bad max hash +Problem in HTREE directory inode 24001: block #131 has bad min hash +Problem in HTREE directory inode 24001: block #131 has bad max hash +Problem in HTREE directory inode 24001: block #132 has bad min hash +Problem in HTREE directory inode 24001: block #132 has bad max hash +Problem in HTREE directory inode 24001: block #133 has bad min hash +Problem in HTREE directory inode 24001: block #133 has bad max hash +Problem in HTREE directory inode 24001: block #134 has bad min hash +Problem in HTREE directory inode 24001: block #134 has bad max hash +Problem in HTREE directory inode 24001: block #135 has bad min hash +Problem in HTREE directory inode 24001: block #135 has bad max hash +Problem in HTREE directory inode 24001: block #136 has bad min hash +Problem in HTREE directory inode 24001: block #136 has bad max hash +Problem in HTREE directory inode 24001: block #137 has bad min hash +Problem in HTREE directory inode 24001: block #137 has bad max hash +Problem in HTREE directory inode 24001: block #138 has bad min hash +Problem in HTREE directory inode 24001: block #138 has bad max hash +Problem in HTREE directory inode 24001: block #139 has bad min hash +Problem in HTREE directory inode 24001: block #139 has bad max hash +Problem in HTREE directory inode 24001: block #140 has bad min hash +Problem in HTREE directory inode 24001: block #140 has bad max hash +Problem in HTREE directory inode 24001: block #141 has bad min hash +Problem in HTREE directory inode 24001: block #141 has bad max hash +Problem in HTREE directory inode 24001: block #142 has bad min hash +Problem in HTREE directory inode 24001: block #142 has bad max hash +Problem in HTREE directory inode 24001: block #143 has bad min hash +Problem in HTREE directory inode 24001: block #143 has bad max hash +Problem in HTREE directory inode 24001: block #144 has bad min hash +Problem in HTREE directory inode 24001: block #144 has bad max hash +Problem in HTREE directory inode 24001: block #145 has bad min hash +Problem in HTREE directory inode 24001: block #145 has bad max hash +Problem in HTREE directory inode 24001: block #146 has bad min hash +Problem in HTREE directory inode 24001: block #146 has bad max hash +Problem in HTREE directory inode 24001: block #147 has bad min hash +Problem in HTREE directory inode 24001: block #147 has bad max hash +Problem in HTREE directory inode 24001: block #148 has bad min hash +Problem in HTREE directory inode 24001: block #148 has bad max hash +Problem in HTREE directory inode 24001: block #149 has bad min hash +Problem in HTREE directory inode 24001: block #149 has bad max hash +Problem in HTREE directory inode 24001: block #150 has bad min hash +Problem in HTREE directory inode 24001: block #150 has bad max hash +Problem in HTREE directory inode 24001: block #151 has bad min hash +Problem in HTREE directory inode 24001: block #151 has bad max hash +Problem in HTREE directory inode 24001: block #152 has bad min hash +Problem in HTREE directory inode 24001: block #152 has bad max hash +Problem in HTREE directory inode 24001: block #153 has bad min hash +Problem in HTREE directory inode 24001: block #153 has bad max hash +Problem in HTREE directory inode 24001: block #154 has bad min hash +Problem in HTREE directory inode 24001: block #154 has bad max hash +Problem in HTREE directory inode 24001: block #155 has bad min hash +Problem in HTREE directory inode 24001: block #155 has bad max hash +Problem in HTREE directory inode 24001: block #156 has bad min hash +Problem in HTREE directory inode 24001: block #156 has bad max hash +Problem in HTREE directory inode 24001: block #157 has bad min hash +Problem in HTREE directory inode 24001: block #157 has bad max hash +Problem in HTREE directory inode 24001: block #158 has bad min hash +Problem in HTREE directory inode 24001: block #158 has bad max hash +Problem in HTREE directory inode 24001: block #159 has bad min hash +Problem in HTREE directory inode 24001: block #159 has bad max hash +Problem in HTREE directory inode 24001: block #160 has bad min hash +Problem in HTREE directory inode 24001: block #160 has bad max hash +Problem in HTREE directory inode 24001: block #161 has bad min hash +Problem in HTREE directory inode 24001: block #161 has bad max hash +Problem in HTREE directory inode 24001: block #162 has bad min hash +Problem in HTREE directory inode 24001: block #162 has bad max hash +Problem in HTREE directory inode 24001: block #163 has bad min hash +Problem in HTREE directory inode 24001: block #163 has bad max hash +Problem in HTREE directory inode 24001: block #164 has bad min hash +Problem in HTREE directory inode 24001: block #164 has bad max hash +Problem in HTREE directory inode 24001: block #165 has bad min hash +Problem in HTREE directory inode 24001: block #165 has bad max hash +Problem in HTREE directory inode 24001: block #166 has bad min hash +Problem in HTREE directory inode 24001: block #166 has bad max hash +Problem in HTREE directory inode 24001: block #167 has bad min hash +Problem in HTREE directory inode 24001: block #167 has bad max hash +Problem in HTREE directory inode 24001: block #168 has bad min hash +Problem in HTREE directory inode 24001: block #168 has bad max hash +Problem in HTREE directory inode 24001: block #169 has bad min hash +Problem in HTREE directory inode 24001: block #169 has bad max hash +Problem in HTREE directory inode 24001: block #170 has bad min hash +Problem in HTREE directory inode 24001: block #170 has bad max hash +Problem in HTREE directory inode 24001: block #171 has bad min hash +Problem in HTREE directory inode 24001: block #171 has bad max hash +Problem in HTREE directory inode 24001: block #172 has bad min hash +Problem in HTREE directory inode 24001: block #172 has bad max hash +Problem in HTREE directory inode 24001: block #173 has bad min hash +Problem in HTREE directory inode 24001: block #173 has bad max hash +Problem in HTREE directory inode 24001: block #174 has bad min hash +Problem in HTREE directory inode 24001: block #174 has bad max hash +Problem in HTREE directory inode 24001: block #175 has bad min hash +Problem in HTREE directory inode 24001: block #175 has bad max hash +Problem in HTREE directory inode 24001: block #176 has bad min hash +Problem in HTREE directory inode 24001: block #176 has bad max hash +Problem in HTREE directory inode 24001: block #177 has bad min hash +Problem in HTREE directory inode 24001: block #177 has bad max hash +Problem in HTREE directory inode 24001: block #178 has bad min hash +Problem in HTREE directory inode 24001: block #178 has bad max hash +Problem in HTREE directory inode 24001: block #179 has bad min hash +Problem in HTREE directory inode 24001: block #179 has bad max hash +Problem in HTREE directory inode 24001: block #180 has bad min hash +Problem in HTREE directory inode 24001: block #180 has bad max hash +Problem in HTREE directory inode 24001: block #181 has bad min hash +Problem in HTREE directory inode 24001: block #181 has bad max hash +Problem in HTREE directory inode 24001: block #182 has bad min hash +Problem in HTREE directory inode 24001: block #182 has bad max hash +Problem in HTREE directory inode 24001: block #183 has bad min hash +Problem in HTREE directory inode 24001: block #183 has bad max hash +Problem in HTREE directory inode 24001: block #184 has bad min hash +Problem in HTREE directory inode 24001: block #184 has bad max hash +Problem in HTREE directory inode 24001: block #185 has bad min hash +Problem in HTREE directory inode 24001: block #185 has bad max hash +Problem in HTREE directory inode 24001: block #186 has bad min hash +Problem in HTREE directory inode 24001: block #186 has bad max hash +Problem in HTREE directory inode 24001: block #187 has bad min hash +Problem in HTREE directory inode 24001: block #187 has bad max hash +Problem in HTREE directory inode 24001: block #188 has bad min hash +Problem in HTREE directory inode 24001: block #188 has bad max hash +Problem in HTREE directory inode 24001: block #189 has bad min hash +Problem in HTREE directory inode 24001: block #189 has bad max hash +Problem in HTREE directory inode 24001: block #190 has bad min hash +Problem in HTREE directory inode 24001: block #190 has bad max hash +Problem in HTREE directory inode 24001: block #191 has bad min hash +Problem in HTREE directory inode 24001: block #191 has bad max hash +Problem in HTREE directory inode 24001: block #192 has bad min hash +Problem in HTREE directory inode 24001: block #192 has bad max hash +Problem in HTREE directory inode 24001: block #193 has bad min hash +Problem in HTREE directory inode 24001: block #193 has bad max hash +Problem in HTREE directory inode 24001: block #194 has bad min hash +Problem in HTREE directory inode 24001: block #194 has bad max hash +Problem in HTREE directory inode 24001: block #195 has bad min hash +Problem in HTREE directory inode 24001: block #195 has bad max hash +Problem in HTREE directory inode 24001: block #196 has bad min hash +Problem in HTREE directory inode 24001: block #196 has bad max hash +Problem in HTREE directory inode 24001: block #197 has bad min hash +Problem in HTREE directory inode 24001: block #197 has bad max hash +Problem in HTREE directory inode 24001: block #198 has bad min hash +Problem in HTREE directory inode 24001: block #198 has bad max hash +Problem in HTREE directory inode 24001: block #199 has bad min hash +Problem in HTREE directory inode 24001: block #199 has bad max hash +Problem in HTREE directory inode 24001: block #200 has bad min hash +Problem in HTREE directory inode 24001: block #200 has bad max hash +Problem in HTREE directory inode 24001: block #201 has bad min hash +Problem in HTREE directory inode 24001: block #201 has bad max hash +Problem in HTREE directory inode 24001: block #202 has bad min hash +Problem in HTREE directory inode 24001: block #202 has bad max hash +Problem in HTREE directory inode 24001: block #203 has bad min hash +Problem in HTREE directory inode 24001: block #203 has bad max hash +Problem in HTREE directory inode 24001: block #204 has bad min hash +Problem in HTREE directory inode 24001: block #204 has bad max hash +Problem in HTREE directory inode 24001: block #205 has bad min hash +Problem in HTREE directory inode 24001: block #205 has bad max hash +Problem in HTREE directory inode 24001: block #206 has bad min hash +Problem in HTREE directory inode 24001: block #206 has bad max hash +Problem in HTREE directory inode 24001: block #207 has bad min hash +Problem in HTREE directory inode 24001: block #207 has bad max hash +Problem in HTREE directory inode 24001: block #208 has bad min hash +Problem in HTREE directory inode 24001: block #208 has bad max hash +Problem in HTREE directory inode 24001: block #209 has bad min hash +Problem in HTREE directory inode 24001: block #209 has bad max hash +Problem in HTREE directory inode 24001: block #210 has bad min hash +Problem in HTREE directory inode 24001: block #210 has bad max hash +Problem in HTREE directory inode 24001: block #211 has bad min hash +Problem in HTREE directory inode 24001: block #211 has bad max hash +Problem in HTREE directory inode 24001: block #212 has bad min hash +Problem in HTREE directory inode 24001: block #212 has bad max hash +Problem in HTREE directory inode 24001: block #213 has bad min hash +Problem in HTREE directory inode 24001: block #213 has bad max hash +Problem in HTREE directory inode 24001: block #214 has bad min hash +Problem in HTREE directory inode 24001: block #214 has bad max hash +Problem in HTREE directory inode 24001: block #215 has bad min hash +Problem in HTREE directory inode 24001: block #215 has bad max hash +Problem in HTREE directory inode 24001: block #216 has bad min hash +Problem in HTREE directory inode 24001: block #216 has bad max hash +Problem in HTREE directory inode 24001: block #217 has bad min hash +Problem in HTREE directory inode 24001: block #217 has bad max hash +Problem in HTREE directory inode 24001: block #218 has bad min hash +Problem in HTREE directory inode 24001: block #218 has bad max hash +Problem in HTREE directory inode 24001: block #219 has bad min hash +Problem in HTREE directory inode 24001: block #219 has bad max hash +Problem in HTREE directory inode 24001: block #220 has bad min hash +Problem in HTREE directory inode 24001: block #220 has bad max hash +Problem in HTREE directory inode 24001: block #221 has bad min hash +Problem in HTREE directory inode 24001: block #221 has bad max hash +Problem in HTREE directory inode 24001: block #222 has bad min hash +Problem in HTREE directory inode 24001: block #222 has bad max hash +Problem in HTREE directory inode 24001: block #223 has bad min hash +Problem in HTREE directory inode 24001: block #223 has bad max hash +Problem in HTREE directory inode 24001: block #224 has bad min hash +Problem in HTREE directory inode 24001: block #224 has bad max hash +Problem in HTREE directory inode 24001: block #225 has bad min hash +Problem in HTREE directory inode 24001: block #225 has bad max hash +Problem in HTREE directory inode 24001: block #226 has bad min hash +Problem in HTREE directory inode 24001: block #226 has bad max hash +Problem in HTREE directory inode 24001: block #227 has bad min hash +Problem in HTREE directory inode 24001: block #227 has bad max hash +Problem in HTREE directory inode 24001: block #228 has bad min hash +Problem in HTREE directory inode 24001: block #228 has bad max hash +Problem in HTREE directory inode 24001: block #229 has bad min hash +Problem in HTREE directory inode 24001: block #229 has bad max hash +Problem in HTREE directory inode 24001: block #230 has bad min hash +Problem in HTREE directory inode 24001: block #230 has bad max hash +Problem in HTREE directory inode 24001: block #231 has bad min hash +Problem in HTREE directory inode 24001: block #231 has bad max hash +Problem in HTREE directory inode 24001: block #232 has bad min hash +Problem in HTREE directory inode 24001: block #232 has bad max hash +Problem in HTREE directory inode 24001: block #233 has bad min hash +Problem in HTREE directory inode 24001: block #233 has bad max hash +Problem in HTREE directory inode 24001: block #234 has bad min hash +Problem in HTREE directory inode 24001: block #234 has bad max hash +Problem in HTREE directory inode 24001: block #235 has bad min hash +Problem in HTREE directory inode 24001: block #235 has bad max hash +Problem in HTREE directory inode 24001: block #236 has bad min hash +Problem in HTREE directory inode 24001: block #236 has bad max hash +Problem in HTREE directory inode 24001: block #237 has bad min hash +Problem in HTREE directory inode 24001: block #237 has bad max hash +Problem in HTREE directory inode 24001: block #238 has bad min hash +Problem in HTREE directory inode 24001: block #238 has bad max hash +Problem in HTREE directory inode 24001: block #239 has bad min hash +Problem in HTREE directory inode 24001: block #239 has bad max hash +Problem in HTREE directory inode 24001: block #240 has bad min hash +Problem in HTREE directory inode 24001: block #240 has bad max hash +Problem in HTREE directory inode 24001: block #241 has bad min hash +Problem in HTREE directory inode 24001: block #241 has bad max hash +Problem in HTREE directory inode 24001: block #242 has bad min hash +Problem in HTREE directory inode 24001: block #242 has bad max hash +Problem in HTREE directory inode 24001: block #243 has bad min hash +Problem in HTREE directory inode 24001: block #243 has bad max hash +Problem in HTREE directory inode 24001: block #244 has bad min hash +Problem in HTREE directory inode 24001: block #244 has bad max hash +Problem in HTREE directory inode 24001: block #245 has bad min hash +Problem in HTREE directory inode 24001: block #245 has bad max hash +Problem in HTREE directory inode 24001: block #246 has bad min hash +Problem in HTREE directory inode 24001: block #246 has bad max hash +Problem in HTREE directory inode 24001: block #247 has bad min hash +Problem in HTREE directory inode 24001: block #247 has bad max hash +Problem in HTREE directory inode 24001: block #248 has bad min hash +Problem in HTREE directory inode 24001: block #248 has bad max hash +Problem in HTREE directory inode 24001: block #249 has bad min hash +Problem in HTREE directory inode 24001: block #249 has bad max hash +Problem in HTREE directory inode 24001: block #250 has bad min hash +Problem in HTREE directory inode 24001: block #250 has bad max hash +Problem in HTREE directory inode 24001: block #251 has bad min hash +Problem in HTREE directory inode 24001: block #251 has bad max hash +Problem in HTREE directory inode 24001: block #252 has bad min hash +Problem in HTREE directory inode 24001: block #252 has bad max hash +Problem in HTREE directory inode 24001: block #253 has bad min hash +Problem in HTREE directory inode 24001: block #253 has bad max hash +Problem in HTREE directory inode 24001: block #254 has bad min hash +Problem in HTREE directory inode 24001: block #255 has bad max hash +Problem in HTREE directory inode 24001: block #256 has bad min hash +Problem in HTREE directory inode 24001: block #256 has bad max hash +Problem in HTREE directory inode 24001: block #257 has bad min hash +Problem in HTREE directory inode 24001: block #257 has bad max hash +Problem in HTREE directory inode 24001: block #258 has bad min hash +Problem in HTREE directory inode 24001: block #258 has bad max hash +Problem in HTREE directory inode 24001: block #259 has bad min hash +Problem in HTREE directory inode 24001: block #259 has bad max hash +Problem in HTREE directory inode 24001: block #260 has bad min hash +Problem in HTREE directory inode 24001: block #260 has bad max hash +Problem in HTREE directory inode 24001: block #261 has bad min hash +Problem in HTREE directory inode 24001: block #261 has bad max hash +Problem in HTREE directory inode 24001: block #262 has bad min hash +Problem in HTREE directory inode 24001: block #262 has bad max hash +Problem in HTREE directory inode 24001: block #263 has bad min hash +Problem in HTREE directory inode 24001: block #263 has bad max hash +Problem in HTREE directory inode 24001: block #264 has bad min hash +Problem in HTREE directory inode 24001: block #264 has bad max hash +Problem in HTREE directory inode 24001: block #265 has bad min hash +Problem in HTREE directory inode 24001: block #265 has bad max hash +Problem in HTREE directory inode 24001: block #266 has bad min hash +Problem in HTREE directory inode 24001: block #266 has bad max hash +Problem in HTREE directory inode 24001: block #267 has bad min hash +Problem in HTREE directory inode 24001: block #267 has bad max hash +Problem in HTREE directory inode 24001: block #268 has bad min hash +Problem in HTREE directory inode 24001: block #268 has bad max hash +Problem in HTREE directory inode 24001: block #269 has bad min hash +Problem in HTREE directory inode 24001: block #269 has bad max hash +Problem in HTREE directory inode 24001: block #270 has bad min hash +Problem in HTREE directory inode 24001: block #270 has bad max hash +Problem in HTREE directory inode 24001: block #271 has bad min hash +Problem in HTREE directory inode 24001: block #271 has bad max hash +Problem in HTREE directory inode 24001: block #272 has bad min hash +Problem in HTREE directory inode 24001: block #272 has bad max hash +Problem in HTREE directory inode 24001: block #273 has bad min hash +Problem in HTREE directory inode 24001: block #273 has bad max hash +Problem in HTREE directory inode 24001: block #274 has bad min hash +Problem in HTREE directory inode 24001: block #274 has bad max hash +Problem in HTREE directory inode 24001: block #275 has bad min hash +Problem in HTREE directory inode 24001: block #275 has bad max hash +Problem in HTREE directory inode 24001: block #276 has bad min hash +Problem in HTREE directory inode 24001: block #276 has bad max hash +Problem in HTREE directory inode 24001: block #277 has bad min hash +Problem in HTREE directory inode 24001: block #277 has bad max hash +Problem in HTREE directory inode 24001: block #278 has bad min hash +Problem in HTREE directory inode 24001: block #278 has bad max hash +Problem in HTREE directory inode 24001: block #279 has bad min hash +Problem in HTREE directory inode 24001: block #279 has bad max hash +Problem in HTREE directory inode 24001: block #280 has bad min hash +Problem in HTREE directory inode 24001: block #280 has bad max hash +Problem in HTREE directory inode 24001: block #281 has bad min hash +Problem in HTREE directory inode 24001: block #281 has bad max hash +Problem in HTREE directory inode 24001: block #282 has bad min hash +Problem in HTREE directory inode 24001: block #282 has bad max hash +Problem in HTREE directory inode 24001: block #283 has bad min hash +Problem in HTREE directory inode 24001: block #283 has bad max hash +Problem in HTREE directory inode 24001: block #284 has bad min hash +Problem in HTREE directory inode 24001: block #284 has bad max hash +Problem in HTREE directory inode 24001: block #285 has bad min hash +Problem in HTREE directory inode 24001: block #285 has bad max hash +Problem in HTREE directory inode 24001: block #286 has bad min hash +Problem in HTREE directory inode 24001: block #286 has bad max hash +Problem in HTREE directory inode 24001: block #287 has bad min hash +Problem in HTREE directory inode 24001: block #287 has bad max hash +Problem in HTREE directory inode 24001: block #288 has bad min hash +Problem in HTREE directory inode 24001: block #288 has bad max hash +Problem in HTREE directory inode 24001: block #289 has bad min hash +Problem in HTREE directory inode 24001: block #289 has bad max hash +Problem in HTREE directory inode 24001: block #290 has bad min hash +Problem in HTREE directory inode 24001: block #290 has bad max hash +Problem in HTREE directory inode 24001: block #291 has bad min hash +Problem in HTREE directory inode 24001: block #291 has bad max hash +Problem in HTREE directory inode 24001: block #292 has bad min hash +Problem in HTREE directory inode 24001: block #292 has bad max hash +Problem in HTREE directory inode 24001: block #293 has bad min hash +Problem in HTREE directory inode 24001: block #293 has bad max hash +Problem in HTREE directory inode 24001: block #294 has bad min hash +Problem in HTREE directory inode 24001: block #294 has bad max hash +Problem in HTREE directory inode 24001: block #295 has bad min hash +Problem in HTREE directory inode 24001: block #295 has bad max hash +Problem in HTREE directory inode 24001: block #296 has bad min hash +Problem in HTREE directory inode 24001: block #296 has bad max hash +Problem in HTREE directory inode 24001: block #297 has bad min hash +Problem in HTREE directory inode 24001: block #297 has bad max hash +Problem in HTREE directory inode 24001: block #298 has bad min hash +Problem in HTREE directory inode 24001: block #298 has bad max hash +Problem in HTREE directory inode 24001: block #299 has bad min hash +Problem in HTREE directory inode 24001: block #299 has bad max hash +Problem in HTREE directory inode 24001: block #300 has bad min hash +Problem in HTREE directory inode 24001: block #300 has bad max hash +Problem in HTREE directory inode 24001: block #301 has bad min hash +Problem in HTREE directory inode 24001: block #301 has bad max hash +Problem in HTREE directory inode 24001: block #302 has bad min hash +Problem in HTREE directory inode 24001: block #302 has bad max hash +Problem in HTREE directory inode 24001: block #303 has bad min hash +Problem in HTREE directory inode 24001: block #303 has bad max hash +Problem in HTREE directory inode 24001: block #304 has bad min hash +Problem in HTREE directory inode 24001: block #304 has bad max hash +Problem in HTREE directory inode 24001: block #305 has bad min hash +Problem in HTREE directory inode 24001: block #305 has bad max hash +Problem in HTREE directory inode 24001: block #306 has bad min hash +Problem in HTREE directory inode 24001: block #306 has bad max hash +Problem in HTREE directory inode 24001: block #307 has bad min hash +Problem in HTREE directory inode 24001: block #307 has bad max hash +Problem in HTREE directory inode 24001: block #308 has bad min hash +Problem in HTREE directory inode 24001: block #308 has bad max hash +Problem in HTREE directory inode 24001: block #309 has bad min hash +Problem in HTREE directory inode 24001: block #309 has bad max hash +Problem in HTREE directory inode 24001: block #310 has bad min hash +Problem in HTREE directory inode 24001: block #310 has bad max hash +Problem in HTREE directory inode 24001: block #311 has bad min hash +Problem in HTREE directory inode 24001: block #311 has bad max hash +Problem in HTREE directory inode 24001: block #312 has bad min hash +Problem in HTREE directory inode 24001: block #312 has bad max hash +Problem in HTREE directory inode 24001: block #313 has bad min hash +Problem in HTREE directory inode 24001: block #313 has bad max hash +Problem in HTREE directory inode 24001: block #314 has bad min hash +Problem in HTREE directory inode 24001: block #314 has bad max hash +Problem in HTREE directory inode 24001: block #315 has bad min hash +Problem in HTREE directory inode 24001: block #315 has bad max hash +Problem in HTREE directory inode 24001: block #316 has bad min hash +Problem in HTREE directory inode 24001: block #316 has bad max hash +Problem in HTREE directory inode 24001: block #317 has bad min hash +Problem in HTREE directory inode 24001: block #317 has bad max hash +Problem in HTREE directory inode 24001: block #318 has bad min hash +Problem in HTREE directory inode 24001: block #318 has bad max hash +Problem in HTREE directory inode 24001: block #319 has bad min hash +Problem in HTREE directory inode 24001: block #319 has bad max hash +Problem in HTREE directory inode 24001: block #320 has bad min hash +Problem in HTREE directory inode 24001: block #320 has bad max hash +Problem in HTREE directory inode 24001: block #321 has bad min hash +Problem in HTREE directory inode 24001: block #321 has bad max hash +Problem in HTREE directory inode 24001: block #322 has bad min hash +Problem in HTREE directory inode 24001: block #322 has bad max hash +Problem in HTREE directory inode 24001: block #323 has bad min hash +Problem in HTREE directory inode 24001: block #323 has bad max hash +Problem in HTREE directory inode 24001: block #324 has bad min hash +Problem in HTREE directory inode 24001: block #324 has bad max hash +Problem in HTREE directory inode 24001: block #325 has bad min hash +Problem in HTREE directory inode 24001: block #325 has bad max hash +Problem in HTREE directory inode 24001: block #326 has bad min hash +Problem in HTREE directory inode 24001: block #326 has bad max hash +Problem in HTREE directory inode 24001: block #327 has bad min hash +Problem in HTREE directory inode 24001: block #327 has bad max hash +Problem in HTREE directory inode 24001: block #328 has bad min hash +Problem in HTREE directory inode 24001: block #328 has bad max hash +Problem in HTREE directory inode 24001: block #329 has bad min hash +Problem in HTREE directory inode 24001: block #329 has bad max hash +Problem in HTREE directory inode 24001: block #330 has bad min hash +Problem in HTREE directory inode 24001: block #330 has bad max hash +Problem in HTREE directory inode 24001: block #331 has bad min hash +Problem in HTREE directory inode 24001: block #331 has bad max hash +Problem in HTREE directory inode 24001: block #332 has bad min hash +Problem in HTREE directory inode 24001: block #332 has bad max hash +Problem in HTREE directory inode 24001: block #333 has bad min hash +Problem in HTREE directory inode 24001: block #333 has bad max hash +Problem in HTREE directory inode 24001: block #334 has bad min hash +Problem in HTREE directory inode 24001: block #334 has bad max hash +Problem in HTREE directory inode 24001: block #335 has bad min hash +Problem in HTREE directory inode 24001: block #335 has bad max hash +Problem in HTREE directory inode 24001: block #336 has bad min hash +Problem in HTREE directory inode 24001: block #336 has bad max hash +Problem in HTREE directory inode 24001: block #337 has bad min hash +Problem in HTREE directory inode 24001: block #337 has bad max hash +Problem in HTREE directory inode 24001: block #338 has bad min hash +Problem in HTREE directory inode 24001: block #338 has bad max hash +Problem in HTREE directory inode 24001: block #339 has bad min hash +Problem in HTREE directory inode 24001: block #339 has bad max hash +Problem in HTREE directory inode 24001: block #340 has bad min hash +Problem in HTREE directory inode 24001: block #340 has bad max hash +Problem in HTREE directory inode 24001: block #341 has bad min hash +Problem in HTREE directory inode 24001: block #341 has bad max hash +Problem in HTREE directory inode 24001: block #342 has bad min hash +Problem in HTREE directory inode 24001: block #342 has bad max hash +Problem in HTREE directory inode 24001: block #343 has bad min hash +Problem in HTREE directory inode 24001: block #343 has bad max hash +Problem in HTREE directory inode 24001: block #344 has bad min hash +Problem in HTREE directory inode 24001: block #344 has bad max hash +Problem in HTREE directory inode 24001: block #345 has bad min hash +Problem in HTREE directory inode 24001: block #345 has bad max hash +Problem in HTREE directory inode 24001: block #346 has bad min hash +Problem in HTREE directory inode 24001: block #346 has bad max hash +Problem in HTREE directory inode 24001: block #347 has bad min hash +Problem in HTREE directory inode 24001: block #347 has bad max hash +Problem in HTREE directory inode 24001: block #348 has bad min hash +Problem in HTREE directory inode 24001: block #348 has bad max hash +Problem in HTREE directory inode 24001: block #349 has bad min hash +Problem in HTREE directory inode 24001: block #349 has bad max hash +Problem in HTREE directory inode 24001: block #350 has bad min hash +Problem in HTREE directory inode 24001: block #350 has bad max hash +Problem in HTREE directory inode 24001: block #351 has bad min hash +Problem in HTREE directory inode 24001: block #351 has bad max hash +Problem in HTREE directory inode 24001: block #352 has bad min hash +Problem in HTREE directory inode 24001: block #352 has bad max hash +Problem in HTREE directory inode 24001: block #353 has bad min hash +Problem in HTREE directory inode 24001: block #353 has bad max hash +Problem in HTREE directory inode 24001: block #354 has bad min hash +Problem in HTREE directory inode 24001: block #354 has bad max hash +Problem in HTREE directory inode 24001: block #355 has bad min hash +Problem in HTREE directory inode 24001: block #355 has bad max hash +Problem in HTREE directory inode 24001: block #356 has bad min hash +Problem in HTREE directory inode 24001: block #356 has bad max hash +Problem in HTREE directory inode 24001: block #357 has bad min hash +Problem in HTREE directory inode 24001: block #357 has bad max hash +Problem in HTREE directory inode 24001: block #358 has bad min hash +Problem in HTREE directory inode 24001: block #358 has bad max hash +Problem in HTREE directory inode 24001: block #359 has bad min hash +Problem in HTREE directory inode 24001: block #359 has bad max hash +Problem in HTREE directory inode 24001: block #360 has bad min hash +Problem in HTREE directory inode 24001: block #360 has bad max hash +Problem in HTREE directory inode 24001: block #361 has bad min hash +Problem in HTREE directory inode 24001: block #361 has bad max hash +Problem in HTREE directory inode 24001: block #362 has bad min hash +Problem in HTREE directory inode 24001: block #362 has bad max hash +Problem in HTREE directory inode 24001: block #363 has bad min hash +Problem in HTREE directory inode 24001: block #363 has bad max hash +Problem in HTREE directory inode 24001: block #364 has bad min hash +Problem in HTREE directory inode 24001: block #364 has bad max hash +Problem in HTREE directory inode 24001: block #365 has bad min hash +Problem in HTREE directory inode 24001: block #365 has bad max hash +Problem in HTREE directory inode 24001: block #366 has bad min hash +Problem in HTREE directory inode 24001: block #366 has bad max hash +Problem in HTREE directory inode 24001: block #367 has bad min hash +Problem in HTREE directory inode 24001: block #367 has bad max hash +Problem in HTREE directory inode 24001: block #368 has bad min hash +Problem in HTREE directory inode 24001: block #368 has bad max hash +Problem in HTREE directory inode 24001: block #369 has bad min hash +Problem in HTREE directory inode 24001: block #369 has bad max hash +Problem in HTREE directory inode 24001: block #370 has bad min hash +Problem in HTREE directory inode 24001: block #370 has bad max hash +Problem in HTREE directory inode 24001: block #371 has bad min hash +Problem in HTREE directory inode 24001: block #371 has bad max hash +Problem in HTREE directory inode 24001: block #372 has bad min hash +Problem in HTREE directory inode 24001: block #372 has bad max hash +Problem in HTREE directory inode 24001: block #373 has bad min hash +Problem in HTREE directory inode 24001: block #373 has bad max hash +Problem in HTREE directory inode 24001: block #374 has bad min hash +Problem in HTREE directory inode 24001: block #374 has bad max hash +Problem in HTREE directory inode 24001: block #375 has bad min hash +Problem in HTREE directory inode 24001: block #375 has bad max hash +Problem in HTREE directory inode 24001: block #376 has bad min hash +Problem in HTREE directory inode 24001: block #376 has bad max hash +Problem in HTREE directory inode 24001: block #377 has bad min hash +Problem in HTREE directory inode 24001: block #377 has bad max hash +Problem in HTREE directory inode 24001: block #378 has bad min hash +Problem in HTREE directory inode 24001: block #378 has bad max hash +Problem in HTREE directory inode 24001: block #379 has bad min hash +Problem in HTREE directory inode 24001: block #379 has bad max hash +Problem in HTREE directory inode 24001: block #380 has bad min hash +Problem in HTREE directory inode 24001: block #380 has bad max hash +Problem in HTREE directory inode 24001: block #381 has bad min hash +Problem in HTREE directory inode 24001: block #382 has bad max hash +Problem in HTREE directory inode 24001: block #383 has bad min hash +Problem in HTREE directory inode 24001: block #383 has bad max hash +Problem in HTREE directory inode 24001: block #384 has bad min hash +Problem in HTREE directory inode 24001: block #384 has bad max hash +Problem in HTREE directory inode 24001: block #385 has bad min hash +Problem in HTREE directory inode 24001: block #385 has bad max hash +Problem in HTREE directory inode 24001: block #386 has bad min hash +Problem in HTREE directory inode 24001: block #386 has bad max hash +Problem in HTREE directory inode 24001: block #387 has bad min hash +Problem in HTREE directory inode 24001: block #387 has bad max hash +Problem in HTREE directory inode 24001: block #388 has bad min hash +Problem in HTREE directory inode 24001: block #388 has bad max hash +Problem in HTREE directory inode 24001: block #389 has bad min hash +Problem in HTREE directory inode 24001: block #389 has bad max hash +Problem in HTREE directory inode 24001: block #390 has bad min hash +Problem in HTREE directory inode 24001: block #390 has bad max hash +Problem in HTREE directory inode 24001: block #391 has bad min hash +Problem in HTREE directory inode 24001: block #391 has bad max hash +Problem in HTREE directory inode 24001: block #392 has bad min hash +Problem in HTREE directory inode 24001: block #392 has bad max hash +Problem in HTREE directory inode 24001: block #393 has bad min hash +Problem in HTREE directory inode 24001: block #393 has bad max hash +Problem in HTREE directory inode 24001: block #394 has bad min hash +Problem in HTREE directory inode 24001: block #394 has bad max hash +Problem in HTREE directory inode 24001: block #395 has bad min hash +Problem in HTREE directory inode 24001: block #395 has bad max hash +Problem in HTREE directory inode 24001: block #396 has bad min hash +Problem in HTREE directory inode 24001: block #396 has bad max hash +Problem in HTREE directory inode 24001: block #397 has bad min hash +Problem in HTREE directory inode 24001: block #397 has bad max hash +Problem in HTREE directory inode 24001: block #398 has bad min hash +Problem in HTREE directory inode 24001: block #398 has bad max hash +Problem in HTREE directory inode 24001: block #399 has bad min hash +Problem in HTREE directory inode 24001: block #399 has bad max hash +Problem in HTREE directory inode 24001: block #400 has bad min hash +Problem in HTREE directory inode 24001: block #400 has bad max hash +Problem in HTREE directory inode 24001: block #401 has bad min hash +Problem in HTREE directory inode 24001: block #401 has bad max hash +Problem in HTREE directory inode 24001: block #402 has bad min hash +Problem in HTREE directory inode 24001: block #402 has bad max hash +Problem in HTREE directory inode 24001: block #403 has bad min hash +Problem in HTREE directory inode 24001: block #403 has bad max hash +Problem in HTREE directory inode 24001: block #404 has bad min hash +Problem in HTREE directory inode 24001: block #404 has bad max hash +Problem in HTREE directory inode 24001: block #405 has bad min hash +Problem in HTREE directory inode 24001: block #405 has bad max hash +Problem in HTREE directory inode 24001: block #406 has bad min hash +Problem in HTREE directory inode 24001: block #406 has bad max hash +Problem in HTREE directory inode 24001: block #407 has bad min hash +Problem in HTREE directory inode 24001: block #407 has bad max hash +Problem in HTREE directory inode 24001: block #408 has bad min hash +Problem in HTREE directory inode 24001: block #408 has bad max hash +Problem in HTREE directory inode 24001: block #409 has bad min hash +Problem in HTREE directory inode 24001: block #409 has bad max hash +Problem in HTREE directory inode 24001: block #410 has bad min hash +Problem in HTREE directory inode 24001: block #410 has bad max hash +Problem in HTREE directory inode 24001: block #411 has bad min hash +Problem in HTREE directory inode 24001: block #411 has bad max hash +Problem in HTREE directory inode 24001: block #412 has bad min hash +Problem in HTREE directory inode 24001: block #412 has bad max hash +Problem in HTREE directory inode 24001: block #413 has bad min hash +Problem in HTREE directory inode 24001: block #413 has bad max hash +Problem in HTREE directory inode 24001: block #414 has bad min hash +Problem in HTREE directory inode 24001: block #414 has bad max hash +Problem in HTREE directory inode 24001: block #415 has bad min hash +Problem in HTREE directory inode 24001: block #415 has bad max hash +Problem in HTREE directory inode 24001: block #416 has bad min hash +Problem in HTREE directory inode 24001: block #416 has bad max hash +Problem in HTREE directory inode 24001: block #417 has bad min hash +Problem in HTREE directory inode 24001: block #417 has bad max hash +Problem in HTREE directory inode 24001: block #418 has bad min hash +Problem in HTREE directory inode 24001: block #418 has bad max hash +Problem in HTREE directory inode 24001: block #419 has bad min hash +Problem in HTREE directory inode 24001: block #419 has bad max hash +Problem in HTREE directory inode 24001: block #420 has bad min hash +Problem in HTREE directory inode 24001: block #420 has bad max hash +Problem in HTREE directory inode 24001: block #421 has bad min hash +Problem in HTREE directory inode 24001: block #421 has bad max hash +Problem in HTREE directory inode 24001: block #422 has bad min hash +Problem in HTREE directory inode 24001: block #422 has bad max hash +Problem in HTREE directory inode 24001: block #423 has bad min hash +Problem in HTREE directory inode 24001: block #423 has bad max hash +Problem in HTREE directory inode 24001: block #424 has bad min hash +Problem in HTREE directory inode 24001: block #424 has bad max hash +Problem in HTREE directory inode 24001: block #425 has bad min hash +Problem in HTREE directory inode 24001: block #425 has bad max hash +Problem in HTREE directory inode 24001: block #426 has bad min hash +Problem in HTREE directory inode 24001: block #426 has bad max hash +Problem in HTREE directory inode 24001: block #427 has bad min hash +Problem in HTREE directory inode 24001: block #427 has bad max hash +Problem in HTREE directory inode 24001: block #428 has bad min hash +Problem in HTREE directory inode 24001: block #428 has bad max hash +Problem in HTREE directory inode 24001: block #429 has bad min hash +Problem in HTREE directory inode 24001: block #429 has bad max hash +Problem in HTREE directory inode 24001: block #430 has bad min hash +Problem in HTREE directory inode 24001: block #430 has bad max hash +Problem in HTREE directory inode 24001: block #431 has bad min hash +Problem in HTREE directory inode 24001: block #431 has bad max hash +Problem in HTREE directory inode 24001: block #432 has bad min hash +Problem in HTREE directory inode 24001: block #432 has bad max hash +Problem in HTREE directory inode 24001: block #433 has bad min hash +Problem in HTREE directory inode 24001: block #433 has bad max hash +Problem in HTREE directory inode 24001: block #434 has bad min hash +Problem in HTREE directory inode 24001: block #434 has bad max hash +Problem in HTREE directory inode 24001: block #435 has bad min hash +Problem in HTREE directory inode 24001: block #435 has bad max hash +Problem in HTREE directory inode 24001: block #436 has bad min hash +Problem in HTREE directory inode 24001: block #436 has bad max hash +Problem in HTREE directory inode 24001: block #437 has bad min hash +Problem in HTREE directory inode 24001: block #437 has bad max hash +Problem in HTREE directory inode 24001: block #438 has bad min hash +Problem in HTREE directory inode 24001: block #438 has bad max hash +Problem in HTREE directory inode 24001: block #439 has bad min hash +Problem in HTREE directory inode 24001: block #439 has bad max hash +Problem in HTREE directory inode 24001: block #440 has bad min hash +Problem in HTREE directory inode 24001: block #440 has bad max hash +Problem in HTREE directory inode 24001: block #441 has bad min hash +Problem in HTREE directory inode 24001: block #441 has bad max hash +Problem in HTREE directory inode 24001: block #442 has bad min hash +Problem in HTREE directory inode 24001: block #442 has bad max hash +Problem in HTREE directory inode 24001: block #443 has bad min hash +Problem in HTREE directory inode 24001: block #443 has bad max hash +Problem in HTREE directory inode 24001: block #444 has bad min hash +Problem in HTREE directory inode 24001: block #444 has bad max hash +Problem in HTREE directory inode 24001: block #445 has bad min hash +Problem in HTREE directory inode 24001: block #445 has bad max hash +Problem in HTREE directory inode 24001: block #446 has bad min hash +Problem in HTREE directory inode 24001: block #446 has bad max hash +Problem in HTREE directory inode 24001: block #447 has bad min hash +Problem in HTREE directory inode 24001: block #447 has bad max hash +Problem in HTREE directory inode 24001: block #448 has bad min hash +Problem in HTREE directory inode 24001: block #448 has bad max hash +Problem in HTREE directory inode 24001: block #449 has bad min hash +Problem in HTREE directory inode 24001: block #449 has bad max hash +Problem in HTREE directory inode 24001: block #450 has bad min hash +Problem in HTREE directory inode 24001: block #450 has bad max hash +Problem in HTREE directory inode 24001: block #451 has bad min hash +Problem in HTREE directory inode 24001: block #451 has bad max hash +Problem in HTREE directory inode 24001: block #452 has bad min hash +Problem in HTREE directory inode 24001: block #452 has bad max hash +Problem in HTREE directory inode 24001: block #453 has bad min hash +Problem in HTREE directory inode 24001: block #453 has bad max hash +Problem in HTREE directory inode 24001: block #454 has bad min hash +Problem in HTREE directory inode 24001: block #454 has bad max hash +Problem in HTREE directory inode 24001: block #455 has bad min hash +Problem in HTREE directory inode 24001: block #455 has bad max hash +Problem in HTREE directory inode 24001: block #456 has bad min hash +Problem in HTREE directory inode 24001: block #457 has bad min hash +Problem in HTREE directory inode 24001: block #457 has bad max hash +Problem in HTREE directory inode 24001: block #458 has bad min hash +Problem in HTREE directory inode 24001: block #458 has bad max hash +Problem in HTREE directory inode 24001: block #459 has bad min hash +Problem in HTREE directory inode 24001: block #459 has bad max hash +Problem in HTREE directory inode 24001: block #460 has bad min hash +Problem in HTREE directory inode 24001: block #460 has bad max hash +Problem in HTREE directory inode 24001: block #461 has bad min hash +Problem in HTREE directory inode 24001: block #461 has bad max hash +Problem in HTREE directory inode 24001: block #462 has bad min hash +Problem in HTREE directory inode 24001: block #463 has bad min hash +Problem in HTREE directory inode 24001: block #463 has bad max hash +Problem in HTREE directory inode 24001: block #464 has bad min hash +Problem in HTREE directory inode 24001: block #464 has bad max hash +Problem in HTREE directory inode 24001: block #465 has bad min hash +Problem in HTREE directory inode 24001: block #466 has bad min hash +Problem in HTREE directory inode 24001: block #466 has bad max hash +Problem in HTREE directory inode 24001: block #467 has bad min hash +Problem in HTREE directory inode 24001: block #468 has bad min hash +Problem in HTREE directory inode 24001: block #468 has bad max hash +Problem in HTREE directory inode 24001: block #469 has bad min hash +Problem in HTREE directory inode 24001: block #470 has bad max hash +Problem in HTREE directory inode 24001: block #471 has bad min hash +Problem in HTREE directory inode 24001: block #471 has bad max hash +Problem in HTREE directory inode 24001: block #472 has bad min hash +Problem in HTREE directory inode 24001: block #472 has bad max hash +Problem in HTREE directory inode 24001: block #473 has bad min hash +Invalid HTREE directory inode 24001 (/test2). Clear HTree index? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 30514/32000 files (0.0% non-contiguous), 5669/8000 blocks +Exit status is 1 diff --git a/tests/f_h_reindex/expect.2 b/tests/f_h_reindex/expect.2 new file mode 100644 index 0000000..7f785af --- /dev/null +++ b/tests/f_h_reindex/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: 30514/32000 files (0.0% non-contiguous), 5669/8000 blocks +Exit status is 0 diff --git a/tests/f_h_reindex/image.gz b/tests/f_h_reindex/image.gz Binary files differnew file mode 100644 index 0000000..4aae72f --- /dev/null +++ b/tests/f_h_reindex/image.gz diff --git a/tests/f_h_reindex/name b/tests/f_h_reindex/name new file mode 100644 index 0000000..ed4625f --- /dev/null +++ b/tests/f_h_reindex/name @@ -0,0 +1 @@ +reindex HTREE Directory with different hash seed diff --git a/tests/f_h_reindex/script b/tests/f_h_reindex/script new file mode 100644 index 0000000..e5fc6b2 --- /dev/null +++ b/tests/f_h_reindex/script @@ -0,0 +1,5 @@ +if test "$HTREE"x = yx ; then +. $cmd_dir/run_e2fsck +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/f_h_unsigned/expect.1 b/tests/f_h_unsigned/expect.1 new file mode 100644 index 0000000..ff7579d --- /dev/null +++ b/tests/f_h_unsigned/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: 47730/100192 files (0.0% non-contiguous), 13378/31745 blocks +Exit status is 0 diff --git a/tests/f_h_unsigned/expect.2 b/tests/f_h_unsigned/expect.2 new file mode 100644 index 0000000..ff7579d --- /dev/null +++ b/tests/f_h_unsigned/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: 47730/100192 files (0.0% non-contiguous), 13378/31745 blocks +Exit status is 0 diff --git a/tests/f_h_unsigned/image.gz b/tests/f_h_unsigned/image.gz Binary files differnew file mode 100644 index 0000000..3af9c84 --- /dev/null +++ b/tests/f_h_unsigned/image.gz diff --git a/tests/f_h_unsigned/name b/tests/f_h_unsigned/name new file mode 100644 index 0000000..7fafc9c --- /dev/null +++ b/tests/f_h_unsigned/name @@ -0,0 +1 @@ +unsigned HTREE directory diff --git a/tests/f_h_unsigned/script b/tests/f_h_unsigned/script new file mode 100644 index 0000000..e5fc6b2 --- /dev/null +++ b/tests/f_h_unsigned/script @@ -0,0 +1,5 @@ +if test "$HTREE"x = yx ; then +. $cmd_dir/run_e2fsck +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/f_holedir/expect.1 b/tests/f_holedir/expect.1 new file mode 100644 index 0000000..ad74fa6 --- /dev/null +++ b/tests/f_holedir/expect.1 @@ -0,0 +1,33 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 11 has illegal block(s). Clear? yes + +Illegal block #6 (200) in inode 11. CLEARED. +Inode 11, i_size is 12288, should be 11264. Fix? yes + +Inode 11, i_blocks is 24, should be 16. Fix? yes + +Pass 2: Checking directory structure +Directory inode 11 has an unallocated block #0. Allocate? yes + +Directory inode 11 has an unallocated block #3. Allocate? yes + +Directory inode 11 has an unallocated block #6. Allocate? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -21 +Fix? yes + +Free blocks count wrong for group #0 (78, counted=79). +Fix? yes + +Free blocks count wrong (78, counted=79). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (9.1% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_holedir/expect.2 b/tests/f_holedir/expect.2 new file mode 100644 index 0000000..4c0b4f2 --- /dev/null +++ b/tests/f_holedir/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: 11/32 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_holedir/image.gz b/tests/f_holedir/image.gz Binary files differnew file mode 100644 index 0000000..ee26ab8 --- /dev/null +++ b/tests/f_holedir/image.gz diff --git a/tests/f_holedir/name b/tests/f_holedir/name new file mode 100644 index 0000000..411f656 --- /dev/null +++ b/tests/f_holedir/name @@ -0,0 +1 @@ +directory with holes and illegal blocks diff --git a/tests/f_holedir2/expect.1 b/tests/f_holedir2/expect.1 new file mode 100644 index 0000000..455f4b0 --- /dev/null +++ b/tests/f_holedir2/expect.1 @@ -0,0 +1,22 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_size is 0, should be 5120. Fix? yes + +Directory inode 13 block 2 should be at block 1. Fix? yes + +Pass 2: Checking directory structure +Directory inode 12 has an unallocated block #3. Allocate? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (78, counted=77). +Fix? yes + +Free blocks count wrong (78, counted=77). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (7.7% non-contiguous), 23/100 blocks +Exit status is 1 diff --git a/tests/f_holedir2/expect.2 b/tests/f_holedir2/expect.2 new file mode 100644 index 0000000..636c6e9 --- /dev/null +++ b/tests/f_holedir2/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: 13/16 files (0.0% non-contiguous), 23/100 blocks +Exit status is 0 diff --git a/tests/f_holedir2/image.gz b/tests/f_holedir2/image.gz Binary files differnew file mode 100644 index 0000000..63dda07 --- /dev/null +++ b/tests/f_holedir2/image.gz diff --git a/tests/f_holedir2/name b/tests/f_holedir2/name new file mode 100644 index 0000000..144f5b3 --- /dev/null +++ b/tests/f_holedir2/name @@ -0,0 +1 @@ +directories with holes and zero i_size diff --git a/tests/f_holedir3/expect.1 b/tests/f_holedir3/expect.1 new file mode 100644 index 0000000..074ca6c --- /dev/null +++ b/tests/f_holedir3/expect.1 @@ -0,0 +1,13 @@ +Pass 1: Checking inodes, blocks, and sizes +Directory inode 12 block 5 should be at block 2. Fix? yes + +Inode 12, i_size is 6144, should be 3072. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 17/128 files (5.9% non-contiguous), 1093/2048 blocks +Exit status is 1 diff --git a/tests/f_holedir3/expect.2 b/tests/f_holedir3/expect.2 new file mode 100644 index 0000000..b675e6d --- /dev/null +++ b/tests/f_holedir3/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: 17/128 files (5.9% non-contiguous), 1093/2048 blocks +Exit status is 0 diff --git a/tests/f_holedir3/image.gz b/tests/f_holedir3/image.gz Binary files differnew file mode 100644 index 0000000..c5eeb37 --- /dev/null +++ b/tests/f_holedir3/image.gz diff --git a/tests/f_holedir3/name b/tests/f_holedir3/name new file mode 100644 index 0000000..73b3612 --- /dev/null +++ b/tests/f_holedir3/name @@ -0,0 +1 @@ +real directories with holes and zero i_size diff --git a/tests/f_holedir4/expect.1 b/tests/f_holedir4/expect.1 new file mode 100644 index 0000000..1e66fb6 --- /dev/null +++ b/tests/f_holedir4/expect.1 @@ -0,0 +1,68 @@ +Pass 1: Checking inodes, blocks, and sizes +Directory inode 12 block 211 should be at block 25. Fix? yes + +Inode 12, i_size is 4096, should be 110592. Fix? yes + +Inode 12, i_blocks is 128, should be 256. Fix? yes + +Pass 2: Checking directory structure +Directory inode 12 has an unallocated block #2. Allocate? yes + +Directory inode 12 has an unallocated block #3. Allocate? yes + +Directory inode 12 has an unallocated block #4. Allocate? yes + +Directory inode 12 has an unallocated block #5. Allocate? yes + +Directory inode 12 has an unallocated block #6. Allocate? yes + +Directory inode 12 has an unallocated block #7. Allocate? yes + +Directory inode 12 has an unallocated block #8. Allocate? yes + +Directory inode 12 has an unallocated block #9. Allocate? yes + +Directory inode 12 has an unallocated block #10. Allocate? yes + +Directory inode 12 has an unallocated block #11. Allocate? yes + +Directory inode 12 has an unallocated block #12. Allocate? yes + +Directory inode 12 has an unallocated block #13. Allocate? yes + +Directory inode 12 has an unallocated block #14. Allocate? yes + +Directory inode 12 has an unallocated block #15. Allocate? yes + +Directory inode 12 has an unallocated block #16. Allocate? yes + +Directory inode 12 has an unallocated block #17. Allocate? yes + +Directory inode 12 has an unallocated block #18. Allocate? yes + +Directory inode 12 has an unallocated block #19. Allocate? yes + +Directory inode 12 has an unallocated block #20. Allocate? yes + +Directory inode 12 has an unallocated block #21. Allocate? yes + +Directory inode 12 has an unallocated block #22. Allocate? yes + +Directory inode 12 has an unallocated block #23. Allocate? yes + +Directory inode 12 has an unallocated block #24. Allocate? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (26, counted=25). +Fix? yes + +Free blocks count wrong (416, counted=400). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (7.7% non-contiguous), 112/512 blocks +Exit status is 1 diff --git a/tests/f_holedir4/expect.2 b/tests/f_holedir4/expect.2 new file mode 100644 index 0000000..1f0e351 --- /dev/null +++ b/tests/f_holedir4/expect.2 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12, i_blocks is 3072, should be 128. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (0.0% non-contiguous), 112/512 blocks +Exit status is 1 diff --git a/tests/f_holedir4/image.gz b/tests/f_holedir4/image.gz Binary files differnew file mode 100644 index 0000000..8ab1245 --- /dev/null +++ b/tests/f_holedir4/image.gz diff --git a/tests/f_holedir4/name b/tests/f_holedir4/name new file mode 100644 index 0000000..5eb55c1 --- /dev/null +++ b/tests/f_holedir4/name @@ -0,0 +1 @@ +bigalloc directory with hole and misaligned extent after hole diff --git a/tests/f_htree_bad_csum/expect.1 b/tests/f_htree_bad_csum/expect.1 new file mode 100644 index 0000000..258362b --- /dev/null +++ b/tests/f_htree_bad_csum/expect.1 @@ -0,0 +1,28 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Problem in HTREE directory inode 12: root node fails checksum. +Clear HTree index? yes + +Problem in HTREE directory inode 18: root node fails checksum. +Clear HTree index? yes + +Directory inode 24, block #0, offset 1020: directory corrupted +Salvage? yes + +Problem in HTREE directory inode 24: root node fails checksum. +Clear HTree index? yes + +Problem in HTREE directory inode 30: root node fails checksum. +Clear HTree index? yes + +Problem in HTREE directory inode 36: root node fails checksum. +Clear HTree index? yes + +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 47/128 files (2.1% non-contiguous), 1108/2048 blocks +Exit status is 1 diff --git a/tests/f_htree_bad_csum/expect.2 b/tests/f_htree_bad_csum/expect.2 new file mode 100644 index 0000000..7e3523b --- /dev/null +++ b/tests/f_htree_bad_csum/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: 47/128 files (2.1% non-contiguous), 1108/2048 blocks +Exit status is 0 diff --git a/tests/f_htree_bad_csum/image.gz b/tests/f_htree_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..def571c --- /dev/null +++ b/tests/f_htree_bad_csum/image.gz diff --git a/tests/f_htree_bad_csum/name b/tests/f_htree_bad_csum/name new file mode 100644 index 0000000..3388353 --- /dev/null +++ b/tests/f_htree_bad_csum/name @@ -0,0 +1 @@ +htree block bad csum/tail dirent/htree index corruption diff --git a/tests/f_htree_leaf_csum/expect.1 b/tests/f_htree_leaf_csum/expect.1 new file mode 100644 index 0000000..d6b179e --- /dev/null +++ b/tests/f_htree_leaf_csum/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 12, block #1: directory passes checks but fails checksum. +Fix? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 430/512 files (0.2% non-contiguous), 45/512 blocks +Exit status is 1 diff --git a/tests/f_htree_leaf_csum/expect.2 b/tests/f_htree_leaf_csum/expect.2 new file mode 100644 index 0000000..1609785 --- /dev/null +++ b/tests/f_htree_leaf_csum/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: 430/512 files (0.2% non-contiguous), 45/512 blocks +Exit status is 0 diff --git a/tests/f_htree_leaf_csum/image.gz b/tests/f_htree_leaf_csum/image.gz Binary files differnew file mode 100644 index 0000000..f2e4619 --- /dev/null +++ b/tests/f_htree_leaf_csum/image.gz diff --git a/tests/f_htree_leaf_csum/name b/tests/f_htree_leaf_csum/name new file mode 100644 index 0000000..43c6ada --- /dev/null +++ b/tests/f_htree_leaf_csum/name @@ -0,0 +1 @@ +bad csum in htree leaf block diff --git a/tests/f_hugedir_blocks/expect.1 b/tests/f_hugedir_blocks/expect.1 new file mode 100644 index 0000000..798a7ac --- /dev/null +++ b/tests/f_hugedir_blocks/expect.1 @@ -0,0 +1,10 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 is too big. Truncate? yes + +Block #1074791435 (13) causes directory to be too big. CLEARED. +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (8.3% non-contiguous), 22/512 blocks +Exit status is 0 diff --git a/tests/f_hugedir_blocks/expect.2 b/tests/f_hugedir_blocks/expect.2 new file mode 100644 index 0000000..ac5f4c1 --- /dev/null +++ b/tests/f_hugedir_blocks/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/128 files (8.3% non-contiguous), 22/512 blocks +Exit status is 0 diff --git a/tests/f_hugedir_blocks/image.gz b/tests/f_hugedir_blocks/image.gz Binary files differnew file mode 100644 index 0000000..1d54de8 --- /dev/null +++ b/tests/f_hugedir_blocks/image.gz diff --git a/tests/f_hugedir_blocks/name b/tests/f_hugedir_blocks/name new file mode 100644 index 0000000..58b7916 --- /dev/null +++ b/tests/f_hugedir_blocks/name @@ -0,0 +1 @@ +dir crashes e2fsck with impossible logical blk offset diff --git a/tests/f_hurd/expect.1 b/tests/f_hurd/expect.1 new file mode 100644 index 0000000..f7bfc56 --- /dev/null +++ b/tests/f_hurd/expect.1 @@ -0,0 +1,12 @@ +The Hurd does not support the filetype feature. +Clear? yes + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 1 diff --git a/tests/f_hurd/expect.2 b/tests/f_hurd/expect.2 new file mode 100644 index 0000000..44bff62 --- /dev/null +++ b/tests/f_hurd/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: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 0 diff --git a/tests/f_hurd/image.gz b/tests/f_hurd/image.gz Binary files differnew file mode 100644 index 0000000..58ffe0c --- /dev/null +++ b/tests/f_hurd/image.gz diff --git a/tests/f_hurd/name b/tests/f_hurd/name new file mode 100644 index 0000000..a692986 --- /dev/null +++ b/tests/f_hurd/name @@ -0,0 +1 @@ +GNU/Hurd specific tests diff --git a/tests/f_idata_and_extents/expect.1 b/tests/f_idata_and_extents/expect.1 new file mode 100644 index 0000000..7f7fbf3 --- /dev/null +++ b/tests/f_idata_and_extents/expect.1 @@ -0,0 +1,35 @@ +Pass 1: Checking inodes, blocks, and sizes +Special (device/socket/fifo) file (inode 19) has extents +or inline-data flag set. Clear? yes + +Inode 20 has extent header but inline data flag is set. +Fix? yes + +Inode 21 has inline data and extent flags set but i_block contains junk. +Clear inode? yes + +Inode 22 seems to have block map but inline data and extent flags set. +Fix? yes + +Inode 23 seems to have inline data but extent flag is set. +Fix? yes + +Pass 2: Checking directory structure +Entry 'garbage' in /bad (18) has deleted/unused inode 21. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -21 +Fix? yes + +Free inodes count wrong for group #0 (105, counted=106). +Fix? yes + +Free inodes count wrong (105, counted=106). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 22/128 files (0.0% non-contiguous), 21/512 blocks +Exit status is 1 diff --git a/tests/f_idata_and_extents/expect.2 b/tests/f_idata_and_extents/expect.2 new file mode 100644 index 0000000..307d3f6 --- /dev/null +++ b/tests/f_idata_and_extents/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: 22/128 files (0.0% non-contiguous), 21/512 blocks +Exit status is 0 diff --git a/tests/f_idata_and_extents/image.gz b/tests/f_idata_and_extents/image.gz Binary files differnew file mode 100644 index 0000000..5187ba1 --- /dev/null +++ b/tests/f_idata_and_extents/image.gz diff --git a/tests/f_idata_and_extents/name b/tests/f_idata_and_extents/name new file mode 100644 index 0000000..362ce0e --- /dev/null +++ b/tests/f_idata_and_extents/name @@ -0,0 +1 @@ +conflicting extents and inline_data inode flags diff --git a/tests/f_illbbitmap/expect.1 b/tests/f_illbbitmap/expect.1 new file mode 100644 index 0000000..40996cd --- /dev/null +++ b/tests/f_illbbitmap/expect.1 @@ -0,0 +1,30 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap +Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +Block bitmap for group 0 is not in group. (block 4096) +Relocate? yes + +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Relocating group 0's block bitmap to 4... +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--21) +Fix? yes + +Inode bitmap differences: -(12--21) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_illbbitmap/expect.2 b/tests/f_illbbitmap/expect.2 new file mode 100644 index 0000000..a821f87 --- /dev/null +++ b/tests/f_illbbitmap/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: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_illbbitmap/image.gz b/tests/f_illbbitmap/image.gz Binary files differnew file mode 100644 index 0000000..fb16ebc --- /dev/null +++ b/tests/f_illbbitmap/image.gz diff --git a/tests/f_illbbitmap/name b/tests/f_illbbitmap/name new file mode 100644 index 0000000..5ed4f59 --- /dev/null +++ b/tests/f_illbbitmap/name @@ -0,0 +1 @@ +illegal block bitmap diff --git a/tests/f_illibitmap/expect.1 b/tests/f_illibitmap/expect.1 new file mode 100644 index 0000000..bf21df7 --- /dev/null +++ b/tests/f_illibitmap/expect.1 @@ -0,0 +1,27 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode bitmap +Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +Inode bitmap for group 0 is not in group. (block 4000) +Relocate? yes + +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Relocating group 0's inode bitmap to 4... +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_illibitmap/expect.2 b/tests/f_illibitmap/expect.2 new file mode 100644 index 0000000..a821f87 --- /dev/null +++ b/tests/f_illibitmap/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: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_illibitmap/image.gz b/tests/f_illibitmap/image.gz Binary files differnew file mode 100644 index 0000000..3e0892d --- /dev/null +++ b/tests/f_illibitmap/image.gz diff --git a/tests/f_illibitmap/name b/tests/f_illibitmap/name new file mode 100644 index 0000000..bac4003 --- /dev/null +++ b/tests/f_illibitmap/name @@ -0,0 +1 @@ +illegal inode bitmap diff --git a/tests/f_illitable/expect.1 b/tests/f_illitable/expect.1 new file mode 100644 index 0000000..0aa5687 --- /dev/null +++ b/tests/f_illitable/expect.1 @@ -0,0 +1,49 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode table +Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +Inode table for group 0 is not in group. (block 40000) +WARNING: SEVERE DATA LOSS POSSIBLE. +Relocate? yes + +../e2fsck/e2fsck: A block group is missing an inode table while reading bad blocks inode +This doesn't bode well, but we'll try to go on... +Pass 1: Checking inodes, blocks, and sizes +Relocating group 0's inode table to 7... +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(11--21) +Fix? yes + +Free blocks count wrong for group #0 (77, counted=89). +Fix? yes + +Free blocks count wrong (77, counted=89). +Fix? yes + +Free inodes count wrong for group #0 (20, counted=21). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (20, counted=21). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 11/100 blocks +Exit status is 1 diff --git a/tests/f_illitable/expect.2 b/tests/f_illitable/expect.2 new file mode 100644 index 0000000..3ead5cf --- /dev/null +++ b/tests/f_illitable/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: 11/32 files (0.0% non-contiguous), 11/100 blocks +Exit status is 0 diff --git a/tests/f_illitable/image.gz b/tests/f_illitable/image.gz Binary files differnew file mode 100644 index 0000000..1b02194 --- /dev/null +++ b/tests/f_illitable/image.gz diff --git a/tests/f_illitable/name b/tests/f_illitable/name new file mode 100644 index 0000000..631e73b --- /dev/null +++ b/tests/f_illitable/name @@ -0,0 +1 @@ +illegal inode table diff --git a/tests/f_illitable_flexbg/expect.1 b/tests/f_illitable_flexbg/expect.1 new file mode 100644 index 0000000..4ac1246 --- /dev/null +++ b/tests/f_illitable_flexbg/expect.1 @@ -0,0 +1,26 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode table +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +Inode table for group 1 is not in group. (block 0) +WARNING: SEVERE DATA LOSS POSSIBLE. +Relocate? yes + +Pass 1: Checking inodes, blocks, and sizes +Relocating group 1's inode table to 142... +Restarting e2fsck from the beginning... +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 1 checksum is 0x1cee, should be 0xf809. FIXED. +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 +Inode bitmap differences: -(65--128) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/256 files (0.0% non-contiguous), 31163/32768 blocks +Exit status is 1 diff --git a/tests/f_illitable_flexbg/expect.2 b/tests/f_illitable_flexbg/expect.2 new file mode 100644 index 0000000..8ef43c2 --- /dev/null +++ b/tests/f_illitable_flexbg/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/256 files (0.0% non-contiguous), 31163/32768 blocks +Exit status is 0 diff --git a/tests/f_illitable_flexbg/image.gz b/tests/f_illitable_flexbg/image.gz Binary files differnew file mode 100755 index 0000000..7fa1446 --- /dev/null +++ b/tests/f_illitable_flexbg/image.gz diff --git a/tests/f_illitable_flexbg/name b/tests/f_illitable_flexbg/name new file mode 100644 index 0000000..58b0850 --- /dev/null +++ b/tests/f_illitable_flexbg/name @@ -0,0 +1 @@ +illegal inode table with FLEX_BG diff --git a/tests/f_imagic/expect.1 b/tests/f_imagic/expect.1 new file mode 100644 index 0000000..ebee192 --- /dev/null +++ b/tests/f_imagic/expect.1 @@ -0,0 +1,47 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has imagic flag set. Clear? yes + +Inode 13 has imagic flag set. Clear? yes + +Inode 14 has imagic flag set. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Unattached inode 12 +Connect to /lost+found? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Unattached inode 14 +Connect to /lost+found? yes + +Inode 14 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(9--19) +Fix? yes + +Free blocks count wrong for group #0 (75, counted=87). +Fix? yes + +Free blocks count wrong (75, counted=87). +Fix? yes + +Free inodes count wrong for group #0 (1, counted=2). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (1, counted=2). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/16 files (0.0% non-contiguous), 13/100 blocks +Exit status is 1 diff --git a/tests/f_imagic/expect.2 b/tests/f_imagic/expect.2 new file mode 100644 index 0000000..1f411c0 --- /dev/null +++ b/tests/f_imagic/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: 14/16 files (0.0% non-contiguous), 13/100 blocks +Exit status is 0 diff --git a/tests/f_imagic/image.gz b/tests/f_imagic/image.gz Binary files differnew file mode 100644 index 0000000..6c2b3fa --- /dev/null +++ b/tests/f_imagic/image.gz diff --git a/tests/f_imagic/name b/tests/f_imagic/name new file mode 100644 index 0000000..db94008 --- /dev/null +++ b/tests/f_imagic/name @@ -0,0 +1 @@ +non-imagic filesystem with imagic inodes diff --git a/tests/f_imagic_fs/expect.1 b/tests/f_imagic_fs/expect.1 new file mode 100644 index 0000000..b21fd35 --- /dev/null +++ b/tests/f_imagic_fs/expect.1 @@ -0,0 +1,31 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(9--19) +Fix? yes + +Free blocks count wrong for group #0 (75, counted=87). +Fix? yes + +Free blocks count wrong (75, counted=87). +Fix? yes + +Free inodes count wrong for group #0 (1, counted=2). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (1, counted=2). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/16 files (0.0% non-contiguous), 13/100 blocks +Exit status is 1 diff --git a/tests/f_imagic_fs/expect.2 b/tests/f_imagic_fs/expect.2 new file mode 100644 index 0000000..1f411c0 --- /dev/null +++ b/tests/f_imagic_fs/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: 14/16 files (0.0% non-contiguous), 13/100 blocks +Exit status is 0 diff --git a/tests/f_imagic_fs/name b/tests/f_imagic_fs/name new file mode 100644 index 0000000..a036976 --- /dev/null +++ b/tests/f_imagic_fs/name @@ -0,0 +1 @@ +imagic filesystem with imagic inodes diff --git a/tests/f_imagic_fs/script b/tests/f_imagic_fs/script new file mode 100644 index 0000000..511dcc7 --- /dev/null +++ b/tests/f_imagic_fs/script @@ -0,0 +1,8 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/../f_imagic/image.gz +PREP_CMD='$DEBUGFS -w -R "feature imagic_inodes" $TMPFILE > /dev/null 2>&1' +. $cmd_dir/run_e2fsck diff --git a/tests/f_ind_inode_collision/expect.1 b/tests/f_ind_inode_collision/expect.1 new file mode 100644 index 0000000..63c128b --- /dev/null +++ b/tests/f_ind_inode_collision/expect.1 @@ -0,0 +1,146 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 block 41 conflicts with critical metadata, skipping block checks. +Inode 12 block 40 conflicts with critical metadata, skipping block checks. +Inode 12 block 34 conflicts with critical metadata, skipping block checks. +Inode 12 block 1 conflicts with critical metadata, skipping block checks. +Inode 12, i_size is 33, should be 25227264. Fix? yes + +Inode 12, i_blocks is 999, should be 184. Fix? yes + + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 2: 3 +Multiply-claimed block(s) in inode 7: 11 +Multiply-claimed block(s) in inode 11: 4--7 +Multiply-claimed block(s) in inode 12: 41 40Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16877 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #4096 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #196608 for multiply claimed block map + 34 8 3Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #33152 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #4243456 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #65536 for multiply claimed block map + 28 8 11 1Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16832 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16384 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #131072 for multiply claimed block map + 28 4--7Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #33206 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #25227264 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #65536 for multiply claimed block map + 28 41Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16777215 for multiply claimed block map + 28 +Error while iterating over blocks in inode 12 (pass1b): Illegal indirect block found +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 3 inodes containing multiply-claimed blocks.) + +File / (inode #2, mod time Sat Jan 17 21:16:16 2015) + has 1 multiply-claimed block(s), shared with 1 file(s): + /a (inode #12, mod time Sat Jan 17 21:16:37 2015) +Clone multiply-claimed blocks? yes + +File /lost+found (inode #11, mod time Sat Jan 17 21:16:16 2015) + has 4 multiply-claimed block(s), shared with 1 file(s): + /a (inode #12, mod time Sat Jan 17 21:16:37 2015) +Clone multiply-claimed blocks? yes + +File /a (inode #12, mod time Sat Jan 17 21:16:37 2015) + has 17 multiply-claimed block(s), shared with 4 file(s): + <filesystem metadata> + /lost+found (inode #11, mod time Sat Jan 17 21:16:16 2015) + <The group descriptor inode> (inode #7, mod time Sat Jan 17 21:16:16 2015) + / (inode #2, mod time Sat Jan 17 21:16:16 2015) +Clone multiply-claimed blocks? yes + +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16877 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #4096 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #196608 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #33152 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #4243456 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #65536 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16832 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16384 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #131072 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529376 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #33206 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #25227264 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #65536 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #1421529397 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #16777215 for multiply claimed block map +Pass 2: Checking directory structure +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has illegal block(s). Clear? yes + +Illegal block #1038 (1421529376) in inode 12. CLEARED. +Illegal block #1039 (1421529376) in inode 12. CLEARED. +Illegal block #1040 (1421529376) in inode 12. CLEARED. +Illegal block #1100 (16877) in inode 12. CLEARED. +Illegal block #1101 (4096) in inode 12. CLEARED. +Illegal block #1102 (1421529376) in inode 12. CLEARED. +Illegal block #1103 (1421529376) in inode 12. CLEARED. +Illegal block #1104 (1421529376) in inode 12. CLEARED. +Illegal block #1106 (196608) in inode 12. CLEARED. +Illegal block #1136 (1421529376) in inode 12. CLEARED. +Illegal block #1420 (33152) in inode 12. CLEARED. +Too many illegal blocks in inode 12. +Clear inode? yes + +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'a' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(3--7) -(15--17) -(19--24) +Fix? yes + +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (116, counted=117). +Fix? yes + +Free inodes count wrong (116, counted=117). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (9.1% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_ind_inode_collision/expect.2 b/tests/f_ind_inode_collision/expect.2 new file mode 100644 index 0000000..d0a6dac --- /dev/null +++ b/tests/f_ind_inode_collision/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: 11/128 files (9.1% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_ind_inode_collision/image.gz b/tests/f_ind_inode_collision/image.gz Binary files differnew file mode 100644 index 0000000..924d220 --- /dev/null +++ b/tests/f_ind_inode_collision/image.gz diff --git a/tests/f_ind_inode_collision/name b/tests/f_ind_inode_collision/name new file mode 100644 index 0000000..11feee3 --- /dev/null +++ b/tests/f_ind_inode_collision/name @@ -0,0 +1 @@ +multiple *ind collisions with critical metadata diff --git a/tests/f_inlinedata_dirblocks/expect.1 b/tests/f_inlinedata_dirblocks/expect.1 new file mode 100644 index 0000000..e3d0ee2 --- /dev/null +++ b/tests/f_inlinedata_dirblocks/expect.1 @@ -0,0 +1,25 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry '..' in ??? (12) has invalid inode #: 1752440867. +Clear? yes + +Directory inode 12, block #0, offset 4: directory corrupted +Salvage? yes + +Directory inode 12, block #1, offset 0: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +'..' in /aoo (12) is ??? (1752440867), should be / (2). +Fix? yes + +Error while adjusting inode count on inode 0 +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Directories count wrong for group #0 (2, counted=3). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_inlinedata_dirblocks/expect.2 b/tests/f_inlinedata_dirblocks/expect.2 new file mode 100644 index 0000000..3b6073e --- /dev/null +++ b/tests/f_inlinedata_dirblocks/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/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_inlinedata_dirblocks/image.gz b/tests/f_inlinedata_dirblocks/image.gz Binary files differnew file mode 100644 index 0000000..4cd64e0 --- /dev/null +++ b/tests/f_inlinedata_dirblocks/image.gz diff --git a/tests/f_inlinedata_dirblocks/name b/tests/f_inlinedata_dirblocks/name new file mode 100644 index 0000000..a226758 --- /dev/null +++ b/tests/f_inlinedata_dirblocks/name @@ -0,0 +1 @@ +check inline dir as two dirent blocks diff --git a/tests/f_inlinedata_flags/expect.1 b/tests/f_inlinedata_flags/expect.1 new file mode 100644 index 0000000..86eba88 --- /dev/null +++ b/tests/f_inlinedata_flags/expect.1 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag on filesystem without inline data support. +Clear? yes + +Inode 13 has inline data, but superblock is missing INLINE_DATA feature +Fix? yes + +Pass 2: Checking directory structure +Entry '1' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (243, counted=244). +Fix? yes + +Free inodes count wrong (243, counted=244). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/256 files (0.0% non-contiguous), 1143/8192 blocks +Exit status is 1 diff --git a/tests/f_inlinedata_flags/expect.2 b/tests/f_inlinedata_flags/expect.2 new file mode 100644 index 0000000..87b3f18 --- /dev/null +++ b/tests/f_inlinedata_flags/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/256 files (0.0% non-contiguous), 1143/8192 blocks +Exit status is 0 diff --git a/tests/f_inlinedata_flags/image.gz b/tests/f_inlinedata_flags/image.gz Binary files differnew file mode 100644 index 0000000..4344a0a --- /dev/null +++ b/tests/f_inlinedata_flags/image.gz diff --git a/tests/f_inlinedata_flags/name b/tests/f_inlinedata_flags/name new file mode 100644 index 0000000..66b7676 --- /dev/null +++ b/tests/f_inlinedata_flags/name @@ -0,0 +1 @@ +check incorrect inline_data flags diff --git a/tests/f_inlinedata_repair/expect.1 b/tests/f_inlinedata_repair/expect.1 new file mode 100644 index 0000000..9c84b14 --- /dev/null +++ b/tests/f_inlinedata_repair/expect.1 @@ -0,0 +1,58 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Inode 16, i_size is 56, should be 60. Fix? yes + +Inode 24, i_size is 59, should be 60. Fix? yes + +Inode 28 is a unknown file type with mode 00 but it looks like it is really a directory. +Fix? yes + +Pass 2: Checking directory structure +Directory inode 20, block #0, offset 4: directory corrupted +Salvage? yes + +Directory inode 28, block #0, offset 4: directory corrupted +Salvage? yes + +Directory inode 32, block #0, offset 4: directory corrupted +Salvage? yes + +Directory inode 32, block #0, offset 4: directory corrupted +Salvage? yes + +Symlink /1 (inode #12) is invalid. +Clear? yes + +Symlink /3 (inode #14) is invalid. +Clear? yes + +Inode 38 (/B) has invalid mode (00). +Clear? yes + +Inode 36 (/A) has invalid mode (00). +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached zero-length inode 22. Clear? yes + +Unattached zero-length inode 23. Clear? yes + +Unattached zero-length inode 29. Clear? yes + +Unattached zero-length inode 30. Clear? yes + +Unattached zero-length inode 31. Clear? yes + +Unattached zero-length inode 33. Clear? yes + +Unattached zero-length inode 34. Clear? yes + +Unattached zero-length inode 35. Clear? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 26/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_inlinedata_repair/expect.2 b/tests/f_inlinedata_repair/expect.2 new file mode 100644 index 0000000..69d874e --- /dev/null +++ b/tests/f_inlinedata_repair/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: 26/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_inlinedata_repair/image.gz b/tests/f_inlinedata_repair/image.gz Binary files differnew file mode 100644 index 0000000..c33d81d --- /dev/null +++ b/tests/f_inlinedata_repair/image.gz diff --git a/tests/f_inlinedata_repair/name b/tests/f_inlinedata_repair/name new file mode 100644 index 0000000..7e7e898 --- /dev/null +++ b/tests/f_inlinedata_repair/name @@ -0,0 +1 @@ +repair corrupt inline data files diff --git a/tests/f_inlinedir_detector/expect.1 b/tests/f_inlinedir_detector/expect.1 new file mode 100644 index 0000000..72b7519 --- /dev/null +++ b/tests/f_inlinedir_detector/expect.1 @@ -0,0 +1,20 @@ +Pass 1: Checking inodes, blocks, and sizes +Special (device/socket/fifo) file (inode 12) has extents +or inline-data flag set. Clear? yes + +Special (device/socket/fifo) inode 12 has non-zero size. Fix? yes + +Inode 13 is a named pipe but it looks like it is really a directory. +Fix? yes + +Pass 2: Checking directory structure +Entry 'moo' in / (2) has an incorrect filetype (was 1, should be 5). +Fix? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_inlinedir_detector/expect.2 b/tests/f_inlinedir_detector/expect.2 new file mode 100644 index 0000000..06886a4 --- /dev/null +++ b/tests/f_inlinedir_detector/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: 13/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_inlinedir_detector/image.gz b/tests/f_inlinedir_detector/image.gz Binary files differnew file mode 100644 index 0000000..34b4518 --- /dev/null +++ b/tests/f_inlinedir_detector/image.gz diff --git a/tests/f_inlinedir_detector/name b/tests/f_inlinedir_detector/name new file mode 100644 index 0000000..3368af5 --- /dev/null +++ b/tests/f_inlinedir_detector/name @@ -0,0 +1 @@ +detect inline dirs correctly diff --git a/tests/f_inode_ea_collision/expect.1 b/tests/f_inode_ea_collision/expect.1 new file mode 100644 index 0000000..a67a5f1 --- /dev/null +++ b/tests/f_inode_ea_collision/expect.1 @@ -0,0 +1,15 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extended attribute is corrupt (allocation collision). Clear? yes + +Inode 13 extended attribute is corrupt (allocation collision). Clear? yes + +Inode 14 extended attribute is corrupt (allocation collision). Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_inode_ea_collision/expect.2 b/tests/f_inode_ea_collision/expect.2 new file mode 100644 index 0000000..5a7ca86 --- /dev/null +++ b/tests/f_inode_ea_collision/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: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_inode_ea_collision/image.gz b/tests/f_inode_ea_collision/image.gz Binary files differnew file mode 100644 index 0000000..5217f65 --- /dev/null +++ b/tests/f_inode_ea_collision/image.gz diff --git a/tests/f_inode_ea_collision/name b/tests/f_inode_ea_collision/name new file mode 100644 index 0000000..b64119e --- /dev/null +++ b/tests/f_inode_ea_collision/name @@ -0,0 +1 @@ +collisions in the inode ea area diff --git a/tests/f_invalid_bad_inode/expect.1 b/tests/f_invalid_bad_inode/expect.1 new file mode 100644 index 0000000..5a37cb0 --- /dev/null +++ b/tests/f_invalid_bad_inode/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +The bad block inode looks invalid. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_invalid_bad_inode/expect.2 b/tests/f_invalid_bad_inode/expect.2 new file mode 100644 index 0000000..41ceefb --- /dev/null +++ b/tests/f_invalid_bad_inode/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: 11/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_invalid_bad_inode/image.gz b/tests/f_invalid_bad_inode/image.gz Binary files differnew file mode 100644 index 0000000..5dac147 --- /dev/null +++ b/tests/f_invalid_bad_inode/image.gz diff --git a/tests/f_invalid_bad_inode/name b/tests/f_invalid_bad_inode/name new file mode 100644 index 0000000..f981e8d --- /dev/null +++ b/tests/f_invalid_bad_inode/name @@ -0,0 +1 @@ +check for bogus bad inode diff --git a/tests/f_invalid_extent_symlink/expect.1 b/tests/f_invalid_extent_symlink/expect.1 new file mode 100644 index 0000000..7bda0b7 --- /dev/null +++ b/tests/f_invalid_extent_symlink/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Symlink /a (inode #12) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (9.1% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_invalid_extent_symlink/expect.2 b/tests/f_invalid_extent_symlink/expect.2 new file mode 100644 index 0000000..41ceefb --- /dev/null +++ b/tests/f_invalid_extent_symlink/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: 11/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_invalid_extent_symlink/image.gz b/tests/f_invalid_extent_symlink/image.gz Binary files differnew file mode 100644 index 0000000..d4a6eef --- /dev/null +++ b/tests/f_invalid_extent_symlink/image.gz diff --git a/tests/f_invalid_extent_symlink/name b/tests/f_invalid_extent_symlink/name new file mode 100644 index 0000000..3792aac --- /dev/null +++ b/tests/f_invalid_extent_symlink/name @@ -0,0 +1 @@ +extent-mapped symlink with two blocks diff --git a/tests/f_itable_collision/expect.1 b/tests/f_itable_collision/expect.1 new file mode 100644 index 0000000..01c85d4 --- /dev/null +++ b/tests/f_itable_collision/expect.1 @@ -0,0 +1,93 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 block 37 conflicts with critical metadata, skipping block checks. +Illegal block number passed to ext2fs_test_block_bitmap #268435455 for in-use block map +Illegal block number passed to ext2fs_mark_block_bitmap #268435455 for in-use block map +Inode 12, i_blocks is 48, should be 56. Fix? yes + +Inode 13 has a bad extended attribute block 34. Clear? yes + +Deleted inode 33 has zero dtime. Fix? yes + +Inodes that were part of a corrupted orphan linked list found. Fix? yes + +Inode 49 was part of the orphaned inode list. FIXED. +Inode 14 block 36 conflicts with critical metadata, skipping block checks. +Inode 14 has illegal block(s). Clear? yes + +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Illegal indirect block (4294967295) in inode 14. CLEARED. +Too many illegal blocks in inode 14. +Clear inode? yes + +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Inode 12 block 37 conflicts with critical metadata, skipping block checks. +Illegal block number passed to ext2fs_test_block_bitmap #4294967294 for in-use block map +Illegal block number passed to ext2fs_mark_block_bitmap #4294967294 for in-use block map +Illegal block number passed to ext2fs_test_block_bitmap #268435455 for in-use block map +Illegal block number passed to ext2fs_mark_block_bitmap #268435455 for in-use block map + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Illegal block number passed to ext2fs_test_block_bitmap #4294967294 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #268435455 for multiply claimed block map +Multiply-claimed block(s) in inode 12: 37 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 1 inodes containing multiply-claimed blocks.) + +File /a (inode #12, mod time Fri Jun 27 18:34:44 2014) + has 1 multiply-claimed block(s), shared with 1 file(s): + <filesystem metadata> +Clone multiply-claimed blocks? yes + +Illegal block number passed to ext2fs_test_block_bitmap #4294967294 for multiply claimed block map +Illegal block number passed to ext2fs_test_block_bitmap #268435455 for multiply claimed block map +Pass 2: Checking directory structure +Setting filetype for entry 'bad1' in / (2) to 1. +Setting filetype for entry 'bad2' in / (2) to 1. +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 4294967294, len 1) +Clear? yes + +Inode 12 has an invalid extent + (logical block 5, invalid physical block 268435455, len 1) +Clear? yes + +Inode 12, i_blocks is 56, should be 40. Fix? yes + +Pass 2: Checking directory structure +Entry 'b' in / (2) has deleted/unused inode 14. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -9 -13 -42 +Fix? yes + +Free blocks count wrong for group #0 (485, counted=488). +Fix? yes + +Free blocks count wrong (485, counted=488). +Fix? yes + +Inode bitmap differences: -14 +34 +50 +Fix? yes + +Free inodes count wrong for group #0 (114, counted=113). +Fix? yes + +Free inodes count wrong (114, counted=113). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/128 files (6.7% non-contiguous), 24/512 blocks +Exit status is 0 diff --git a/tests/f_itable_collision/expect.2 b/tests/f_itable_collision/expect.2 new file mode 100644 index 0000000..4abc600 --- /dev/null +++ b/tests/f_itable_collision/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: 15/128 files (6.7% non-contiguous), 24/512 blocks +Exit status is 0 diff --git a/tests/f_itable_collision/image.gz b/tests/f_itable_collision/image.gz Binary files differnew file mode 100644 index 0000000..6218b14 --- /dev/null +++ b/tests/f_itable_collision/image.gz diff --git a/tests/f_itable_collision/name b/tests/f_itable_collision/name new file mode 100644 index 0000000..dab3d45 --- /dev/null +++ b/tests/f_itable_collision/name @@ -0,0 +1 @@ +collision between IND/extent tree blocks and inode table diff --git a/tests/f_itable_collision/script b/tests/f_itable_collision/script new file mode 100755 index 0000000..66abd90 --- /dev/null +++ b/tests/f_itable_collision/script @@ -0,0 +1,36 @@ +#!/bin/bash + +# Run this test with a specific time, because we're crosslinking an extent tree +# block with the inode table. When fsck sets dtime to now, we want "now" to be +# our preprogrammed value. + +FSCK_OPT=-fy +IMAGE=$test_dir/image.gz +E2FSCK_TIME=4294967294 +export E2FSCK_TIME + +gzip -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/f_jnl_32bit/expect.0 b/tests/f_jnl_32bit/expect.0 new file mode 100644 index 0000000..b7de48e --- /dev/null +++ b/tests/f_jnl_32bit/expect.0 @@ -0,0 +1,567 @@ +Journal starts at block 1, transaction 2 +Found expected sequence 2, type 1 (descriptor block) at block 1 +Dumping descriptor block, sequence 2, at block 1: + FS block 2 logged at journal block 2 (flags 0x8) +Found expected sequence 2, type 2 (commit block) at block 3 +Found expected sequence 3, type 1 (descriptor block) at block 4 +Dumping descriptor block, sequence 3, at block 4: + FS block 82 logged at journal block 5 (flags 0x0) + FS block 2 logged at journal block 6 (flags 0x2) + FS block 99 logged at journal block 7 (flags 0x2) + FS block 66 logged at journal block 8 (flags 0x2) + FS block 81 logged at journal block 9 (flags 0x2) + FS block 98 logged at journal block 10 (flags 0x2) + FS block 68 logged at journal block 11 (flags 0x2) + FS block 83 logged at journal block 12 (flags 0x2) + FS block 354 logged at journal block 13 (flags 0x2) + FS block 84 logged at journal block 14 (flags 0x2) + FS block 100 logged at journal block 15 (flags 0x2) + FS block 97 logged at journal block 16 (flags 0x2) + FS block 101 logged at journal block 17 (flags 0x2) + FS block 611 logged at journal block 18 (flags 0x2) + FS block 102 logged at journal block 19 (flags 0x2) + FS block 103 logged at journal block 20 (flags 0x2) + FS block 612 logged at journal block 21 (flags 0x2) + FS block 104 logged at journal block 22 (flags 0x2) + FS block 85 logged at journal block 23 (flags 0x2) + FS block 105 logged at journal block 24 (flags 0x2) + FS block 86 logged at journal block 25 (flags 0x2) + FS block 106 logged at journal block 26 (flags 0x2) + FS block 87 logged at journal block 27 (flags 0x2) + FS block 107 logged at journal block 28 (flags 0x2) + FS block 108 logged at journal block 29 (flags 0x2) + FS block 88 logged at journal block 30 (flags 0x2) + FS block 109 logged at journal block 31 (flags 0x2) + FS block 355 logged at journal block 32 (flags 0x2) + FS block 613 logged at journal block 33 (flags 0x2) + FS block 110 logged at journal block 34 (flags 0x2) + FS block 614 logged at journal block 35 (flags 0x2) + FS block 111 logged at journal block 36 (flags 0x2) + FS block 615 logged at journal block 37 (flags 0x2) + FS block 112 logged at journal block 38 (flags 0x2) + FS block 113 logged at journal block 39 (flags 0x2) + FS block 616 logged at journal block 40 (flags 0x2) + FS block 89 logged at journal block 41 (flags 0x2) + FS block 114 logged at journal block 42 (flags 0x2) + FS block 90 logged at journal block 43 (flags 0x2) + FS block 115 logged at journal block 44 (flags 0x2) + FS block 91 logged at journal block 45 (flags 0x2) + FS block 116 logged at journal block 46 (flags 0x2) + FS block 92 logged at journal block 47 (flags 0x2) + FS block 117 logged at journal block 48 (flags 0x2) + FS block 118 logged at journal block 49 (flags 0x2) + FS block 356 logged at journal block 50 (flags 0x2) + FS block 93 logged at journal block 51 (flags 0x2) + FS block 119 logged at journal block 52 (flags 0x2) + FS block 94 logged at journal block 53 (flags 0x2) + FS block 120 logged at journal block 54 (flags 0x2) + FS block 95 logged at journal block 55 (flags 0x2) + FS block 121 logged at journal block 56 (flags 0x2) + FS block 96 logged at journal block 57 (flags 0x2) + FS block 122 logged at journal block 58 (flags 0x2) + FS block 123 logged at journal block 59 (flags 0x2) + FS block 617 logged at journal block 60 (flags 0x2) + FS block 124 logged at journal block 61 (flags 0x2) + FS block 618 logged at journal block 62 (flags 0x2) + FS block 125 logged at journal block 63 (flags 0x2) + FS block 619 logged at journal block 64 (flags 0x2) + FS block 126 logged at journal block 65 (flags 0x2) + FS block 620 logged at journal block 66 (flags 0x2) + FS block 357 logged at journal block 67 (flags 0x2) + FS block 621 logged at journal block 68 (flags 0x2) + FS block 127 logged at journal block 69 (flags 0x2) + FS block 128 logged at journal block 70 (flags 0x2) + FS block 622 logged at journal block 71 (flags 0x2) + FS block 129 logged at journal block 72 (flags 0x2) + FS block 623 logged at journal block 73 (flags 0x2) + FS block 130 logged at journal block 74 (flags 0x2) + FS block 624 logged at journal block 75 (flags 0x2) + FS block 131 logged at journal block 76 (flags 0x2) + FS block 625 logged at journal block 77 (flags 0x2) + FS block 132 logged at journal block 78 (flags 0x2) + FS block 133 logged at journal block 79 (flags 0x2) + FS block 626 logged at journal block 80 (flags 0x2) + FS block 134 logged at journal block 81 (flags 0x2) + FS block 627 logged at journal block 82 (flags 0x2) + FS block 135 logged at journal block 83 (flags 0x2) + FS block 628 logged at journal block 84 (flags 0x2) + FS block 136 logged at journal block 85 (flags 0x2) + FS block 358 logged at journal block 86 (flags 0x2) + FS block 629 logged at journal block 87 (flags 0x2) + FS block 137 logged at journal block 88 (flags 0xa) +Found expected sequence 3, type 1 (descriptor block) at block 89 +Dumping descriptor block, sequence 3, at block 89: + FS block 138 logged at journal block 90 (flags 0x0) + FS block 630 logged at journal block 91 (flags 0x2) + FS block 139 logged at journal block 92 (flags 0x2) + FS block 631 logged at journal block 93 (flags 0x2) + FS block 140 logged at journal block 94 (flags 0x2) + FS block 632 logged at journal block 95 (flags 0x2) + FS block 633 logged at journal block 96 (flags 0x2) + FS block 141 logged at journal block 97 (flags 0x2) + FS block 634 logged at journal block 98 (flags 0x2) + FS block 142 logged at journal block 99 (flags 0x2) + FS block 143 logged at journal block 100 (flags 0x2) + FS block 635 logged at journal block 101 (flags 0x2) + FS block 144 logged at journal block 102 (flags 0x2) + FS block 636 logged at journal block 103 (flags 0x2) + FS block 145 logged at journal block 104 (flags 0x2) + FS block 359 logged at journal block 105 (flags 0x2) + FS block 637 logged at journal block 106 (flags 0x2) + FS block 146 logged at journal block 107 (flags 0x2) + FS block 638 logged at journal block 108 (flags 0x2) + FS block 147 logged at journal block 109 (flags 0x2) + FS block 148 logged at journal block 110 (flags 0x2) + FS block 639 logged at journal block 111 (flags 0x2) + FS block 149 logged at journal block 112 (flags 0x2) + FS block 640 logged at journal block 113 (flags 0x2) + FS block 150 logged at journal block 114 (flags 0x2) + FS block 641 logged at journal block 115 (flags 0x2) + FS block 151 logged at journal block 116 (flags 0x2) + FS block 642 logged at journal block 117 (flags 0x2) + FS block 152 logged at journal block 118 (flags 0x2) + FS block 153 logged at journal block 119 (flags 0x2) + FS block 643 logged at journal block 120 (flags 0x2) + FS block 154 logged at journal block 121 (flags 0x2) + FS block 644 logged at journal block 122 (flags 0x2) + FS block 360 logged at journal block 123 (flags 0x2) + FS block 645 logged at journal block 124 (flags 0x2) + FS block 155 logged at journal block 125 (flags 0x2) + FS block 646 logged at journal block 126 (flags 0x2) + FS block 156 logged at journal block 127 (flags 0x2) + FS block 647 logged at journal block 128 (flags 0x2) + FS block 157 logged at journal block 129 (flags 0x2) + FS block 158 logged at journal block 130 (flags 0x2) + FS block 648 logged at journal block 131 (flags 0x2) + FS block 159 logged at journal block 132 (flags 0x2) + FS block 649 logged at journal block 133 (flags 0x2) + FS block 160 logged at journal block 134 (flags 0x2) + FS block 650 logged at journal block 135 (flags 0x2) + FS block 161 logged at journal block 136 (flags 0x2) + FS block 651 logged at journal block 137 (flags 0x2) + FS block 162 logged at journal block 138 (flags 0x2) + FS block 163 logged at journal block 139 (flags 0x2) + FS block 652 logged at journal block 140 (flags 0x2) + FS block 164 logged at journal block 141 (flags 0x2) + FS block 361 logged at journal block 142 (flags 0x2) + FS block 653 logged at journal block 143 (flags 0x2) + FS block 165 logged at journal block 144 (flags 0x2) + FS block 654 logged at journal block 145 (flags 0x2) + FS block 166 logged at journal block 146 (flags 0x2) + FS block 655 logged at journal block 147 (flags 0x2) + FS block 167 logged at journal block 148 (flags 0x2) + FS block 168 logged at journal block 149 (flags 0x2) + FS block 656 logged at journal block 150 (flags 0x2) + FS block 657 logged at journal block 151 (flags 0x2) + FS block 169 logged at journal block 152 (flags 0x2) + FS block 658 logged at journal block 153 (flags 0x2) + FS block 170 logged at journal block 154 (flags 0x2) + FS block 659 logged at journal block 155 (flags 0x2) + FS block 171 logged at journal block 156 (flags 0x2) + FS block 660 logged at journal block 157 (flags 0x2) + FS block 172 logged at journal block 158 (flags 0x2) + FS block 173 logged at journal block 159 (flags 0x2) + FS block 362 logged at journal block 160 (flags 0x2) + FS block 661 logged at journal block 161 (flags 0x2) + FS block 174 logged at journal block 162 (flags 0x2) + FS block 662 logged at journal block 163 (flags 0x2) + FS block 175 logged at journal block 164 (flags 0x2) + FS block 663 logged at journal block 165 (flags 0x2) + FS block 176 logged at journal block 166 (flags 0x2) + FS block 664 logged at journal block 167 (flags 0x2) + FS block 177 logged at journal block 168 (flags 0x2) + FS block 178 logged at journal block 169 (flags 0x2) + FS block 665 logged at journal block 170 (flags 0x2) + FS block 179 logged at journal block 171 (flags 0x2) + FS block 666 logged at journal block 172 (flags 0x2) + FS block 180 logged at journal block 173 (flags 0xa) +Found expected sequence 3, type 1 (descriptor block) at block 174 +Dumping descriptor block, sequence 3, at block 174: + FS block 667 logged at journal block 175 (flags 0x0) + FS block 181 logged at journal block 176 (flags 0x2) + FS block 668 logged at journal block 177 (flags 0x2) + FS block 363 logged at journal block 178 (flags 0x2) + FS block 669 logged at journal block 179 (flags 0x2) + FS block 182 logged at journal block 180 (flags 0x2) + FS block 183 logged at journal block 181 (flags 0x2) + FS block 670 logged at journal block 182 (flags 0x2) + FS block 184 logged at journal block 183 (flags 0x2) + FS block 671 logged at journal block 184 (flags 0x2) + FS block 185 logged at journal block 185 (flags 0x2) + FS block 672 logged at journal block 186 (flags 0x2) + FS block 186 logged at journal block 187 (flags 0x2) + FS block 673 logged at journal block 188 (flags 0x2) + FS block 187 logged at journal block 189 (flags 0x2) + FS block 188 logged at journal block 190 (flags 0x2) + FS block 674 logged at journal block 191 (flags 0x2) + FS block 189 logged at journal block 192 (flags 0x2) + FS block 675 logged at journal block 193 (flags 0x2) + FS block 190 logged at journal block 194 (flags 0x2) + FS block 676 logged at journal block 195 (flags 0x2) + FS block 191 logged at journal block 196 (flags 0x2) + FS block 364 logged at journal block 197 (flags 0x2) + FS block 677 logged at journal block 198 (flags 0x2) + FS block 192 logged at journal block 199 (flags 0x2) + FS block 193 logged at journal block 200 (flags 0x2) + FS block 678 logged at journal block 201 (flags 0x2) + FS block 194 logged at journal block 202 (flags 0x2) + FS block 679 logged at journal block 203 (flags 0x2) + FS block 195 logged at journal block 204 (flags 0x2) + FS block 680 logged at journal block 205 (flags 0x2) + FS block 681 logged at journal block 206 (flags 0x2) + FS block 196 logged at journal block 207 (flags 0x2) + FS block 682 logged at journal block 208 (flags 0x2) + FS block 197 logged at journal block 209 (flags 0x2) + FS block 198 logged at journal block 210 (flags 0x2) + FS block 683 logged at journal block 211 (flags 0x2) + FS block 199 logged at journal block 212 (flags 0x2) + FS block 684 logged at journal block 213 (flags 0x2) + FS block 200 logged at journal block 214 (flags 0x2) + FS block 365 logged at journal block 215 (flags 0x2) + FS block 685 logged at journal block 216 (flags 0x2) + FS block 201 logged at journal block 217 (flags 0x2) + FS block 686 logged at journal block 218 (flags 0x2) + FS block 202 logged at journal block 219 (flags 0x2) + FS block 203 logged at journal block 220 (flags 0x2) + FS block 687 logged at journal block 221 (flags 0xa) +Found expected sequence 3, type 2 (commit block) at block 222 +Found expected sequence 4, type 1 (descriptor block) at block 223 +Dumping descriptor block, sequence 4, at block 223: + FS block 204 logged at journal block 224 (flags 0x0) + FS block 687 logged at journal block 225 (flags 0x2) + FS block 203 logged at journal block 226 (flags 0x2) + FS block 365 logged at journal block 227 (flags 0x2) + FS block 2 logged at journal block 228 (flags 0x2) + FS block 82 logged at journal block 229 (flags 0x2) + FS block 83 logged at journal block 230 (flags 0x2) + FS block 66 logged at journal block 231 (flags 0x2) + FS block 688 logged at journal block 232 (flags 0x2) + FS block 364 logged at journal block 233 (flags 0x2) + FS block 680 logged at journal block 234 (flags 0x2) + FS block 205 logged at journal block 235 (flags 0x2) + FS block 689 logged at journal block 236 (flags 0x2) + FS block 206 logged at journal block 237 (flags 0x2) + FS block 690 logged at journal block 238 (flags 0x2) + FS block 207 logged at journal block 239 (flags 0x2) + FS block 208 logged at journal block 240 (flags 0x2) + FS block 691 logged at journal block 241 (flags 0x2) + FS block 209 logged at journal block 242 (flags 0x2) + FS block 692 logged at journal block 243 (flags 0x2) + FS block 98 logged at journal block 244 (flags 0x2) + FS block 68 logged at journal block 245 (flags 0x2) + FS block 366 logged at journal block 246 (flags 0x2) + FS block 693 logged at journal block 247 (flags 0x2) + FS block 210 logged at journal block 248 (flags 0x2) + FS block 694 logged at journal block 249 (flags 0x2) + FS block 211 logged at journal block 250 (flags 0x2) + FS block 695 logged at journal block 251 (flags 0x2) + FS block 212 logged at journal block 252 (flags 0x2) + FS block 213 logged at journal block 253 (flags 0x2) + FS block 696 logged at journal block 254 (flags 0x2) + FS block 214 logged at journal block 255 (flags 0x2) + FS block 697 logged at journal block 256 (flags 0x2) + FS block 215 logged at journal block 257 (flags 0x2) + FS block 698 logged at journal block 258 (flags 0x2) + FS block 216 logged at journal block 259 (flags 0x2) + FS block 699 logged at journal block 260 (flags 0x2) + FS block 217 logged at journal block 261 (flags 0x2) + FS block 218 logged at journal block 262 (flags 0x2) + FS block 700 logged at journal block 263 (flags 0x2) + FS block 219 logged at journal block 264 (flags 0x2) + FS block 367 logged at journal block 265 (flags 0x2) + FS block 701 logged at journal block 266 (flags 0x2) + FS block 220 logged at journal block 267 (flags 0x2) + FS block 702 logged at journal block 268 (flags 0x2) + FS block 221 logged at journal block 269 (flags 0x2) + FS block 703 logged at journal block 270 (flags 0x2) + FS block 222 logged at journal block 271 (flags 0x2) + FS block 223 logged at journal block 272 (flags 0x2) + FS block 704 logged at journal block 273 (flags 0x2) + FS block 705 logged at journal block 274 (flags 0x2) + FS block 224 logged at journal block 275 (flags 0x2) + FS block 706 logged at journal block 276 (flags 0x2) + FS block 225 logged at journal block 277 (flags 0x2) + FS block 707 logged at journal block 278 (flags 0x2) + FS block 226 logged at journal block 279 (flags 0x2) + FS block 708 logged at journal block 280 (flags 0x2) + FS block 227 logged at journal block 281 (flags 0x2) + FS block 228 logged at journal block 282 (flags 0x2) + FS block 368 logged at journal block 283 (flags 0x2) + FS block 709 logged at journal block 284 (flags 0x2) + FS block 229 logged at journal block 285 (flags 0x2) + FS block 710 logged at journal block 286 (flags 0x2) + FS block 230 logged at journal block 287 (flags 0x2) + FS block 711 logged at journal block 288 (flags 0x2) + FS block 231 logged at journal block 289 (flags 0x2) + FS block 712 logged at journal block 290 (flags 0x2) + FS block 232 logged at journal block 291 (flags 0x2) + FS block 233 logged at journal block 292 (flags 0x2) + FS block 713 logged at journal block 293 (flags 0x2) + FS block 234 logged at journal block 294 (flags 0x2) + FS block 714 logged at journal block 295 (flags 0x2) + FS block 235 logged at journal block 296 (flags 0x2) + FS block 715 logged at journal block 297 (flags 0x2) + FS block 236 logged at journal block 298 (flags 0x2) + FS block 716 logged at journal block 299 (flags 0x2) + FS block 369 logged at journal block 300 (flags 0x2) + FS block 717 logged at journal block 301 (flags 0x2) + FS block 237 logged at journal block 302 (flags 0x2) + FS block 238 logged at journal block 303 (flags 0x2) + FS block 718 logged at journal block 304 (flags 0x2) + FS block 239 logged at journal block 305 (flags 0x2) + FS block 719 logged at journal block 306 (flags 0x2) + FS block 240 logged at journal block 307 (flags 0xa) +Found expected sequence 4, type 1 (descriptor block) at block 308 +Dumping descriptor block, sequence 4, at block 308: + FS block 720 logged at journal block 309 (flags 0x0) + FS block 241 logged at journal block 310 (flags 0x2) + FS block 721 logged at journal block 311 (flags 0x2) + FS block 242 logged at journal block 312 (flags 0x2) + FS block 243 logged at journal block 313 (flags 0x2) + FS block 722 logged at journal block 314 (flags 0x2) + FS block 244 logged at journal block 315 (flags 0x2) + FS block 723 logged at journal block 316 (flags 0x2) + FS block 245 logged at journal block 317 (flags 0x2) + FS block 724 logged at journal block 318 (flags 0x2) + FS block 246 logged at journal block 319 (flags 0x2) + FS block 370 logged at journal block 320 (flags 0x2) + FS block 725 logged at journal block 321 (flags 0x2) + FS block 247 logged at journal block 322 (flags 0x2) + FS block 248 logged at journal block 323 (flags 0x2) + FS block 726 logged at journal block 324 (flags 0x2) + FS block 249 logged at journal block 325 (flags 0x2) + FS block 727 logged at journal block 326 (flags 0x2) + FS block 250 logged at journal block 327 (flags 0xa) +Found expected sequence 4, type 2 (commit block) at block 328 +Found expected sequence 5, type 5 (revoke table) at block 329 +Dumping revoke block, sequence 5, at block 329: + Revoke FS block 640 + Revoke FS block 641 + Revoke FS block 642 + Revoke FS block 643 + Revoke FS block 644 + Revoke FS block 645 + Revoke FS block 646 + Revoke FS block 647 + Revoke FS block 648 + Revoke FS block 649 + Revoke FS block 650 + Revoke FS block 651 + Revoke FS block 652 + Revoke FS block 653 + Revoke FS block 654 + Revoke FS block 655 + Revoke FS block 656 + Revoke FS block 657 + Revoke FS block 81 + Revoke FS block 658 + Revoke FS block 659 + Revoke FS block 660 + Revoke FS block 84 + Revoke FS block 661 + Revoke FS block 85 + Revoke FS block 662 + Revoke FS block 86 + Revoke FS block 663 + Revoke FS block 87 + Revoke FS block 664 + Revoke FS block 88 + Revoke FS block 665 + Revoke FS block 89 + Revoke FS block 666 + Revoke FS block 90 + Revoke FS block 667 + Revoke FS block 91 + Revoke FS block 668 + Revoke FS block 92 + Revoke FS block 669 + Revoke FS block 93 + Revoke FS block 670 + Revoke FS block 94 + Revoke FS block 671 + Revoke FS block 95 + Revoke FS block 672 + Revoke FS block 96 + Revoke FS block 673 + Revoke FS block 97 + Revoke FS block 674 + Revoke FS block 675 + Revoke FS block 611 + Revoke FS block 676 + Revoke FS block 612 + Revoke FS block 677 + Revoke FS block 613 + Revoke FS block 678 + Revoke FS block 614 + Revoke FS block 679 + Revoke FS block 615 + Revoke FS block 616 + Revoke FS block 617 + Revoke FS block 682 + Revoke FS block 618 + Revoke FS block 683 + Revoke FS block 619 + Revoke FS block 684 + Revoke FS block 620 + Revoke FS block 685 + Revoke FS block 621 + Revoke FS block 622 + Revoke FS block 687 + Revoke FS block 623 + Revoke FS block 688 + Revoke FS block 624 + Revoke FS block 689 + Revoke FS block 625 + Revoke FS block 690 + Revoke FS block 626 + Revoke FS block 691 + Revoke FS block 627 + Revoke FS block 628 + Revoke FS block 629 + Revoke FS block 630 + Revoke FS block 631 + Revoke FS block 632 + Revoke FS block 633 + Revoke FS block 634 + Revoke FS block 635 + Revoke FS block 636 + Revoke FS block 637 + Revoke FS block 638 + Revoke FS block 639 +Found expected sequence 5, type 1 (descriptor block) at block 330 +Dumping descriptor block, sequence 5, at block 330: + FS block 98 logged at journal block 331 (flags 0x0) + FS block 99 logged at journal block 332 (flags 0x2) + FS block 354 logged at journal block 333 (flags 0x2) + FS block 1 logged at journal block 334 (flags 0x2) + FS block 105 logged at journal block 335 (flags 0x2) + FS block 2 logged at journal block 336 (flags 0x2) + FS block 82 logged at journal block 337 (flags 0x2) + FS block 104 logged at journal block 338 (flags 0x2) + FS block 66 logged at journal block 339 (flags 0x2) + FS block 83 logged at journal block 340 (flags 0x2) + FS block 355 logged at journal block 341 (flags 0x2) + FS block 112 logged at journal block 342 (flags 0x2) + FS block 113 logged at journal block 343 (flags 0x2) + FS block 102 logged at journal block 344 (flags 0x2) + FS block 103 logged at journal block 345 (flags 0x2) + FS block 107 logged at journal block 346 (flags 0x2) + FS block 108 logged at journal block 347 (flags 0x2) + FS block 101 logged at journal block 348 (flags 0x2) + FS block 100 logged at journal block 349 (flags 0x2) + FS block 110 logged at journal block 350 (flags 0x2) + FS block 109 logged at journal block 351 (flags 0x2) + FS block 111 logged at journal block 352 (flags 0x2) + FS block 106 logged at journal block 353 (flags 0x2) + FS block 68 logged at journal block 354 (flags 0x2) + FS block 356 logged at journal block 355 (flags 0x2) + FS block 119 logged at journal block 356 (flags 0x2) + FS block 118 logged at journal block 357 (flags 0x2) + FS block 126 logged at journal block 358 (flags 0x2) + FS block 125 logged at journal block 359 (flags 0x2) + FS block 116 logged at journal block 360 (flags 0x2) + FS block 115 logged at journal block 361 (flags 0x2) + FS block 117 logged at journal block 362 (flags 0x2) + FS block 121 logged at journal block 363 (flags 0x2) + FS block 120 logged at journal block 364 (flags 0x2) + FS block 114 logged at journal block 365 (flags 0x2) + FS block 124 logged at journal block 366 (flags 0x2) + FS block 123 logged at journal block 367 (flags 0x2) + FS block 122 logged at journal block 368 (flags 0x2) + FS block 357 logged at journal block 369 (flags 0x2) + FS block 132 logged at journal block 370 (flags 0x2) + FS block 133 logged at journal block 371 (flags 0x2) + FS block 358 logged at journal block 372 (flags 0x2) + FS block 140 logged at journal block 373 (flags 0x2) + FS block 139 logged at journal block 374 (flags 0x2) + FS block 130 logged at journal block 375 (flags 0x2) + FS block 129 logged at journal block 376 (flags 0x2) + FS block 131 logged at journal block 377 (flags 0x2) + FS block 135 logged at journal block 378 (flags 0x2) + FS block 134 logged at journal block 379 (flags 0x2) + FS block 128 logged at journal block 380 (flags 0x2) + FS block 137 logged at journal block 381 (flags 0x2) + FS block 138 logged at journal block 382 (flags 0x2) + FS block 136 logged at journal block 383 (flags 0x2) + FS block 127 logged at journal block 384 (flags 0x2) + FS block 359 logged at journal block 385 (flags 0x2) + FS block 146 logged at journal block 386 (flags 0x2) + FS block 145 logged at journal block 387 (flags 0x2) + FS block 154 logged at journal block 388 (flags 0x2) + FS block 153 logged at journal block 389 (flags 0x2) + FS block 144 logged at journal block 390 (flags 0x2) + FS block 143 logged at journal block 391 (flags 0x2) + FS block 149 logged at journal block 392 (flags 0x2) + FS block 148 logged at journal block 393 (flags 0x2) + FS block 142 logged at journal block 394 (flags 0x2) + FS block 151 logged at journal block 395 (flags 0x2) + FS block 150 logged at journal block 396 (flags 0x2) + FS block 152 logged at journal block 397 (flags 0x2) + FS block 141 logged at journal block 398 (flags 0x2) + FS block 147 logged at journal block 399 (flags 0x2) + FS block 360 logged at journal block 400 (flags 0x2) + FS block 160 logged at journal block 401 (flags 0x2) + FS block 159 logged at journal block 402 (flags 0x2) + FS block 361 logged at journal block 403 (flags 0x2) + FS block 167 logged at journal block 404 (flags 0x2) + FS block 168 logged at journal block 405 (flags 0x2) + FS block 157 logged at journal block 406 (flags 0x2) + FS block 158 logged at journal block 407 (flags 0x2) + FS block 162 logged at journal block 408 (flags 0x2) + FS block 163 logged at journal block 409 (flags 0x2) + FS block 156 logged at journal block 410 (flags 0x2) + FS block 155 logged at journal block 411 (flags 0x2) + FS block 165 logged at journal block 412 (flags 0x2) + FS block 164 logged at journal block 413 (flags 0x2) + FS block 166 logged at journal block 414 (flags 0xa) +Found expected sequence 5, type 1 (descriptor block) at block 415 +Dumping descriptor block, sequence 5, at block 415: + FS block 161 logged at journal block 416 (flags 0x0) + FS block 362 logged at journal block 417 (flags 0x2) + FS block 174 logged at journal block 418 (flags 0x2) + FS block 173 logged at journal block 419 (flags 0x2) + FS block 181 logged at journal block 420 (flags 0x2) + FS block 180 logged at journal block 421 (flags 0x2) + FS block 171 logged at journal block 422 (flags 0x2) + FS block 170 logged at journal block 423 (flags 0x2) + FS block 172 logged at journal block 424 (flags 0x2) + FS block 176 logged at journal block 425 (flags 0x2) + FS block 175 logged at journal block 426 (flags 0x2) + FS block 169 logged at journal block 427 (flags 0x2) + FS block 179 logged at journal block 428 (flags 0x2) + FS block 178 logged at journal block 429 (flags 0x2) + FS block 177 logged at journal block 430 (flags 0x2) + FS block 363 logged at journal block 431 (flags 0x2) + FS block 187 logged at journal block 432 (flags 0x2) + FS block 188 logged at journal block 433 (flags 0x2) + FS block 364 logged at journal block 434 (flags 0x2) + FS block 195 logged at journal block 435 (flags 0x2) + FS block 194 logged at journal block 436 (flags 0x2) + FS block 185 logged at journal block 437 (flags 0x2) + FS block 184 logged at journal block 438 (flags 0x2) + FS block 186 logged at journal block 439 (flags 0x2) + FS block 190 logged at journal block 440 (flags 0x2) + FS block 189 logged at journal block 441 (flags 0x2) + FS block 183 logged at journal block 442 (flags 0x2) + FS block 192 logged at journal block 443 (flags 0x2) + FS block 193 logged at journal block 444 (flags 0x2) + FS block 191 logged at journal block 445 (flags 0x2) + FS block 182 logged at journal block 446 (flags 0x2) + FS block 365 logged at journal block 447 (flags 0x2) + FS block 201 logged at journal block 448 (flags 0x2) + FS block 200 logged at journal block 449 (flags 0x2) + FS block 680 logged at journal block 450 (flags 0x2) + FS block 209 logged at journal block 451 (flags 0x2) + FS block 208 logged at journal block 452 (flags 0x2) + FS block 199 logged at journal block 453 (flags 0x2) + FS block 198 logged at journal block 454 (flags 0x2) + FS block 204 logged at journal block 455 (flags 0x2) + FS block 203 logged at journal block 456 (flags 0x2) + FS block 197 logged at journal block 457 (flags 0x2) + FS block 206 logged at journal block 458 (flags 0x2) + FS block 205 logged at journal block 459 (flags 0x2) + FS block 207 logged at journal block 460 (flags 0x2) + FS block 681 logged at journal block 461 (flags 0x2) + FS block 196 logged at journal block 462 (flags 0xa) +Found expected sequence 5, type 2 (commit block) at block 463 +No magic number at block 464: end of journal. diff --git a/tests/f_jnl_32bit/expect.1 b/tests/f_jnl_32bit/expect.1 new file mode 100644 index 0000000..56aab48 --- /dev/null +++ b/tests/f_jnl_32bit/expect.1 @@ -0,0 +1,16 @@ +test_filesys: recovering journal +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 +Free blocks count wrong (14699, counted=14660). +Fix? yes + +Free inodes count wrong (4085, counted=3697). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 399/4096 files (0.0% non-contiguous), 1724/16384 blocks +Exit status is 1 diff --git a/tests/f_jnl_32bit/expect.2 b/tests/f_jnl_32bit/expect.2 new file mode 100644 index 0000000..be948d2 --- /dev/null +++ b/tests/f_jnl_32bit/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: 399/4096 files (0.0% non-contiguous), 1724/16384 blocks +Exit status is 0 diff --git a/tests/f_jnl_32bit/image.gz b/tests/f_jnl_32bit/image.gz Binary files differnew file mode 100644 index 0000000..b308102 --- /dev/null +++ b/tests/f_jnl_32bit/image.gz diff --git a/tests/f_jnl_32bit/name b/tests/f_jnl_32bit/name new file mode 100644 index 0000000..60e9913 --- /dev/null +++ b/tests/f_jnl_32bit/name @@ -0,0 +1 @@ +on-disk 32-bit journal format diff --git a/tests/f_jnl_32bit/script b/tests/f_jnl_32bit/script new file mode 100644 index 0000000..9fb4366 --- /dev/null +++ b/tests/f_jnl_32bit/script @@ -0,0 +1,4 @@ +PREP_CMD='$DEBUGFS -R "logdump -a" $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log' +PASS_ZERO=true + +. $cmd_dir/run_e2fsck diff --git a/tests/f_jnl_64bit/expect.0 b/tests/f_jnl_64bit/expect.0 new file mode 100644 index 0000000..5cef2d8 --- /dev/null +++ b/tests/f_jnl_64bit/expect.0 @@ -0,0 +1,757 @@ +Journal starts at block 67, transaction 32 +Found expected sequence 32, type 5 (revoke table) at block 67 +Dumping revoke block, sequence 32, at block 67: + Revoke FS block 1536 + Revoke FS block 1472 + Revoke FS block 1473 + Revoke FS block 1474 + Revoke FS block 1475 + Revoke FS block 1476 + Revoke FS block 1541 + Revoke FS block 1477 + Revoke FS block 1478 + Revoke FS block 1479 + Revoke FS block 1480 + Revoke FS block 1481 + Revoke FS block 1482 + Revoke FS block 1483 + Revoke FS block 1484 + Revoke FS block 1485 + Revoke FS block 1486 + Revoke FS block 1487 + Revoke FS block 1488 + Revoke FS block 1489 + Revoke FS block 1490 + Revoke FS block 1491 + Revoke FS block 1556 + Revoke FS block 1492 + Revoke FS block 1493 + Revoke FS block 1429 + Revoke FS block 1494 + Revoke FS block 1495 + Revoke FS block 1496 + Revoke FS block 1432 + Revoke FS block 1497 + Revoke FS block 1498 + Revoke FS block 1434 + Revoke FS block 1499 + Revoke FS block 1435 + Revoke FS block 1500 + Revoke FS block 1501 + Revoke FS block 1502 + Revoke FS block 1503 + Revoke FS block 1504 + Revoke FS block 1505 + Revoke FS block 1506 + Revoke FS block 1442 + Revoke FS block 1507 + Revoke FS block 1508 + Revoke FS block 1444 + Revoke FS block 1509 + Revoke FS block 1445 + Revoke FS block 1510 + Revoke FS block 1511 + Revoke FS block 1512 + Revoke FS block 1513 + Revoke FS block 1449 + Revoke FS block 1514 + Revoke FS block 1515 + Revoke FS block 1516 + Revoke FS block 1517 + Revoke FS block 1453 + Revoke FS block 1518 + Revoke FS block 1519 + Revoke FS block 1520 + Revoke FS block 1456 + Revoke FS block 1521 + Revoke FS block 1457 + Revoke FS block 1522 + Revoke FS block 1458 + Revoke FS block 1523 + Revoke FS block 1459 + Revoke FS block 1524 + Revoke FS block 1460 + Revoke FS block 1525 + Revoke FS block 1461 + Revoke FS block 1526 + Revoke FS block 1462 + Revoke FS block 1527 + Revoke FS block 1463 + Revoke FS block 1528 + Revoke FS block 1464 + Revoke FS block 1529 + Revoke FS block 1465 + Revoke FS block 1530 + Revoke FS block 1466 + Revoke FS block 1531 + Revoke FS block 1467 + Revoke FS block 1532 + Revoke FS block 1468 + Revoke FS block 1533 + Revoke FS block 1469 + Revoke FS block 1534 + Revoke FS block 1470 + Revoke FS block 1535 + Revoke FS block 1471 +Found expected sequence 32, type 1 (descriptor block) at block 68 +Dumping descriptor block, sequence 32, at block 68: + FS block 802 logged at journal block 69 (flags 0x0) + FS block 803 logged at journal block 70 (flags 0x2) + FS block 131 logged at journal block 71 (flags 0x2) + FS block 2 logged at journal block 72 (flags 0x2) + FS block 1 logged at journal block 73 (flags 0x2) + FS block 147 logged at journal block 74 (flags 0x2) + FS block 783 logged at journal block 75 (flags 0x2) + FS block 130 logged at journal block 76 (flags 0x2) + FS block 807 logged at journal block 77 (flags 0x2) + FS block 808 logged at journal block 78 (flags 0x2) + FS block 788 logged at journal block 79 (flags 0x2) + FS block 789 logged at journal block 80 (flags 0x2) + FS block 785 logged at journal block 81 (flags 0x2) + FS block 786 logged at journal block 82 (flags 0x2) + FS block 787 logged at journal block 83 (flags 0x2) + FS block 798 logged at journal block 84 (flags 0x2) + FS block 799 logged at journal block 85 (flags 0x2) + FS block 800 logged at journal block 86 (flags 0x2) + FS block 801 logged at journal block 87 (flags 0x2) + FS block 812 logged at journal block 88 (flags 0x2) + FS block 813 logged at journal block 89 (flags 0x2) + FS block 790 logged at journal block 90 (flags 0x2) + FS block 132 logged at journal block 91 (flags 0x2) + FS block 162 logged at journal block 92 (flags 0x2) + FS block 815 logged at journal block 93 (flags 0x2) + FS block 819 logged at journal block 94 (flags 0x2) + FS block 820 logged at journal block 95 (flags 0x2) + FS block 838 logged at journal block 96 (flags 0x2) + FS block 839 logged at journal block 97 (flags 0x2) + FS block 836 logged at journal block 98 (flags 0x2) + FS block 837 logged at journal block 99 (flags 0x2) + FS block 829 logged at journal block 100 (flags 0x2) + FS block 830 logged at journal block 101 (flags 0x2) + FS block 823 logged at journal block 102 (flags 0x2) + FS block 824 logged at journal block 103 (flags 0x2) + FS block 826 logged at journal block 104 (flags 0x2) + FS block 827 logged at journal block 105 (flags 0x2) + FS block 817 logged at journal block 106 (flags 0x2) + FS block 818 logged at journal block 107 (flags 0x2) + FS block 828 logged at journal block 108 (flags 0x2) + FS block 816 logged at journal block 109 (flags 0x2) + FS block 841 logged at journal block 110 (flags 0x2) + FS block 842 logged at journal block 111 (flags 0x2) + FS block 832 logged at journal block 112 (flags 0x2) + FS block 833 logged at journal block 113 (flags 0x2) + FS block 843 logged at journal block 114 (flags 0x2) + FS block 846 logged at journal block 115 (flags 0x2) + FS block 847 logged at journal block 116 (flags 0x2) + FS block 825 logged at journal block 117 (flags 0x2) + FS block 848 logged at journal block 118 (flags 0x2) + FS block 844 logged at journal block 119 (flags 0x2) + FS block 834 logged at journal block 120 (flags 0x2) + FS block 835 logged at journal block 121 (flags 0x2) + FS block 840 logged at journal block 122 (flags 0x2) + FS block 821 logged at journal block 123 (flags 0x2) + FS block 822 logged at journal block 124 (flags 0x2) + FS block 831 logged at journal block 125 (flags 0x2) + FS block 845 logged at journal block 126 (flags 0x2) + FS block 852 logged at journal block 127 (flags 0x2) + FS block 853 logged at journal block 128 (flags 0x2) + FS block 871 logged at journal block 129 (flags 0x2) + FS block 872 logged at journal block 130 (flags 0x2) + FS block 868 logged at journal block 131 (flags 0x2) + FS block 869 logged at journal block 132 (flags 0x2) + FS block 870 logged at journal block 133 (flags 0x2) + FS block 862 logged at journal block 134 (flags 0x2) + FS block 863 logged at journal block 135 (flags 0x2) + FS block 856 logged at journal block 136 (flags 0x2) + FS block 857 logged at journal block 137 (flags 0x2) + FS block 858 logged at journal block 138 (flags 0x2) + FS block 859 logged at journal block 139 (flags 0x2) + FS block 849 logged at journal block 140 (flags 0x2) + FS block 850 logged at journal block 141 (flags 0x2) + FS block 851 logged at journal block 142 (flags 0x2) + FS block 860 logged at journal block 143 (flags 0x2) + FS block 861 logged at journal block 144 (flags 0x2) + FS block 873 logged at journal block 145 (flags 0x2) + FS block 874 logged at journal block 146 (flags 0x2) + FS block 864 logged at journal block 147 (flags 0x2) + FS block 865 logged at journal block 148 (flags 0x2) + FS block 866 logged at journal block 149 (flags 0xa) +Found expected sequence 32, type 1 (descriptor block) at block 150 +Dumping descriptor block, sequence 32, at block 150: + FS block 875 logged at journal block 151 (flags 0x0) + FS block 876 logged at journal block 152 (flags 0x2) + FS block 878 logged at journal block 153 (flags 0x2) + FS block 879 logged at journal block 154 (flags 0x2) + FS block 880 logged at journal block 155 (flags 0x2) + FS block 881 logged at journal block 156 (flags 0x2) + FS block 877 logged at journal block 157 (flags 0x2) + FS block 867 logged at journal block 158 (flags 0x2) + FS block 854 logged at journal block 159 (flags 0x2) + FS block 855 logged at journal block 160 (flags 0x2) + FS block 885 logged at journal block 161 (flags 0x2) + FS block 886 logged at journal block 162 (flags 0x2) + FS block 903 logged at journal block 163 (flags 0x2) + FS block 904 logged at journal block 164 (flags 0x2) + FS block 901 logged at journal block 165 (flags 0x2) + FS block 902 logged at journal block 166 (flags 0x2) + FS block 895 logged at journal block 167 (flags 0x2) + FS block 896 logged at journal block 168 (flags 0x2) + FS block 888 logged at journal block 169 (flags 0x2) + FS block 889 logged at journal block 170 (flags 0x2) + FS block 891 logged at journal block 171 (flags 0x2) + FS block 892 logged at journal block 172 (flags 0x2) + FS block 882 logged at journal block 173 (flags 0x2) + FS block 883 logged at journal block 174 (flags 0x2) + FS block 893 logged at journal block 175 (flags 0x2) + FS block 906 logged at journal block 176 (flags 0x2) + FS block 907 logged at journal block 177 (flags 0x2) + FS block 897 logged at journal block 178 (flags 0x2) + FS block 898 logged at journal block 179 (flags 0x2) + FS block 908 logged at journal block 180 (flags 0x2) + FS block 911 logged at journal block 181 (flags 0x2) + FS block 912 logged at journal block 182 (flags 0x2) + FS block 890 logged at journal block 183 (flags 0x2) + FS block 913 logged at journal block 184 (flags 0x2) + FS block 894 logged at journal block 185 (flags 0x2) + FS block 909 logged at journal block 186 (flags 0x2) + FS block 900 logged at journal block 187 (flags 0x2) + FS block 905 logged at journal block 188 (flags 0x2) + FS block 887 logged at journal block 189 (flags 0x2) + FS block 884 logged at journal block 190 (flags 0x2) + FS block 899 logged at journal block 191 (flags 0x2) + FS block 910 logged at journal block 192 (flags 0x2) + FS block 917 logged at journal block 193 (flags 0x2) + FS block 918 logged at journal block 194 (flags 0x2) + FS block 1537 logged at journal block 195 (flags 0x2) + FS block 936 logged at journal block 196 (flags 0x2) + FS block 937 logged at journal block 197 (flags 0x2) + FS block 933 logged at journal block 198 (flags 0x2) + FS block 1554 logged at journal block 199 (flags 0x2) + FS block 934 logged at journal block 200 (flags 0xa) +Found expected sequence 32, type 2 (commit block) at block 201 +Found expected sequence 33, type 5 (revoke table) at block 202 +Dumping revoke block, sequence 33, at block 202: + Revoke FS block 1600 + Revoke FS block 1601 + Revoke FS block 1537 + Revoke FS block 1602 + Revoke FS block 1538 + Revoke FS block 1603 + Revoke FS block 1539 + Revoke FS block 1604 + Revoke FS block 1540 + Revoke FS block 1605 + Revoke FS block 1606 + Revoke FS block 1542 + Revoke FS block 1607 + Revoke FS block 1543 + Revoke FS block 1608 + Revoke FS block 1544 + Revoke FS block 1609 + Revoke FS block 1545 + Revoke FS block 1610 + Revoke FS block 1546 + Revoke FS block 1611 + Revoke FS block 1547 + Revoke FS block 1612 + Revoke FS block 1548 + Revoke FS block 1613 + Revoke FS block 1549 + Revoke FS block 1614 + Revoke FS block 1550 + Revoke FS block 1615 + Revoke FS block 1551 + Revoke FS block 1616 + Revoke FS block 1552 + Revoke FS block 1617 + Revoke FS block 1553 + Revoke FS block 1554 + Revoke FS block 1555 + Revoke FS block 1557 + Revoke FS block 1558 + Revoke FS block 1559 + Revoke FS block 1560 + Revoke FS block 1561 + Revoke FS block 1562 + Revoke FS block 1563 + Revoke FS block 1564 + Revoke FS block 1565 + Revoke FS block 1566 + Revoke FS block 1567 + Revoke FS block 1568 + Revoke FS block 1569 + Revoke FS block 1570 + Revoke FS block 1571 + Revoke FS block 1572 + Revoke FS block 1573 + Revoke FS block 1574 + Revoke FS block 1575 + Revoke FS block 1576 + Revoke FS block 1577 + Revoke FS block 1578 + Revoke FS block 1579 + Revoke FS block 1580 + Revoke FS block 1581 + Revoke FS block 1582 + Revoke FS block 1583 + Revoke FS block 1584 + Revoke FS block 1585 + Revoke FS block 1586 + Revoke FS block 1587 + Revoke FS block 1588 + Revoke FS block 1589 + Revoke FS block 1590 + Revoke FS block 1591 + Revoke FS block 1592 + Revoke FS block 1593 + Revoke FS block 1594 + Revoke FS block 1595 + Revoke FS block 1596 + Revoke FS block 1597 + Revoke FS block 1598 + Revoke FS block 1599 +Found expected sequence 33, type 1 (descriptor block) at block 203 +Dumping descriptor block, sequence 33, at block 203: + FS block 933 logged at journal block 204 (flags 0x0) + FS block 1 logged at journal block 205 (flags 0x2) + FS block 935 logged at journal block 206 (flags 0x2) + FS block 131 logged at journal block 207 (flags 0x2) + FS block 2 logged at journal block 208 (flags 0x2) + FS block 147 logged at journal block 209 (flags 0x2) + FS block 934 logged at journal block 210 (flags 0x2) + FS block 913 logged at journal block 211 (flags 0x2) + FS block 130 logged at journal block 212 (flags 0x2) + FS block 936 logged at journal block 213 (flags 0x2) + FS block 927 logged at journal block 214 (flags 0x2) + FS block 928 logged at journal block 215 (flags 0x2) + FS block 921 logged at journal block 216 (flags 0x2) + FS block 922 logged at journal block 217 (flags 0x2) + FS block 923 logged at journal block 218 (flags 0x2) + FS block 924 logged at journal block 219 (flags 0x2) + FS block 925 logged at journal block 220 (flags 0x2) + FS block 915 logged at journal block 221 (flags 0x2) + FS block 916 logged at journal block 222 (flags 0x2) + FS block 926 logged at journal block 223 (flags 0x2) + FS block 914 logged at journal block 224 (flags 0x2) + FS block 938 logged at journal block 225 (flags 0x2) + FS block 939 logged at journal block 226 (flags 0x2) + FS block 940 logged at journal block 227 (flags 0x2) + FS block 930 logged at journal block 228 (flags 0x2) + FS block 931 logged at journal block 229 (flags 0x2) + FS block 941 logged at journal block 230 (flags 0x2) + FS block 943 logged at journal block 231 (flags 0x2) + FS block 944 logged at journal block 232 (flags 0x2) + FS block 945 logged at journal block 233 (flags 0x2) + FS block 946 logged at journal block 234 (flags 0x2) + FS block 942 logged at journal block 235 (flags 0x2) + FS block 932 logged at journal block 236 (flags 0x2) + FS block 937 logged at journal block 237 (flags 0x2) + FS block 918 logged at journal block 238 (flags 0x2) + FS block 919 logged at journal block 239 (flags 0x2) + FS block 920 logged at journal block 240 (flags 0x2) + FS block 917 logged at journal block 241 (flags 0x2) + FS block 929 logged at journal block 242 (flags 0x2) + FS block 132 logged at journal block 243 (flags 0x2) + FS block 162 logged at journal block 244 (flags 0x2) + FS block 950 logged at journal block 245 (flags 0x2) + FS block 951 logged at journal block 246 (flags 0x2) + FS block 969 logged at journal block 247 (flags 0x2) + FS block 970 logged at journal block 248 (flags 0x2) + FS block 966 logged at journal block 249 (flags 0x2) + FS block 967 logged at journal block 250 (flags 0x2) + FS block 968 logged at journal block 251 (flags 0x2) + FS block 960 logged at journal block 252 (flags 0x2) + FS block 961 logged at journal block 253 (flags 0x2) + FS block 954 logged at journal block 254 (flags 0x2) + FS block 955 logged at journal block 255 (flags 0x2) + FS block 956 logged at journal block 256 (flags 0x2) + FS block 957 logged at journal block 257 (flags 0x2) + FS block 947 logged at journal block 258 (flags 0x2) + FS block 948 logged at journal block 259 (flags 0x2) + FS block 958 logged at journal block 260 (flags 0x2) + FS block 971 logged at journal block 261 (flags 0x2) + FS block 972 logged at journal block 262 (flags 0x2) + FS block 962 logged at journal block 263 (flags 0x2) + FS block 963 logged at journal block 264 (flags 0x2) + FS block 973 logged at journal block 265 (flags 0x2) + FS block 976 logged at journal block 266 (flags 0x2) + FS block 977 logged at journal block 267 (flags 0x2) + FS block 978 logged at journal block 268 (flags 0x2) + FS block 959 logged at journal block 269 (flags 0x2) + FS block 974 logged at journal block 270 (flags 0x2) + FS block 975 logged at journal block 271 (flags 0x2) + FS block 965 logged at journal block 272 (flags 0x2) + FS block 952 logged at journal block 273 (flags 0x2) + FS block 949 logged at journal block 274 (flags 0x2) + FS block 964 logged at journal block 275 (flags 0x2) + FS block 953 logged at journal block 276 (flags 0x2) + FS block 979 logged at journal block 277 (flags 0x2) + FS block 982 logged at journal block 278 (flags 0x2) + FS block 983 logged at journal block 279 (flags 0x2) + FS block 984 logged at journal block 280 (flags 0x2) + FS block 1001 logged at journal block 281 (flags 0x2) + FS block 1002 logged at journal block 282 (flags 0x2) + FS block 999 logged at journal block 283 (flags 0x2) + FS block 1000 logged at journal block 284 (flags 0xa) +Found expected sequence 33, type 1 (descriptor block) at block 285 +Dumping descriptor block, sequence 33, at block 285: + FS block 992 logged at journal block 286 (flags 0x0) + FS block 993 logged at journal block 287 (flags 0x2) + FS block 994 logged at journal block 288 (flags 0x2) + FS block 986 logged at journal block 289 (flags 0x2) + FS block 987 logged at journal block 290 (flags 0x2) + FS block 989 logged at journal block 291 (flags 0x2) + FS block 990 logged at journal block 292 (flags 0x2) + FS block 980 logged at journal block 293 (flags 0x2) + FS block 981 logged at journal block 294 (flags 0x2) + FS block 991 logged at journal block 295 (flags 0x2) + FS block 1004 logged at journal block 296 (flags 0x2) + FS block 1005 logged at journal block 297 (flags 0x2) + FS block 995 logged at journal block 298 (flags 0x2) + FS block 996 logged at journal block 299 (flags 0x2) + FS block 1006 logged at journal block 300 (flags 0x2) + FS block 1009 logged at journal block 301 (flags 0x2) + FS block 1010 logged at journal block 302 (flags 0x2) + FS block 988 logged at journal block 303 (flags 0x2) + FS block 1011 logged at journal block 304 (flags 0x2) + FS block 1007 logged at journal block 305 (flags 0x2) + FS block 997 logged at journal block 306 (flags 0x2) + FS block 998 logged at journal block 307 (flags 0x2) + FS block 1003 logged at journal block 308 (flags 0x2) + FS block 985 logged at journal block 309 (flags 0x2) + FS block 1008 logged at journal block 310 (flags 0x2) + FS block 146 logged at journal block 311 (flags 0x2) + FS block 163 logged at journal block 312 (flags 0x2) + FS block 145 logged at journal block 313 (flags 0x2) + FS block 148 logged at journal block 314 (flags 0x2) + FS block 164 logged at journal block 315 (flags 0x2) + FS block 161 logged at journal block 316 (flags 0x2) + FS block 165 logged at journal block 317 (flags 0x2) + FS block 674 logged at journal block 318 (flags 0x2) + FS block 1541 logged at journal block 319 (flags 0x2) + FS block 166 logged at journal block 320 (flags 0x2) + FS block 167 logged at journal block 321 (flags 0x2) + FS block 1556 logged at journal block 322 (flags 0x2) + FS block 168 logged at journal block 323 (flags 0x2) + FS block 1618 logged at journal block 324 (flags 0x2) + FS block 169 logged at journal block 325 (flags 0x2) + FS block 1187 logged at journal block 326 (flags 0x2) + FS block 170 logged at journal block 327 (flags 0x2) + FS block 1188 logged at journal block 328 (flags 0x2) + FS block 171 logged at journal block 329 (flags 0x2) + FS block 1619 logged at journal block 330 (flags 0x2) + FS block 172 logged at journal block 331 (flags 0x2) + FS block 1620 logged at journal block 332 (flags 0x2) + FS block 173 logged at journal block 333 (flags 0x2) + FS block 149 logged at journal block 334 (flags 0x2) + FS block 174 logged at journal block 335 (flags 0x2) + FS block 675 logged at journal block 336 (flags 0x2) + FS block 150 logged at journal block 337 (flags 0x2) + FS block 175 logged at journal block 338 (flags 0x2) + FS block 176 logged at journal block 339 (flags 0x2) + FS block 151 logged at journal block 340 (flags 0x2) + FS block 177 logged at journal block 341 (flags 0x2) + FS block 152 logged at journal block 342 (flags 0x2) + FS block 178 logged at journal block 343 (flags 0x2) + FS block 1189 logged at journal block 344 (flags 0x2) + FS block 179 logged at journal block 345 (flags 0x2) + FS block 1190 logged at journal block 346 (flags 0x2) + FS block 180 logged at journal block 347 (flags 0x2) + FS block 1191 logged at journal block 348 (flags 0x2) + FS block 181 logged at journal block 349 (flags 0x2) + FS block 1192 logged at journal block 350 (flags 0x2) + FS block 182 logged at journal block 351 (flags 0x2) + FS block 1621 logged at journal block 352 (flags 0x2) + FS block 183 logged at journal block 353 (flags 0x2) + FS block 676 logged at journal block 354 (flags 0x2) + FS block 1622 logged at journal block 355 (flags 0x2) + FS block 184 logged at journal block 356 (flags 0x2) + FS block 185 logged at journal block 357 (flags 0x2) + FS block 1623 logged at journal block 358 (flags 0x2) + FS block 186 logged at journal block 359 (flags 0x2) + FS block 1624 logged at journal block 360 (flags 0x2) + FS block 187 logged at journal block 361 (flags 0x2) + FS block 153 logged at journal block 362 (flags 0x2) + FS block 188 logged at journal block 363 (flags 0x2) + FS block 154 logged at journal block 364 (flags 0x2) + FS block 189 logged at journal block 365 (flags 0x2) + FS block 155 logged at journal block 366 (flags 0xa) +Found expected sequence 33, type 1 (descriptor block) at block 367 +Dumping descriptor block, sequence 33, at block 367: + FS block 190 logged at journal block 368 (flags 0x0) + FS block 156 logged at journal block 369 (flags 0x2) + FS block 191 logged at journal block 370 (flags 0x2) + FS block 157 logged at journal block 371 (flags 0x2) + FS block 192 logged at journal block 372 (flags 0x2) + FS block 677 logged at journal block 373 (flags 0x2) + FS block 158 logged at journal block 374 (flags 0x2) + FS block 159 logged at journal block 375 (flags 0x2) + FS block 193 logged at journal block 376 (flags 0x2) + FS block 194 logged at journal block 377 (flags 0x2) + FS block 160 logged at journal block 378 (flags 0x2) + FS block 195 logged at journal block 379 (flags 0x2) + FS block 1193 logged at journal block 380 (flags 0x2) + FS block 196 logged at journal block 381 (flags 0x2) + FS block 1194 logged at journal block 382 (flags 0x2) + FS block 197 logged at journal block 383 (flags 0x2) + FS block 1195 logged at journal block 384 (flags 0x2) + FS block 198 logged at journal block 385 (flags 0x2) + FS block 1196 logged at journal block 386 (flags 0x2) + FS block 199 logged at journal block 387 (flags 0x2) + FS block 1197 logged at journal block 388 (flags 0x2) + FS block 200 logged at journal block 389 (flags 0x2) + FS block 678 logged at journal block 390 (flags 0x2) + FS block 1198 logged at journal block 391 (flags 0x2) + FS block 201 logged at journal block 392 (flags 0x2) + FS block 1199 logged at journal block 393 (flags 0x2) + FS block 202 logged at journal block 394 (flags 0x2) + FS block 203 logged at journal block 395 (flags 0x2) + FS block 1200 logged at journal block 396 (flags 0x2) + FS block 204 logged at journal block 397 (flags 0x2) + FS block 1625 logged at journal block 398 (flags 0x2) + FS block 205 logged at journal block 399 (flags 0x2) + FS block 1626 logged at journal block 400 (flags 0x2) + FS block 206 logged at journal block 401 (flags 0x2) + FS block 1627 logged at journal block 402 (flags 0x2) + FS block 207 logged at journal block 403 (flags 0x2) + FS block 1628 logged at journal block 404 (flags 0x2) + FS block 208 logged at journal block 405 (flags 0x2) + FS block 1629 logged at journal block 406 (flags 0x2) + FS block 209 logged at journal block 407 (flags 0x2) + FS block 679 logged at journal block 408 (flags 0x2) + FS block 1630 logged at journal block 409 (flags 0x2) + FS block 210 logged at journal block 410 (flags 0x2) + FS block 1631 logged at journal block 411 (flags 0x2) + FS block 211 logged at journal block 412 (flags 0x2) + FS block 212 logged at journal block 413 (flags 0x2) + FS block 1632 logged at journal block 414 (flags 0x2) + FS block 213 logged at journal block 415 (flags 0x2) + FS block 1201 logged at journal block 416 (flags 0x2) + FS block 214 logged at journal block 417 (flags 0x2) + FS block 1202 logged at journal block 418 (flags 0x2) + FS block 215 logged at journal block 419 (flags 0x2) + FS block 1203 logged at journal block 420 (flags 0xa) +Found expected sequence 33, type 2 (commit block) at block 421 +Found expected sequence 34, type 1 (descriptor block) at block 422 +Dumping descriptor block, sequence 34, at block 422: + FS block 146 logged at journal block 423 (flags 0x0) + FS block 2 logged at journal block 424 (flags 0x2) + FS block 215 logged at journal block 425 (flags 0x2) + FS block 679 logged at journal block 426 (flags 0x2) + FS block 1203 logged at journal block 427 (flags 0x2) + FS block 131 logged at journal block 428 (flags 0x2) + FS block 216 logged at journal block 429 (flags 0x2) + FS block 147 logged at journal block 430 (flags 0x2) + FS block 130 logged at journal block 431 (flags 0x2) + FS block 1204 logged at journal block 432 (flags 0x2) + FS block 677 logged at journal block 433 (flags 0x2) + FS block 158 logged at journal block 434 (flags 0x2) + FS block 217 logged at journal block 435 (flags 0x2) + FS block 1542 logged at journal block 436 (flags 0x2) + FS block 218 logged at journal block 437 (flags 0x2) + FS block 680 logged at journal block 438 (flags 0x2) + FS block 1555 logged at journal block 439 (flags 0x2) + FS block 219 logged at journal block 440 (flags 0x2) + FS block 1543 logged at journal block 441 (flags 0x2) + FS block 220 logged at journal block 442 (flags 0x2) + FS block 221 logged at journal block 443 (flags 0x2) + FS block 1544 logged at journal block 444 (flags 0x2) + FS block 222 logged at journal block 445 (flags 0x2) + FS block 1553 logged at journal block 446 (flags 0x2) + FS block 162 logged at journal block 447 (flags 0x2) + FS block 132 logged at journal block 448 (flags 0x2) + FS block 1554 logged at journal block 449 (flags 0x2) + FS block 223 logged at journal block 450 (flags 0x2) + FS block 1617 logged at journal block 451 (flags 0x2) + FS block 224 logged at journal block 452 (flags 0x2) + FS block 1205 logged at journal block 453 (flags 0x2) + FS block 225 logged at journal block 454 (flags 0x2) + FS block 1206 logged at journal block 455 (flags 0x2) + FS block 226 logged at journal block 456 (flags 0x2) + FS block 681 logged at journal block 457 (flags 0x2) + FS block 1207 logged at journal block 458 (flags 0x2) + FS block 227 logged at journal block 459 (flags 0x2) + FS block 1208 logged at journal block 460 (flags 0x2) + FS block 228 logged at journal block 461 (flags 0x2) + FS block 1537 logged at journal block 462 (flags 0x2) + FS block 229 logged at journal block 463 (flags 0x2) + FS block 230 logged at journal block 464 (flags 0x2) + FS block 1538 logged at journal block 465 (flags 0x2) + FS block 231 logged at journal block 466 (flags 0x2) + FS block 1539 logged at journal block 467 (flags 0x2) + FS block 232 logged at journal block 468 (flags 0x2) + FS block 1540 logged at journal block 469 (flags 0x2) + FS block 233 logged at journal block 470 (flags 0x2) + FS block 1557 logged at journal block 471 (flags 0x2) + FS block 234 logged at journal block 472 (flags 0x2) + FS block 1558 logged at journal block 473 (flags 0x2) + FS block 235 logged at journal block 474 (flags 0x2) + FS block 682 logged at journal block 475 (flags 0x2) + FS block 1559 logged at journal block 476 (flags 0x2) + FS block 236 logged at journal block 477 (flags 0x2) + FS block 1560 logged at journal block 478 (flags 0x2) + FS block 237 logged at journal block 479 (flags 0x2) + FS block 1209 logged at journal block 480 (flags 0x2) + FS block 238 logged at journal block 481 (flags 0x2) + FS block 239 logged at journal block 482 (flags 0x2) + FS block 1210 logged at journal block 483 (flags 0x2) + FS block 240 logged at journal block 484 (flags 0x2) + FS block 1211 logged at journal block 485 (flags 0x2) + FS block 241 logged at journal block 486 (flags 0x2) + FS block 1212 logged at journal block 487 (flags 0x2) + FS block 242 logged at journal block 488 (flags 0x2) + FS block 1213 logged at journal block 489 (flags 0x2) + FS block 243 logged at journal block 490 (flags 0x2) + FS block 1214 logged at journal block 491 (flags 0x2) + FS block 244 logged at journal block 492 (flags 0x2) + FS block 683 logged at journal block 493 (flags 0x2) + FS block 1215 logged at journal block 494 (flags 0x2) + FS block 245 logged at journal block 495 (flags 0x2) + FS block 1216 logged at journal block 496 (flags 0x2) + FS block 246 logged at journal block 497 (flags 0x2) + FS block 1545 logged at journal block 498 (flags 0x2) + FS block 247 logged at journal block 499 (flags 0x2) + FS block 248 logged at journal block 500 (flags 0x2) + FS block 1546 logged at journal block 501 (flags 0x2) + FS block 249 logged at journal block 502 (flags 0x2) + FS block 1547 logged at journal block 503 (flags 0xa) +Found expected sequence 34, type 1 (descriptor block) at block 504 +Dumping descriptor block, sequence 34, at block 504: + FS block 250 logged at journal block 505 (flags 0x0) + FS block 1548 logged at journal block 506 (flags 0x2) + FS block 251 logged at journal block 507 (flags 0x2) + FS block 1549 logged at journal block 508 (flags 0x2) + FS block 1550 logged at journal block 509 (flags 0x2) + FS block 252 logged at journal block 510 (flags 0x2) + FS block 684 logged at journal block 511 (flags 0x2) + FS block 1551 logged at journal block 512 (flags 0x2) + FS block 253 logged at journal block 513 (flags 0x2) + FS block 1552 logged at journal block 514 (flags 0x2) + FS block 254 logged at journal block 515 (flags 0x2) + FS block 1561 logged at journal block 516 (flags 0x2) + FS block 255 logged at journal block 517 (flags 0x2) + FS block 1562 logged at journal block 518 (flags 0x2) + FS block 256 logged at journal block 519 (flags 0x2) + FS block 257 logged at journal block 520 (flags 0x2) + FS block 1563 logged at journal block 521 (flags 0x2) + FS block 258 logged at journal block 522 (flags 0x2) + FS block 1564 logged at journal block 523 (flags 0x2) + FS block 259 logged at journal block 524 (flags 0x2) + FS block 1565 logged at journal block 525 (flags 0x2) + FS block 260 logged at journal block 526 (flags 0x2) + FS block 1566 logged at journal block 527 (flags 0x2) + FS block 261 logged at journal block 528 (flags 0x2) + FS block 685 logged at journal block 529 (flags 0x2) + FS block 1567 logged at journal block 530 (flags 0x2) + FS block 262 logged at journal block 531 (flags 0x2) + FS block 1568 logged at journal block 532 (flags 0x2) + FS block 263 logged at journal block 533 (flags 0x2) + FS block 1601 logged at journal block 534 (flags 0x2) + FS block 264 logged at journal block 535 (flags 0x2) + FS block 1602 logged at journal block 536 (flags 0x2) + FS block 265 logged at journal block 537 (flags 0x2) + FS block 266 logged at journal block 538 (flags 0x2) + FS block 1603 logged at journal block 539 (flags 0x2) + FS block 267 logged at journal block 540 (flags 0x2) + FS block 1604 logged at journal block 541 (flags 0x2) + FS block 268 logged at journal block 542 (flags 0x2) + FS block 1605 logged at journal block 543 (flags 0x2) + FS block 269 logged at journal block 544 (flags 0x2) + FS block 1606 logged at journal block 545 (flags 0x2) + FS block 270 logged at journal block 546 (flags 0x2) + FS block 686 logged at journal block 547 (flags 0x2) + FS block 1607 logged at journal block 548 (flags 0x2) + FS block 271 logged at journal block 549 (flags 0x2) + FS block 1608 logged at journal block 550 (flags 0x2) + FS block 272 logged at journal block 551 (flags 0x2) + FS block 1609 logged at journal block 552 (flags 0x2) + FS block 273 logged at journal block 553 (flags 0x2) + FS block 1610 logged at journal block 554 (flags 0x2) + FS block 274 logged at journal block 555 (flags 0x2) + FS block 275 logged at journal block 556 (flags 0x2) + FS block 1611 logged at journal block 557 (flags 0x2) + FS block 276 logged at journal block 558 (flags 0x2) + FS block 1612 logged at journal block 559 (flags 0x2) + FS block 277 logged at journal block 560 (flags 0x2) + FS block 1613 logged at journal block 561 (flags 0x2) + FS block 278 logged at journal block 562 (flags 0x2) + FS block 1614 logged at journal block 563 (flags 0x2) + FS block 279 logged at journal block 564 (flags 0x2) + FS block 687 logged at journal block 565 (flags 0x2) + FS block 1615 logged at journal block 566 (flags 0x2) + FS block 280 logged at journal block 567 (flags 0x2) + FS block 1616 logged at journal block 568 (flags 0x2) + FS block 1569 logged at journal block 569 (flags 0x2) + FS block 281 logged at journal block 570 (flags 0x2) + FS block 1570 logged at journal block 571 (flags 0x2) + FS block 282 logged at journal block 572 (flags 0x2) + FS block 1571 logged at journal block 573 (flags 0x2) + FS block 283 logged at journal block 574 (flags 0x2) + FS block 284 logged at journal block 575 (flags 0x2) + FS block 1572 logged at journal block 576 (flags 0x2) + FS block 285 logged at journal block 577 (flags 0x2) + FS block 1573 logged at journal block 578 (flags 0x2) + FS block 286 logged at journal block 579 (flags 0x2) + FS block 1574 logged at journal block 580 (flags 0x2) + FS block 287 logged at journal block 581 (flags 0x2) + FS block 688 logged at journal block 582 (flags 0x2) + FS block 1575 logged at journal block 583 (flags 0x2) + FS block 288 logged at journal block 584 (flags 0x2) + FS block 1576 logged at journal block 585 (flags 0xa) +Found expected sequence 34, type 1 (descriptor block) at block 586 +Dumping descriptor block, sequence 34, at block 586: + FS block 289 logged at journal block 587 (flags 0x0) + FS block 1577 logged at journal block 588 (flags 0x2) + FS block 290 logged at journal block 589 (flags 0x2) + FS block 1578 logged at journal block 590 (flags 0x2) + FS block 291 logged at journal block 591 (flags 0x2) + FS block 1579 logged at journal block 592 (flags 0x2) + FS block 292 logged at journal block 593 (flags 0x2) + FS block 293 logged at journal block 594 (flags 0x2) + FS block 1580 logged at journal block 595 (flags 0x2) + FS block 294 logged at journal block 596 (flags 0x2) + FS block 1581 logged at journal block 597 (flags 0x2) + FS block 295 logged at journal block 598 (flags 0x2) + FS block 1582 logged at journal block 599 (flags 0x2) + FS block 296 logged at journal block 600 (flags 0x2) + FS block 689 logged at journal block 601 (flags 0x2) + FS block 1583 logged at journal block 602 (flags 0x2) + FS block 297 logged at journal block 603 (flags 0x2) + FS block 1584 logged at journal block 604 (flags 0x2) + FS block 298 logged at journal block 605 (flags 0x2) + FS block 1585 logged at journal block 606 (flags 0x2) + FS block 299 logged at journal block 607 (flags 0x2) + FS block 1586 logged at journal block 608 (flags 0x2) + FS block 300 logged at journal block 609 (flags 0x2) + FS block 1587 logged at journal block 610 (flags 0x2) + FS block 301 logged at journal block 611 (flags 0x2) + FS block 302 logged at journal block 612 (flags 0x2) + FS block 1588 logged at journal block 613 (flags 0x2) + FS block 303 logged at journal block 614 (flags 0x2) + FS block 1589 logged at journal block 615 (flags 0x2) + FS block 304 logged at journal block 616 (flags 0x2) + FS block 1590 logged at journal block 617 (flags 0x2) + FS block 305 logged at journal block 618 (flags 0x2) + FS block 690 logged at journal block 619 (flags 0x2) + FS block 1591 logged at journal block 620 (flags 0x2) + FS block 306 logged at journal block 621 (flags 0x2) + FS block 1592 logged at journal block 622 (flags 0x2) + FS block 307 logged at journal block 623 (flags 0x2) + FS block 1593 logged at journal block 624 (flags 0x2) + FS block 308 logged at journal block 625 (flags 0x2) + FS block 1594 logged at journal block 626 (flags 0x2) + FS block 309 logged at journal block 627 (flags 0x2) + FS block 1595 logged at journal block 628 (flags 0x2) + FS block 1596 logged at journal block 629 (flags 0x2) + FS block 310 logged at journal block 630 (flags 0x2) + FS block 311 logged at journal block 631 (flags 0x2) + FS block 1597 logged at journal block 632 (flags 0x2) + FS block 312 logged at journal block 633 (flags 0x2) + FS block 1598 logged at journal block 634 (flags 0x2) + FS block 313 logged at journal block 635 (flags 0x2) + FS block 691 logged at journal block 636 (flags 0x2) + FS block 1599 logged at journal block 637 (flags 0x2) + FS block 314 logged at journal block 638 (flags 0x2) + FS block 1600 logged at journal block 639 (flags 0xa) +Found expected sequence 34, type 2 (commit block) at block 640 +No magic number at block 641: end of journal. diff --git a/tests/f_jnl_64bit/expect.1 b/tests/f_jnl_64bit/expect.1 new file mode 100644 index 0000000..e360e2f --- /dev/null +++ b/tests/f_jnl_64bit/expect.1 @@ -0,0 +1,16 @@ +test_filesys: recovering journal +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 +Free blocks count wrong (14059, counted=12712). +Fix? yes + +Free inodes count wrong (8181, counted=6834). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 1358/8192 files (0.0% non-contiguous), 3672/16384 blocks +Exit status is 1 diff --git a/tests/f_jnl_64bit/expect.2 b/tests/f_jnl_64bit/expect.2 new file mode 100644 index 0000000..93cb730 --- /dev/null +++ b/tests/f_jnl_64bit/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: 1358/8192 files (0.0% non-contiguous), 3672/16384 blocks +Exit status is 0 diff --git a/tests/f_jnl_64bit/image.gz b/tests/f_jnl_64bit/image.gz Binary files differnew file mode 100644 index 0000000..9758f90 --- /dev/null +++ b/tests/f_jnl_64bit/image.gz diff --git a/tests/f_jnl_64bit/name b/tests/f_jnl_64bit/name new file mode 100644 index 0000000..2c8dd15 --- /dev/null +++ b/tests/f_jnl_64bit/name @@ -0,0 +1 @@ +on-disk 64-bit journal format diff --git a/tests/f_jnl_64bit/script b/tests/f_jnl_64bit/script new file mode 100644 index 0000000..9fb4366 --- /dev/null +++ b/tests/f_jnl_64bit/script @@ -0,0 +1,4 @@ +PREP_CMD='$DEBUGFS -R "logdump -a" $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log' +PASS_ZERO=true + +. $cmd_dir/run_e2fsck diff --git a/tests/f_jnl_errno/expect.0 b/tests/f_jnl_errno/expect.0 new file mode 100644 index 0000000..96fb01a --- /dev/null +++ b/tests/f_jnl_errno/expect.0 @@ -0,0 +1,50 @@ +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +Default mount options: user_xattr acl +Filesystem state: clean +Errors behavior: Remount read-only +Filesystem OS type: Linux +Inode count: 2048 +Block count: 8192 +Reserved block count: 409 +Free blocks: 6862 +Free inodes: 2037 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 31 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 256 +Flex block group size: 16 +Mount count: 0 +Check interval: 0 (<none>) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 128 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 1024k +Total journal blocks: 1024 +Max transaction length: 1024 +Fast commit length: 0 +Journal sequence: 0x00000005 +Journal start: 0 + + +Group 0: (Blocks 1-8191) [ITABLE_ZEROED] + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-33 + Block bitmap at 34 (+33) + Inode bitmap at 50 (+49) + Inode table at 66-321 (+65) + 6862 free blocks, 2037 free inodes, 2 directories, 2037 unused inodes + Free blocks: 1330-8191 + Free inodes: 12-2048 diff --git a/tests/f_jnl_errno/expect.1 b/tests/f_jnl_errno/expect.1 new file mode 100644 index 0000000..4134234 --- /dev/null +++ b/tests/f_jnl_errno/expect.1 @@ -0,0 +1,9 @@ +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/2048 files (9.1% non-contiguous), 1330/8192 blocks +Exit status is 0 diff --git a/tests/f_jnl_errno/expect.2 b/tests/f_jnl_errno/expect.2 new file mode 100644 index 0000000..db16a75 --- /dev/null +++ b/tests/f_jnl_errno/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: 11/2048 files (9.1% non-contiguous), 1330/8192 blocks +Exit status is 0 diff --git a/tests/f_jnl_errno/image.gz b/tests/f_jnl_errno/image.gz Binary files differnew file mode 100644 index 0000000..c55c775 --- /dev/null +++ b/tests/f_jnl_errno/image.gz diff --git a/tests/f_jnl_errno/name b/tests/f_jnl_errno/name new file mode 100644 index 0000000..e5f64d6 --- /dev/null +++ b/tests/f_jnl_errno/name @@ -0,0 +1 @@ +journal s_errno handling diff --git a/tests/f_jnl_errno/script b/tests/f_jnl_errno/script new file mode 100644 index 0000000..ef5006a --- /dev/null +++ b/tests/f_jnl_errno/script @@ -0,0 +1,4 @@ +AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log' +PASS_ZERO=true + +. $cmd_dir/run_e2fsck diff --git a/tests/f_jnl_etb_alloc_fail/expect.1 b/tests/f_jnl_etb_alloc_fail/expect.1 new file mode 100644 index 0000000..243a151 --- /dev/null +++ b/tests/f_jnl_etb_alloc_fail/expect.1 @@ -0,0 +1,31 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Superblock has_journal flag is clear, but a journal is present. +Clear? yes + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(32--33) -(35--49) -(83--511) -(513--1087) -1089 +Fix? yes + +Free blocks count wrong for group #0 (0, counted=1022). +Fix? yes + +Free blocks count wrong (0, counted=1022). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Could not allocate block in ext2 filesystem: while trying to create journal + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 2048/2048 blocks +Exit status is 1 diff --git a/tests/f_jnl_etb_alloc_fail/expect.2 b/tests/f_jnl_etb_alloc_fail/expect.2 new file mode 100644 index 0000000..69859dd --- /dev/null +++ b/tests/f_jnl_etb_alloc_fail/expect.2 @@ -0,0 +1,20 @@ +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(32--33) -(35--49) -(83--511) -(513--1087) -1089 +Fix? yes + +Free blocks count wrong for group #0 (0, counted=1022). +Fix? yes + +Free blocks count wrong (0, counted=1022). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 1026/2048 blocks +Exit status is 1 diff --git a/tests/f_jnl_etb_alloc_fail/image.gz b/tests/f_jnl_etb_alloc_fail/image.gz Binary files differnew file mode 100644 index 0000000..4cf2dbf --- /dev/null +++ b/tests/f_jnl_etb_alloc_fail/image.gz diff --git a/tests/f_jnl_etb_alloc_fail/name b/tests/f_jnl_etb_alloc_fail/name new file mode 100644 index 0000000..d9bce1c --- /dev/null +++ b/tests/f_jnl_etb_alloc_fail/name @@ -0,0 +1 @@ +can't allocate extent tree block recreating journal diff --git a/tests/f_journal/expect.1 b/tests/f_journal/expect.1 new file mode 100644 index 0000000..0a18654 --- /dev/null +++ b/tests/f_journal/expect.1 @@ -0,0 +1,62 @@ +test_filesys: recovering journal +Clearing orphaned inode 37 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 90 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 67 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 50 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 57 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 80 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 45 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 71 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 86 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 83 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 27 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 52 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 48 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 15 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 102 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 65 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 14 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 36 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 21 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 43 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 51 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 99 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 19 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 39 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 95 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 25 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 88 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 20 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 41 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 77 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 18 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 60 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 98 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 49 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 62 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 72 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 28 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 47 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 53 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 94 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 76 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 38 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 33 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 40 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 73 (uid=0, gid=0, mode=040700, size=1024) +Clearing orphaned inode 55 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 24 (uid=0, gid=0, mode=0100600, size=4096) +Clearing orphaned inode 59 (uid=0, gid=0, mode=0100600, size=4096) +Backing up journal inode block information. + +Moving journal from /journal to hidden inode. + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 53/2048 files (1.9% non-contiguous), 1409/8192 blocks +Exit status is 0 diff --git a/tests/f_journal/expect.2 b/tests/f_journal/expect.2 new file mode 100644 index 0000000..47c52f7 --- /dev/null +++ b/tests/f_journal/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: 53/2048 files (1.9% non-contiguous), 1409/8192 blocks +Exit status is 0 diff --git a/tests/f_journal/image.gz b/tests/f_journal/image.gz Binary files differnew file mode 100644 index 0000000..512d9ec --- /dev/null +++ b/tests/f_journal/image.gz diff --git a/tests/f_journal/name b/tests/f_journal/name new file mode 100644 index 0000000..ece2321 --- /dev/null +++ b/tests/f_journal/name @@ -0,0 +1 @@ +recover journal from corrupted inode table diff --git a/tests/f_large_dir/expect b/tests/f_large_dir/expect new file mode 100644 index 0000000..495ea85 --- /dev/null +++ b/tests/f_large_dir/expect @@ -0,0 +1,34 @@ +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 108341 1k blocks and 65072 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test.img: ***** FILE SYSTEM WAS MODIFIED ***** +test.img: 17/65072 files (5.9% non-contiguous), 9732/108341 blocks +Exit status is 0 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Directory exceeds max links, but no DIR_NLINK feature in superblock. +Fix? yes + +Inode 12 ref count is 65012, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test.img: ***** FILE SYSTEM WAS MODIFIED ***** +test.img: 65023/65072 files (0.0% non-contiguous), 96666/108341 blocks +Exit status is 1 diff --git a/tests/f_large_dir/is_slow_test b/tests/f_large_dir/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/f_large_dir/is_slow_test diff --git a/tests/f_large_dir/name b/tests/f_large_dir/name new file mode 100644 index 0000000..4b96890 --- /dev/null +++ b/tests/f_large_dir/name @@ -0,0 +1 @@ +optimize 3 level htree directories diff --git a/tests/f_large_dir/script b/tests/f_large_dir/script new file mode 100644 index 0000000..e323583 --- /dev/null +++ b/tests/f_large_dir/script @@ -0,0 +1,90 @@ +OUT=$test_name.log +EXP=$test_dir/expect +E2FSCK=../e2fsck/e2fsck + +NAMELEN=255 +DIRENT_SZ=8 +BLOCKSZ=1024 +INODESZ=128 +DIRENT_PER_LEAF=$((BLOCKSZ / (NAMELEN + DIRENT_SZ))) +HEADER=32 +INDEX_SZ=8 +INDEX_L1=$(((BLOCKSZ - HEADER) / INDEX_SZ)) +INDEX_L2=$(((BLOCKSZ - DIRENT_SZ) / INDEX_SZ)) +DIRBLK=$((2 + INDEX_L1 * INDEX_L2)) +ENTRIES=$((DIRBLK * DIRENT_PER_LEAF)) +EXT4_LINK_MAX=65000 +if [ $ENTRIES -lt $((EXT4_LINK_MAX + 10)) ]; then + ENTRIES=$((EXT4_LINK_MAX + 10)) + DIRBLK=$((ENTRIES / DIRENT_PER_LEAF + 3)) +fi +# directory leaf blocks plus inode count and 25% for the rest of the fs +FSIZE=$(((DIRBLK + EXT4_LINK_MAX * ((BLOCKSZ + INODESZ) / BLOCKSZ)) * 5 / 4)) + +$MKE2FS -b 1024 -O large_dir,uninit_bg -N $((ENTRIES + 50)) \ + -I $INODESZ -F $TMPFILE $FSIZE > $OUT.new 2>&1 +RC=$? +if [ $RC -eq 0 ]; then +{ + # First some initial fs setup to create indexed dir + echo "mkdir /foo" + echo "cd /foo" + touch $TMPFILE.tmp + echo "write $TMPFILE.tmp foofile" + i=0 + while test $i -lt $DIRENT_PER_LEAF ; do + printf "mkdir d%0254u\n" $i + i=$((i + 1)); + done + echo "expand ./" + printf "mkdir d%0254u\n" $i +} | $DEBUGFS -w $TMPFILE > /dev/null 2>> $OUT.new + RC=$? + # e2fsck should optimize the dir to become indexed + $E2FSCK -yfD $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new +fi + +if [ $RC -eq 0 ]; then +{ + START=$SECONDS + i=$(($DIRENT_PER_LEAF+1)) + last=$i + echo "cd /foo" + while test $i -lt $ENTRIES ; do + ELAPSED=$((SECONDS - START)) + if test $((i % 5000)) -eq 0 -a $ELAPSED -gt 10; then + RATE=$(((i - last) / ELAPSED)) + echo "$test_name: $i/$ENTRIES links, ${ELAPSED}s @ $RATE/s" >&2 + START=$SECONDS + last=$i + fi + if test $i -lt $((EXT4_LINK_MAX + 10)); then + printf "mkdir d%0254u\n" $i + else + printf "ln foofile f%0254u\n" $i + fi + i=$((i + 1)) + done +} | $DEBUGFS -w $TMPFILE > /dev/null 2>> $OUT.new + RC=$? +fi + +if [ $RC -eq 0 ]; then + $E2FSCK -yfD $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT + rm -f $OUT.new + + cmp -s $OUT $EXP + RC=$? +fi +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT > $test_name.failed +fi diff --git a/tests/f_large_dir_csum/expect b/tests/f_large_dir_csum/expect new file mode 100644 index 0000000..44770f7 --- /dev/null +++ b/tests/f_large_dir_csum/expect @@ -0,0 +1,33 @@ +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 31002 1k blocks and 64 inodes +Superblock backups stored on blocks: + 8193, 24577 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 13 ref count is 1, should be 5. Fix? yes + +Pass 5: Checking group summary information + +test.img: ***** FILE SYSTEM WAS MODIFIED ***** +test.img: 13/64 files (0.0% non-contiguous), 766/31002 blocks +Exit status is 1 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 13 ref count is 5, should be 46504. Fix? yes + +Pass 5: Checking group summary information + +test.img: ***** FILE SYSTEM WAS MODIFIED ***** +test.img: 13/64 files (0.0% non-contiguous), 16390/31002 blocks +Exit status is 1 diff --git a/tests/f_large_dir_csum/is_slow_test b/tests/f_large_dir_csum/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/f_large_dir_csum/is_slow_test diff --git a/tests/f_large_dir_csum/name b/tests/f_large_dir_csum/name new file mode 100644 index 0000000..2b37c8c --- /dev/null +++ b/tests/f_large_dir_csum/name @@ -0,0 +1 @@ +optimize 3 level htree directories with metadata checksums diff --git a/tests/f_large_dir_csum/script b/tests/f_large_dir_csum/script new file mode 100644 index 0000000..286a965 --- /dev/null +++ b/tests/f_large_dir_csum/script @@ -0,0 +1,84 @@ +OUT=$test_name.log +EXP=$test_dir/expect +E2FSCK=../e2fsck/e2fsck + +NAMELEN=255 +DIRENT_SZ=8 +BLOCKSZ=1024 +INODESZ=128 +CSUM_SZ=8 +CSUM_TAIL_SZ=12 +DIRENT_PER_LEAF=$(((BLOCKSZ - CSUM_TAIL_SZ) / (NAMELEN + DIRENT_SZ))) +HEADER=32 +INDEX_SZ=8 +INDEX_L1=$(((BLOCKSZ - HEADER - CSUM_SZ) / INDEX_SZ)) +INDEX_L2=$(((BLOCKSZ - DIRENT_SZ - CSUM_SZ) / INDEX_SZ)) +DIRBLK=$((3 + INDEX_L1 * INDEX_L2)) +ENTRIES=$((DIRBLK * DIRENT_PER_LEAF)) +# directory leaf blocks - get twice as much because the leaves won't be full +# and there are also other filesystem blocks. +FSIZE=$((DIRBLK * 2)) + +$MKE2FS -b 1024 -O extents,64bit,large_dir,uninit_bg,metadata_csum -N 50 \ + -I $INODESZ -F $TMPFILE $FSIZE > $OUT.new 2>&1 +RC=$? +if [ $RC -eq 0 ]; then +{ + # First some initial fs setup to create indexed dir + echo "mkdir /foo" + echo "cd /foo" + touch $TMPFILE.tmp + echo "write $TMPFILE.tmp foofile" + i=0 + while test $i -lt $DIRENT_PER_LEAF ; do + printf "ln foofile f%0254u\n" $i + i=$((i + 1)); + done + echo "expand ./" + printf "ln foofile f%0254u\n" $i +} | $DEBUGFS -w $TMPFILE > /dev/null 2>> $OUT.new + RC=$? + # e2fsck should optimize the dir to become indexed + $E2FSCK -yfD $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new +fi + +if [ $RC -eq 0 ]; then +{ + START=$SECONDS + i=$(($DIRENT_PER_LEAF+1)) + last=$i + echo "cd /foo" + while test $i -lt $ENTRIES ; do + ELAPSED=$((SECONDS - START)) + if test $((i % 5000)) -eq 0 -a $ELAPSED -gt 10; then + RATE=$(((i - last) / ELAPSED)) + echo "$test_name: $i/$ENTRIES links, ${ELAPSED}s @ $RATE/s" >&2 + START=$SECONDS + last=$i + fi + printf "ln foofile f%0254u\n" $i + i=$((i + 1)) + done +} | $DEBUGFS -w $TMPFILE > /dev/null 2>> $OUT.new + RC=$? +fi + +if [ $RC -eq 0 ]; then + $E2FSCK -yfD $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT + rm -f $OUT.new + + cmp -s $OUT $EXP + RC=$? +fi +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT > $test_name.failed +fi diff --git a/tests/f_lotsbad/expect.1 b/tests/f_lotsbad/expect.1 new file mode 100644 index 0000000..d9e8a24 --- /dev/null +++ b/tests/f_lotsbad/expect.1 @@ -0,0 +1,61 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 13 is too big. Truncate? yes + +Block #16580876 (74) causes directory to be too big. CLEARED. +Inode 13, i_size is 15360, should be 12288. Fix? yes + +Inode 13, i_blocks is 32, should be 30. Fix? yes + +Inode 12 has illegal block(s). Clear? yes + +Illegal block #12 (778398818) in inode 12. CLEARED. +Illegal block #13 (1768444960) in inode 12. CLEARED. +Illegal block #14 (1752375411) in inode 12. CLEARED. +Illegal block #15 (1684829551) in inode 12. CLEARED. +Illegal block #16 (1886349344) in inode 12. CLEARED. +Illegal block #17 (1819633253) in inode 12. CLEARED. +Illegal block #18 (1663072620) in inode 12. CLEARED. +Illegal block #19 (1735287144) in inode 12. CLEARED. +Illegal block #20 (1310731877) in inode 12. CLEARED. +Illegal block #21 (560297071) in inode 12. CLEARED. +Illegal block #22 (543512352) in inode 12. CLEARED. +Too many illegal blocks in inode 12. +Clear inode? yes + +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'termcap' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 5, should be 4. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(27--41) -(44--45) -(74--90) +Fix? yes + +Free blocks count wrong for group #0 (9, counted=43). +Fix? yes + +Free blocks count wrong (9, counted=43). +Fix? yes + +Inode bitmap differences: -12 -14 +Fix? yes + +Free inodes count wrong for group #0 (18, counted=20). +Fix? yes + +Directories count wrong for group #0 (4, counted=3). +Fix? yes + +Free inodes count wrong (18, counted=20). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/32 files (0.0% non-contiguous), 57/100 blocks +Exit status is 1 diff --git a/tests/f_lotsbad/expect.2 b/tests/f_lotsbad/expect.2 new file mode 100644 index 0000000..da1208f --- /dev/null +++ b/tests/f_lotsbad/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/32 files (0.0% non-contiguous), 57/100 blocks +Exit status is 0 diff --git a/tests/f_lotsbad/image.gz b/tests/f_lotsbad/image.gz Binary files differnew file mode 100644 index 0000000..8fd5d1e --- /dev/null +++ b/tests/f_lotsbad/image.gz diff --git a/tests/f_lotsbad/name b/tests/f_lotsbad/name new file mode 100644 index 0000000..16b77c1 --- /dev/null +++ b/tests/f_lotsbad/name @@ -0,0 +1 @@ +too many illegal blocks in inode diff --git a/tests/f_lpf/expect.1 b/tests/f_lpf/expect.1 new file mode 100644 index 0000000..6ef996b --- /dev/null +++ b/tests/f_lpf/expect.1 @@ -0,0 +1,50 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 13 is in use, but has dtime set. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Unattached inode 14 +Connect to /lost+found? yes + +Inode 14 ref count is 2, should be 1. Fix? yes + +Unattached inode 15 +Connect to /lost+found? yes + +Inode 15 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: +(22--23) +49 +(57--58) +Fix? yes + +Free blocks count wrong for group #0 (24, counted=33). +Fix? yes + +Free blocks count wrong (38, counted=33). +Fix? yes + +Inode bitmap differences: +13 +Fix? yes + +Free inodes count wrong for group #0 (1, counted=0). +Fix? yes + +Free inodes count wrong (1, counted=0). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/16 files (12.5% non-contiguous), 67/100 blocks +Exit status is 1 diff --git a/tests/f_lpf/expect.2 b/tests/f_lpf/expect.2 new file mode 100644 index 0000000..36110ee --- /dev/null +++ b/tests/f_lpf/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: 16/16 files (12.5% non-contiguous), 67/100 blocks +Exit status is 0 diff --git a/tests/f_lpf/image.gz b/tests/f_lpf/image.gz Binary files differnew file mode 100644 index 0000000..2a71bcf --- /dev/null +++ b/tests/f_lpf/image.gz diff --git a/tests/f_lpf/name b/tests/f_lpf/name new file mode 100644 index 0000000..ac2dbab --- /dev/null +++ b/tests/f_lpf/name @@ -0,0 +1 @@ +missing lost+found diff --git a/tests/f_lpf2/expect.1 b/tests/f_lpf2/expect.1 new file mode 100644 index 0000000..ab5d9ba --- /dev/null +++ b/tests/f_lpf2/expect.1 @@ -0,0 +1,41 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Unconnected directory inode 12 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Unconnected directory inode 13 (was in /) +Connect to /lost+found? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Inode 12 ref count is 3, should be 2. Fix? yes + +Inode 13 ref count is 3, should be 2. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(9--19) +Fix? yes + +Free blocks count wrong for group #0 (77, counted=89). +Fix? yes + +Free blocks count wrong (77, counted=89). +Fix? yes + +Free inodes count wrong for group #0 (2, counted=3). +Fix? yes + +Directories count wrong for group #0 (5, counted=4). +Fix? yes + +Free inodes count wrong (2, counted=3). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (0.0% non-contiguous), 11/100 blocks +Exit status is 1 diff --git a/tests/f_lpf2/expect.2 b/tests/f_lpf2/expect.2 new file mode 100644 index 0000000..e551932 --- /dev/null +++ b/tests/f_lpf2/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: 13/16 files (0.0% non-contiguous), 11/100 blocks +Exit status is 0 diff --git a/tests/f_lpf2/image.gz b/tests/f_lpf2/image.gz Binary files differnew file mode 100644 index 0000000..f703fb3 --- /dev/null +++ b/tests/f_lpf2/image.gz diff --git a/tests/f_lpf2/name b/tests/f_lpf2/name new file mode 100644 index 0000000..63da315 --- /dev/null +++ b/tests/f_lpf2/name @@ -0,0 +1 @@ +create lost+found and reconnect lost directory diff --git a/tests/f_lpffile/expect.1 b/tests/f_lpffile/expect.1 new file mode 100644 index 0000000..04cce4c --- /dev/null +++ b/tests/f_lpffile/expect.1 @@ -0,0 +1,32 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found is not a directory (ino=11) +Unlink? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Unattached inode 11 +Connect to /lost+found? yes + +Unattached inode 12 +Connect to /lost+found? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Unattached inode 14 +Connect to /lost+found? yes + +Inode 14 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/32 files (0.0% non-contiguous), 15/100 blocks +Exit status is 1 diff --git a/tests/f_lpffile/expect.2 b/tests/f_lpffile/expect.2 new file mode 100644 index 0000000..85e832d --- /dev/null +++ b/tests/f_lpffile/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: 15/32 files (0.0% non-contiguous), 15/100 blocks +Exit status is 0 diff --git a/tests/f_lpffile/image.gz b/tests/f_lpffile/image.gz Binary files differnew file mode 100644 index 0000000..75278df --- /dev/null +++ b/tests/f_lpffile/image.gz diff --git a/tests/f_lpffile/name b/tests/f_lpffile/name new file mode 100644 index 0000000..e4e40b9 --- /dev/null +++ b/tests/f_lpffile/name @@ -0,0 +1 @@ +lost+found is not a directory diff --git a/tests/f_many_subdirs/expect.1 b/tests/f_many_subdirs/expect.1 new file mode 100644 index 0000000..a8da480 --- /dev/null +++ b/tests/f_many_subdirs/expect.1 @@ -0,0 +1,47 @@ +Pass 1: Checking inodes, blocks, and sizes +Deleted inode 26363 has zero dtime. Fix? yes + +Pass 2: Checking directory structure +Entry 'nlink_eq_0' in / (2) has deleted/unused inode 26363. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 9, should be 8. Fix? yes + +Inode 13201 ref count is 1, should be 2. Fix? yes + +Inode 19763 ref count is 65535, should be 2. Fix? yes + +Directory exceeds max links, but no DIR_NLINK feature in superblock. +Fix? yes + +Inode 32963 ref count is 65000, should be 2. Fix? yes + +Directory inode 39601 ref count set to overflow but could be exact value 2. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -73383 +Fix? yes + +Free blocks count wrong for group #8 (0, counted=1). +Fix? yes + +Free blocks count wrong (5388, counted=5389). +Fix? yes + +Inode bitmap differences: -26363 +Fix? yes + +Free inodes count wrong for group #3 (37, counted=38). +Fix? yes + +Directories count wrong for group #3 (6563, counted=6562). +Fix? yes + +Free inodes count wrong (382, counted=383). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 65617/66000 files (0.0% non-contiguous), 76531/81920 blocks +Exit status is 1 diff --git a/tests/f_many_subdirs/expect.2 b/tests/f_many_subdirs/expect.2 new file mode 100644 index 0000000..bb0d829 --- /dev/null +++ b/tests/f_many_subdirs/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: 65617/66000 files (0.0% non-contiguous), 76531/81920 blocks +Exit status is 0 diff --git a/tests/f_many_subdirs/image.gz b/tests/f_many_subdirs/image.gz Binary files differnew file mode 100644 index 0000000..7f60fff --- /dev/null +++ b/tests/f_many_subdirs/image.gz diff --git a/tests/f_many_subdirs/name b/tests/f_many_subdirs/name new file mode 100644 index 0000000..6264a60 --- /dev/null +++ b/tests/f_many_subdirs/name @@ -0,0 +1 @@ +directory with more than 65000 sub-directories diff --git a/tests/f_messy_inode/expect.1 b/tests/f_messy_inode/expect.1 new file mode 100644 index 0000000..708f1da --- /dev/null +++ b/tests/f_messy_inode/expect.1 @@ -0,0 +1,38 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 14 has illegal block(s). Clear? yes + +Illegal block #2 (4294901760) in inode 14. CLEARED. +Illegal block #3 (4294901760) in inode 14. CLEARED. +Illegal block #4 (4294901760) in inode 14. CLEARED. +Illegal block #5 (4294901760) in inode 14. CLEARED. +Illegal block #6 (4294901760) in inode 14. CLEARED. +Illegal block #7 (4294901760) in inode 14. CLEARED. +Illegal block #8 (4294901760) in inode 14. CLEARED. +Illegal block #9 (4294901760) in inode 14. CLEARED. +Illegal block #10 (4294901760) in inode 14. CLEARED. +Inode 14, i_size is 18446462598732849291, should be 2048. Fix? yes + +Inode 14, i_blocks is 18, should be 4. Fix? yes + +Pass 2: Checking directory structure +i_file_acl for inode 14 (/MAKEDEV) is 4294901760, should be zero. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(43--49) +Fix? yes + +Free blocks count wrong for group #0 (68, counted=75). +Fix? yes + +Free blocks count wrong (68, counted=75). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 29/32 files (3.4% non-contiguous), 25/100 blocks +Exit status is 1 diff --git a/tests/f_messy_inode/expect.2 b/tests/f_messy_inode/expect.2 new file mode 100644 index 0000000..1fffb02 --- /dev/null +++ b/tests/f_messy_inode/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: 29/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 0 diff --git a/tests/f_messy_inode/image.gz b/tests/f_messy_inode/image.gz Binary files differnew file mode 100644 index 0000000..630a689 --- /dev/null +++ b/tests/f_messy_inode/image.gz diff --git a/tests/f_messy_inode/name b/tests/f_messy_inode/name new file mode 100644 index 0000000..f1485ea --- /dev/null +++ b/tests/f_messy_inode/name @@ -0,0 +1 @@ +bad file and directory acl pointers diff --git a/tests/f_miss_blk_bmap/expect.1 b/tests/f_miss_blk_bmap/expect.1 new file mode 100644 index 0000000..998b61a --- /dev/null +++ b/tests/f_miss_blk_bmap/expect.1 @@ -0,0 +1,20 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap +Pass 1: Checking inodes, blocks, and sizes +Relocating group 0's block bitmap to 2... +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(0--10) +Fix? yes + +Free blocks count wrong for group #0 (90, counted=89). +Fix? yes + +Free blocks count wrong (90, counted=89). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/64 files (0.0% non-contiguous), 11/100 blocks +Exit status is 1 diff --git a/tests/f_miss_blk_bmap/expect.2 b/tests/f_miss_blk_bmap/expect.2 new file mode 100644 index 0000000..83f92ea --- /dev/null +++ b/tests/f_miss_blk_bmap/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: 11/64 files (0.0% non-contiguous), 11/100 blocks +Exit status is 0 diff --git a/tests/f_miss_blk_bmap/image.gz b/tests/f_miss_blk_bmap/image.gz Binary files differnew file mode 100644 index 0000000..680dbe0 --- /dev/null +++ b/tests/f_miss_blk_bmap/image.gz diff --git a/tests/f_miss_blk_bmap/name b/tests/f_miss_blk_bmap/name new file mode 100644 index 0000000..c059443 --- /dev/null +++ b/tests/f_miss_blk_bmap/name @@ -0,0 +1 @@ +missing block bitmap diff --git a/tests/f_miss_journal/expect.1 b/tests/f_miss_journal/expect.1 new file mode 100644 index 0000000..d435952 --- /dev/null +++ b/tests/f_miss_journal/expect.1 @@ -0,0 +1,28 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +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 +Block bitmap differences: -(50--1079) +Fix? yes + +Free blocks count wrong for group #0 (968, counted=1998). +Fix? yes + +Free blocks count wrong (968, counted=1998). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/256 files (0.0% non-contiguous), 1079/2048 blocks +Exit status is 1 diff --git a/tests/f_miss_journal/expect.2 b/tests/f_miss_journal/expect.2 new file mode 100644 index 0000000..ad32763 --- /dev/null +++ b/tests/f_miss_journal/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: 11/256 files (0.0% non-contiguous), 1079/2048 blocks +Exit status is 0 diff --git a/tests/f_miss_journal/image.gz b/tests/f_miss_journal/image.gz Binary files differnew file mode 100644 index 0000000..674d348 --- /dev/null +++ b/tests/f_miss_journal/image.gz diff --git a/tests/f_miss_journal/name b/tests/f_miss_journal/name new file mode 100644 index 0000000..b26d998 --- /dev/null +++ b/tests/f_miss_journal/name @@ -0,0 +1 @@ +non-existent journal inode diff --git a/tests/f_misstable/expect.1 b/tests/f_misstable/expect.1 new file mode 100644 index 0000000..a8cf264 --- /dev/null +++ b/tests/f_misstable/expect.1 @@ -0,0 +1,49 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode table +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +Inode table for group 1 is not in group. (block 0) +WARNING: SEVERE DATA LOSS POSSIBLE. +Relocate? yes + +Pass 1: Checking inodes, blocks, and sizes +Relocating group 1's inode table to 8197... +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'etc' in / (2) has deleted/unused inode 1505. Clear? yes + +Entry 'cache' in / (2) has deleted/unused inode 1514. Clear? yes + +Entry 'a' in / (2) has deleted/unused inode 1515. Clear? yes + +Entry 'b' in / (2) has deleted/unused inode 1516. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 8, should be 4. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -(8385--8405) +Fix? yes + +Free blocks count wrong for group #0 (7987, counted=7984). +Fix? yes + +Free blocks count wrong (11602, counted=11599). +Fix? yes + +Inode bitmap differences: -(1505--1516) +Fix? yes + +Free inodes count wrong for group #0 (1493, counted=1489). +Fix? yes + +Directories count wrong for group #0 (2, counted=3). +Fix? yes + +Free inodes count wrong (2997, counted=2993). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/3008 files (0.0% non-contiguous), 401/12000 blocks +Exit status is 1 diff --git a/tests/f_misstable/expect.2 b/tests/f_misstable/expect.2 new file mode 100644 index 0000000..e8cd21a --- /dev/null +++ b/tests/f_misstable/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: 15/3008 files (0.0% non-contiguous), 401/12000 blocks +Exit status is 0 diff --git a/tests/f_misstable/image.gz b/tests/f_misstable/image.gz Binary files differnew file mode 100644 index 0000000..b2aca9d --- /dev/null +++ b/tests/f_misstable/image.gz diff --git a/tests/f_misstable/name b/tests/f_misstable/name new file mode 100644 index 0000000..10a1adc --- /dev/null +++ b/tests/f_misstable/name @@ -0,0 +1 @@ +missing inode table diff --git a/tests/f_mke2fs2b/expect.1 b/tests/f_mke2fs2b/expect.1 new file mode 100644 index 0000000..5ffedcb --- /dev/null +++ b/tests/f_mke2fs2b/expect.1 @@ -0,0 +1,25 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Root inode has dtime set (probably due to old mke2fs). Fix? yes + +Inode 11 is in use, but has dtime set. Fix? yes + +Inode 15 is in use, but has dtime set. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached zero-length inode 15. Clear? yes + +Pass 5: Checking group summary information +Free inodes count wrong for group #0 (18, counted=17). +Fix? yes + +Free inodes count wrong (18, counted=17). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 1 diff --git a/tests/f_mke2fs2b/expect.2 b/tests/f_mke2fs2b/expect.2 new file mode 100644 index 0000000..10455d7 --- /dev/null +++ b/tests/f_mke2fs2b/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: 15/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 0 diff --git a/tests/f_mke2fs2b/image.gz b/tests/f_mke2fs2b/image.gz Binary files differnew file mode 100644 index 0000000..6b7412c --- /dev/null +++ b/tests/f_mke2fs2b/image.gz diff --git a/tests/f_mke2fs2b/name b/tests/f_mke2fs2b/name new file mode 100644 index 0000000..bf2202a --- /dev/null +++ b/tests/f_mke2fs2b/name @@ -0,0 +1 @@ +mke2fs version 0.2b created filesystem diff --git a/tests/f_mke2fs_baddisk/script b/tests/f_mke2fs_baddisk/script new file mode 100644 index 0000000..7ce8c5c --- /dev/null +++ b/tests/f_mke2fs_baddisk/script @@ -0,0 +1,24 @@ +test_description="mke2fs /dev/mapper/bad_disk should fail" + +OUT=$test_name.log + +dmsetup create -v bad_disk --table '0 1148681097 error' > $OUT 2>&1 +status=$? +if [ "$status" != 0 ]; then + echo "$test_name: $test_description: skip" + touch $test_name.ok +else + echo mke2fs /dev/mapper/bad_disk >> $OUT + $MKE2FS /dev/mapper/bad_disk >> $OUT 2>&1 + status=$? + sleep 1 + dmsetup remove --retry bad_disk >> $OUT 2>&1 + + if [ "$status" = 0 ] ; then + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" + else + echo "$test_name: $test_description: ok" + touch $test_name.ok + fi +fi diff --git a/tests/f_mmp/is_slow_test b/tests/f_mmp/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/f_mmp/is_slow_test diff --git a/tests/f_mmp/name b/tests/f_mmp/name new file mode 100644 index 0000000..20d66d6 --- /dev/null +++ b/tests/f_mmp/name @@ -0,0 +1 @@ +disable MMP with tune2fs after e2fsck killed diff --git a/tests/f_mmp/script b/tests/f_mmp/script new file mode 100644 index 0000000..f433bd5 --- /dev/null +++ b/tests/f_mmp/script @@ -0,0 +1,71 @@ +FSCK_OPT=-yf + +echo "make the test image ..." > $test_name.log +$MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +kill_debugfs() { + trap 0 + PID=$(ps -o pid,command | grep -v grep | + grep "debugfs -w $TMPFILE" | awk "{ print \$1 }") + [ "x$PID" != "x" ] && kill -9 $PID +} + +# this will cause debugfs to create the $test_name.mark file once it has +# passed the MMP startup, then continue reading input until it is killed +MARKFILE=$test_name.new +rm -f $MARKFILE +trap kill_debugfs EXIT +echo "set mmp sequence to EXT2_MMP_SEQ_FSCK..." >> $test_name.log +( { echo dump_mmp; echo "dump_inode <2> $MARKFILE"; cat /dev/zero; } | + $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1 & ) > /dev/null 2>&1 & +echo "wait until debugfs has started ..." >> $test_name.log +while [ ! -e $MARKFILE ]; do + sleep 1 +done +rm -f $MARKFILE +echo "kill debugfs abruptly (simulates e2fsck failure) ..." >> $test_name.log +kill_debugfs + +$E2MMPSTATUS $TMPFILE > $test_name.log 2>&1 +status=$? +if [ "$status" != 1 ] ; then + echo "$E2MMPSTATUS with EXT2_MMP_SEQ_FSCK passed!" > $test_name.failed + echo "$test_name: $test_description: failed" + return 1 +fi + +echo "e2fsck (should fail mmp_seq = EXT2_MMP_SEQ_FSCK) ..." >> $test_name.log +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "e2fsck with MMP as EXT2_MMP_SEQ_FSCK ran!" > $test_name.failed + echo "$test_name: $test_description: failed" + return 1 +fi + +echo "clear mmp_seq with tune2fs ..." >> $test_name.log +$TUNE2FS -f -E clear_mmp $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs clearing EXT2_MMP_SEQ_FSCK failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return 1 +fi + +echo "run e2fsck again (should pass with clean mmp_seq) ..." >> $test_name.log +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "e2fsck after clearing EXT2_MMP_SEQ_FSCK failed"> $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +echo "$test_name: $test_description: ok" +rm -f $TMPFILE diff --git a/tests/f_mmp_garbage/expect.1 b/tests/f_mmp_garbage/expect.1 new file mode 100644 index 0000000..4134eae --- /dev/null +++ b/tests/f_mmp_garbage/expect.1 @@ -0,0 +1,9 @@ +Superblock has invalid MMP magic. Fix? yes + +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: 11/64 files (0.0% non-contiguous), 15/100 blocks +Exit status is 0 diff --git a/tests/f_mmp_garbage/expect.2 b/tests/f_mmp_garbage/expect.2 new file mode 100644 index 0000000..3bca182 --- /dev/null +++ b/tests/f_mmp_garbage/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: 11/64 files (0.0% non-contiguous), 15/100 blocks +Exit status is 0 diff --git a/tests/f_mmp_garbage/is_slow_test b/tests/f_mmp_garbage/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/f_mmp_garbage/is_slow_test diff --git a/tests/f_mmp_garbage/name b/tests/f_mmp_garbage/name new file mode 100644 index 0000000..17e0b14 --- /dev/null +++ b/tests/f_mmp_garbage/name @@ -0,0 +1 @@ +repair MMP when it is corrupted diff --git a/tests/f_mmp_garbage/script b/tests/f_mmp_garbage/script new file mode 100644 index 0000000..69be338 --- /dev/null +++ b/tests/f_mmp_garbage/script @@ -0,0 +1,17 @@ +FSCK_OPT=-yf + +echo "make the test image ..." > $test_name.log +$MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +# create a corrupted image +echo "modify the mmp sequence ..." >> $test_name.log +$DEBUGFS -w -R "set_mmp_value magic 0x12345678" $TMPFILE >> $test_name.log 2>&1 + +SKIP_GUNZIP=true +. $cmd_dir/run_e2fsck diff --git a/tests/f_no/expect b/tests/f_no/expect new file mode 100644 index 0000000..140a01f --- /dev/null +++ b/tests/f_no/expect @@ -0,0 +1,50 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 999999999, len 1) +Clear<y>? no +Inode 12 has an invalid extent + (logical block 1, invalid physical block 9999999999, len 1) +Clear<y>? no +Inode 13 is in use, but has dtime set. Fix<y>? no +Inode 13 has an invalid extent + (logical block 1, invalid physical block 8888888888888, len 1) +Clear<y>? no +Inode 13 has an invalid extent + (logical block 0, invalid physical block 888888888888, len 1) +Clear<y>? no +Inodes that were part of a corrupted orphan linked list found. Fix<y>? no +Inode 14 was part of the orphaned inode list. IGNORED. +Inode 14 is in use, but has dtime set. Fix<y>? no +Inode 14 has an invalid extent + (logical block 300, invalid physical block 777777777777, len 300) +Clear<y>? no +Inode 14 has an invalid extent + (logical block 0, invalid physical block 7777777777, len 1) +Clear<y>? no +Inode 14, i_blocks is 52574694748113, should be 0. Fix<y>? no +Pass 2: Checking directory structure +Extended attribute block for inode 12 (/a) is invalid (999999). +Clear<y>? no +Extended attribute block for inode 13 (/b) is invalid (298954296). +Clear<y>? no +Extended attribute block for inode 14 (/c) is invalid (388697201). +Clear<y>? no +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 12 ref count is 34463, should be 1. Fix<y>? no +Inode 13 ref count is 9999, should be 1. Fix<y>? no +Inode 14 ref count is 12241, should be 1. Fix<y>? no +Pass 5: Checking group summary information +Block bitmap differences: -202 -381 -457 +Fix<y>? no +Free blocks count wrong for group #0 (0, counted=491). +Fix<y>? no +Free blocks count wrong (494, counted=491). +Fix<y>? no +Free inodes count wrong for group #0 (4294967293, counted=114). +Fix<y>? no + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 4 diff --git a/tests/f_no/script b/tests/f_no/script new file mode 100644 index 0000000..c046d76 --- /dev/null +++ b/tests/f_no/script @@ -0,0 +1,26 @@ +test_description="e2fsck with repeated no" +FSCK_OPT=-f +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $test_dir/../f_yesall/image.gz > $TMPFILE + +echo "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_no_cache_corrupt_inode/expect.1 b/tests/f_no_cache_corrupt_inode/expect.1 new file mode 100644 index 0000000..4f82f75 --- /dev/null +++ b/tests/f_no_cache_corrupt_inode/expect.1 @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 passes checks, but checksum does not match inode. Fix? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 1 diff --git a/tests/f_no_cache_corrupt_inode/expect.2 b/tests/f_no_cache_corrupt_inode/expect.2 new file mode 100644 index 0000000..1b43315 --- /dev/null +++ b/tests/f_no_cache_corrupt_inode/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/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 diff --git a/tests/f_no_cache_corrupt_inode/image.gz b/tests/f_no_cache_corrupt_inode/image.gz Binary files differnew file mode 100644 index 0000000..e17e921 --- /dev/null +++ b/tests/f_no_cache_corrupt_inode/image.gz diff --git a/tests/f_no_cache_corrupt_inode/name b/tests/f_no_cache_corrupt_inode/name new file mode 100644 index 0000000..fb213e2 --- /dev/null +++ b/tests/f_no_cache_corrupt_inode/name @@ -0,0 +1 @@ +don't cache inodes that fail checksum verification diff --git a/tests/f_noroot/expect.1 b/tests/f_noroot/expect.1 new file mode 100644 index 0000000..f8f652e --- /dev/null +++ b/tests/f_noroot/expect.1 @@ -0,0 +1,39 @@ +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Inode 15 is in use, but has dtime set. Fix? yes + +Pass 2: Checking directory structure +Entry '..' in /lost+found (11) has deleted/unused inode 2. Clear? yes + +Entry '..' in /foo (12) has deleted/unused inode 2. Clear? yes + +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Unconnected directory inode 12 (was in /lost+found) +Connect to /lost+found? yes + +Pass 4: Checking reference counts +Inode 11 ref count is 3, should be 2. Fix? yes + +Inode 12 ref count is 4, should be 3. Fix? yes + +Unattached zero-length inode 15. Clear? yes + +Pass 5: Checking group summary information +Free inodes count wrong for group #0 (17, counted=16). +Fix? yes + +Free inodes count wrong (17, counted=16). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 1 diff --git a/tests/f_noroot/expect.2 b/tests/f_noroot/expect.2 new file mode 100644 index 0000000..5ea5bc7 --- /dev/null +++ b/tests/f_noroot/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: 16/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 0 diff --git a/tests/f_noroot/image.gz b/tests/f_noroot/image.gz Binary files differnew file mode 100644 index 0000000..0a87e99 --- /dev/null +++ b/tests/f_noroot/image.gz diff --git a/tests/f_noroot/name b/tests/f_noroot/name new file mode 100644 index 0000000..a70ebc2 --- /dev/null +++ b/tests/f_noroot/name @@ -0,0 +1 @@ +missing root directory diff --git a/tests/f_nospc_create_lnf/expect.1 b/tests/f_nospc_create_lnf/expect.1 new file mode 100644 index 0000000..986fe12 --- /dev/null +++ b/tests/f_nospc_create_lnf/expect.1 @@ -0,0 +1,29 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Cannot allocate space for /lost+found. +Place lost files in root directory instead? yes + +Insufficient space to recover lost files! +Move data off the filesystem and re-run e2fsck. + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Unattached inode 125 +Connect to /lost+found? yes + +Inode 125 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information +Free blocks count wrong for group #0 (496, counted=495). +Fix? yes + +Free blocks count wrong (496, counted=495). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 128/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_nospc_create_lnf/expect.2 b/tests/f_nospc_create_lnf/expect.2 new file mode 100644 index 0000000..e9757f8 --- /dev/null +++ b/tests/f_nospc_create_lnf/expect.2 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +/lost+found not found. Create? yes + +Cannot allocate space for /lost+found. +Place lost files in root directory instead? yes + +Insufficient space to recover lost files! +Move data off the filesystem and re-run e2fsck. + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -9 +Fix? yes + +Free blocks count wrong for group #0 (494, counted=495). +Fix? yes + +Free blocks count wrong (494, counted=495). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 128/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_nospc_create_lnf/image.gz b/tests/f_nospc_create_lnf/image.gz Binary files differnew file mode 100644 index 0000000..dc71b61 --- /dev/null +++ b/tests/f_nospc_create_lnf/image.gz diff --git a/tests/f_nospc_create_lnf/name b/tests/f_nospc_create_lnf/name new file mode 100644 index 0000000..df6c932 --- /dev/null +++ b/tests/f_nospc_create_lnf/name @@ -0,0 +1 @@ +no space to create lost+found diff --git a/tests/f_okgroup/expect.1 b/tests/f_okgroup/expect.1 new file mode 100644 index 0000000..7d29741 --- /dev/null +++ b/tests/f_okgroup/expect.1 @@ -0,0 +1,9 @@ +Filesystem did not have a UUID; generating one. + +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: 11/2048 files (0.0% non-contiguous), 274/8193 blocks +Exit status is 0 diff --git a/tests/f_okgroup/expect.2 b/tests/f_okgroup/expect.2 new file mode 100644 index 0000000..44856c0 --- /dev/null +++ b/tests/f_okgroup/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: 11/2048 files (0.0% non-contiguous), 274/8193 blocks +Exit status is 0 diff --git a/tests/f_okgroup/image.gz b/tests/f_okgroup/image.gz Binary files differnew file mode 100644 index 0000000..06b67c7 --- /dev/null +++ b/tests/f_okgroup/image.gz diff --git a/tests/f_okgroup/name b/tests/f_okgroup/name new file mode 100644 index 0000000..3da66af --- /dev/null +++ b/tests/f_okgroup/name @@ -0,0 +1 @@ +8193 block long filesystem diff --git a/tests/f_opt_extent/expect b/tests/f_opt_extent/expect new file mode 100644 index 0000000..9d2021e --- /dev/null +++ b/tests/f_opt_extent/expect @@ -0,0 +1,55 @@ +tune2fs metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -11,7 +11,7 @@ + Block count: 524288 + Reserved block count: 26214 + Overhead clusters: 35246 +-Free blocks: 570 ++Free blocks: 567 + Free inodes: 65047 + First block: 1 + Block size: 1024 +@@ -50,8 +50,8 @@ + Block bitmap at 262 (+261) + Inode bitmap at 278 (+277) + Inode table at 294-549 (+293) +- 21 free blocks, 535 free inodes, 3 directories, 535 unused inodes +- Free blocks: 4414-4434 ++ 18 free blocks, 535 free inodes, 3 directories, 535 unused inodes ++ Free blocks: 4417-4434 + Free inodes: 490-1024 + Group 1: (Blocks 8193-16384) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8197 +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 + +Exit status is 0 diff --git a/tests/f_opt_extent/name b/tests/f_opt_extent/name new file mode 100644 index 0000000..7d4389c --- /dev/null +++ b/tests/f_opt_extent/name @@ -0,0 +1 @@ +optimize extent tree diff --git a/tests/f_opt_extent/script b/tests/f_opt_extent/script new file mode 100644 index 0000000..001c727 --- /dev/null +++ b/tests/f_opt_extent/script @@ -0,0 +1,64 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = /xyz + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -fyD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/f_opt_extent_ext3/expect b/tests/f_opt_extent_ext3/expect new file mode 100644 index 0000000..1761471 --- /dev/null +++ b/tests/f_opt_extent_ext3/expect @@ -0,0 +1,44 @@ +rebuild extent metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +mke2fs: Operation not supported for inodes containing extents while creating huge files +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file huge_file dir_nlink ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent sparse_super large_file huge_file dir_nlink + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +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 + +Exit status is 0 diff --git a/tests/f_opt_extent_ext3/name b/tests/f_opt_extent_ext3/name new file mode 100644 index 0000000..b369685 --- /dev/null +++ b/tests/f_opt_extent_ext3/name @@ -0,0 +1 @@ +convert ext3 to extent tree diff --git a/tests/f_opt_extent_ext3/script b/tests/f_opt_extent_ext3/script new file mode 100644 index 0000000..ef8c906 --- /dev/null +++ b/tests/f_opt_extent_ext3/script @@ -0,0 +1,65 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,^extent,huge_file,^flex_bg,^uninit_bg,dir_nlink,^extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,^64bit,^metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + num_hugefiles = 100 + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "rebuild extent metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -fyD -N test_filesys -E bmap2extent $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/f_orphan/expect.1 b/tests/f_orphan/expect.1 new file mode 100644 index 0000000..087ebee --- /dev/null +++ b/tests/f_orphan/expect.1 @@ -0,0 +1,14 @@ +Clearing orphaned inode 15 (uid=0, gid=0, mode=040755, size=1024) +Clearing orphaned inode 17 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 16 (uid=0, gid=0, mode=040755, size=1024) +Clearing orphaned inode 14 (uid=0, gid=0, mode=0100644, size=69) +Clearing orphaned inode 13 (uid=0, gid=0, mode=040755, size=1024) +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/2048 files (0.0% non-contiguous), 1303/8192 blocks +Exit status is 0 diff --git a/tests/f_orphan/expect.2 b/tests/f_orphan/expect.2 new file mode 100644 index 0000000..359c937 --- /dev/null +++ b/tests/f_orphan/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/2048 files (0.0% non-contiguous), 1303/8192 blocks +Exit status is 0 diff --git a/tests/f_orphan/image.gz b/tests/f_orphan/image.gz Binary files differnew file mode 100644 index 0000000..cada434 --- /dev/null +++ b/tests/f_orphan/image.gz diff --git a/tests/f_orphan/name b/tests/f_orphan/name new file mode 100644 index 0000000..4f9f3d5 --- /dev/null +++ b/tests/f_orphan/name @@ -0,0 +1 @@ +clearing orphan inodes diff --git a/tests/f_orphan_dotdot_ft/expect.1 b/tests/f_orphan_dotdot_ft/expect.1 new file mode 100644 index 0000000..6092495 --- /dev/null +++ b/tests/f_orphan_dotdot_ft/expect.1 @@ -0,0 +1,56 @@ +Pass 1: Checking inodes, blocks, and sizes +Special (device/socket/fifo) inode 12 has non-zero size. Fix? yes + +Inode 12, i_blocks is 2, should be 0. Fix? yes + +Pass 2: Checking directory structure +Entry 'dir' in / (2) has an incorrect filetype (was 2, should be 6). +Fix? yes + +Entry '..' in <12>/<13> (13) has an incorrect filetype (was 2, should be 6). +Fix? yes + +Entry '..' in <12>/<14> (14) has an incorrect filetype (was 2, should be 6). +Fix? yes + +Entry '..' in <12>/<15> (15) has an incorrect filetype (was 2, should be 6). +Fix? yes + +Pass 3: Checking directory connectivity +Unconnected directory inode 13 (was in <12>) +Connect to /lost+found? yes + +Unconnected directory inode 14 (was in <12>) +Connect to /lost+found? yes + +Unconnected directory inode 15 (was in <12>) +Connect to /lost+found? yes + +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Inode 13 ref count is 3, should be 2. Fix? yes + +Inode 14 ref count is 3, should be 2. Fix? yes + +Inode 15 ref count is 3, should be 2. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -23 +Fix? yes + +Free blocks count wrong for group #0 (73, counted=74). +Fix? yes + +Free blocks count wrong (73, counted=74). +Fix? yes + +Directories count wrong for group #0 (6, counted=5). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 1 diff --git a/tests/f_orphan_dotdot_ft/expect.2 b/tests/f_orphan_dotdot_ft/expect.2 new file mode 100644 index 0000000..fc68e79 --- /dev/null +++ b/tests/f_orphan_dotdot_ft/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: 15/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 0 diff --git a/tests/f_orphan_dotdot_ft/image.gz b/tests/f_orphan_dotdot_ft/image.gz Binary files differnew file mode 100644 index 0000000..cb91a64 --- /dev/null +++ b/tests/f_orphan_dotdot_ft/image.gz diff --git a/tests/f_orphan_dotdot_ft/name b/tests/f_orphan_dotdot_ft/name new file mode 100644 index 0000000..8362e9e --- /dev/null +++ b/tests/f_orphan_dotdot_ft/name @@ -0,0 +1 @@ +filetype of .. in orphaned directories diff --git a/tests/f_orphan_extents_inode/expect.1 b/tests/f_orphan_extents_inode/expect.1 new file mode 100644 index 0000000..5d713b3 --- /dev/null +++ b/tests/f_orphan_extents_inode/expect.1 @@ -0,0 +1,10 @@ +Truncating orphaned inode 12 (uid=0, gid=0, mode=0100644, size=0) +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_orphan_extents_inode/expect.2 b/tests/f_orphan_extents_inode/expect.2 new file mode 100644 index 0000000..4ee5d96 --- /dev/null +++ b/tests/f_orphan_extents_inode/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/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_orphan_extents_inode/image.gz b/tests/f_orphan_extents_inode/image.gz Binary files differnew file mode 100644 index 0000000..6c57fef --- /dev/null +++ b/tests/f_orphan_extents_inode/image.gz diff --git a/tests/f_orphan_extents_inode/name b/tests/f_orphan_extents_inode/name new file mode 100644 index 0000000..fc48ec2 --- /dev/null +++ b/tests/f_orphan_extents_inode/name @@ -0,0 +1 @@ +truncating an orphaned extent-mapped inode diff --git a/tests/f_orphan_indirect_inode/expect.1 b/tests/f_orphan_indirect_inode/expect.1 new file mode 100644 index 0000000..814a688 --- /dev/null +++ b/tests/f_orphan_indirect_inode/expect.1 @@ -0,0 +1,3 @@ +test_filesys: Truncating orphaned inode 12 (uid=0, gid=0, mode=0100644, size=0) +test_filesys: clean, 12/16 files, 21/100 blocks +Exit status is 0 diff --git a/tests/f_orphan_indirect_inode/expect.2 b/tests/f_orphan_indirect_inode/expect.2 new file mode 100644 index 0000000..4ee5d96 --- /dev/null +++ b/tests/f_orphan_indirect_inode/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/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_orphan_indirect_inode/image.gz b/tests/f_orphan_indirect_inode/image.gz Binary files differnew file mode 100644 index 0000000..54b3909 --- /dev/null +++ b/tests/f_orphan_indirect_inode/image.gz diff --git a/tests/f_orphan_indirect_inode/name b/tests/f_orphan_indirect_inode/name new file mode 100644 index 0000000..04ccb31 --- /dev/null +++ b/tests/f_orphan_indirect_inode/name @@ -0,0 +1 @@ +truncating an orphaned inode in preen mode diff --git a/tests/f_orphan_indirect_inode/script b/tests/f_orphan_indirect_inode/script new file mode 100644 index 0000000..ea3b93a --- /dev/null +++ b/tests/f_orphan_indirect_inode/script @@ -0,0 +1,2 @@ +FSCK_OPT=-p +. $cmd_dir/run_e2fsck diff --git a/tests/f_orphquot/expect b/tests/f_orphquot/expect new file mode 100644 index 0000000..0f75dec --- /dev/null +++ b/tests/f_orphquot/expect @@ -0,0 +1,16 @@ +Clearing orphaned inode 12 (uid=1000, gid=100, mode=0100644, size=3145728) +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_filesystem: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesystem: 11/512 files (9.1% non-contiguous), 1070/2048 blocks +Exit status is 0 + user id space quota limit inodes quota limit + 0 20480 0 0 2 0 0 + 1000 0 5000 6000 0 50 60 + group id space quota limit inodes quota limit + 0 20480 0 0 2 0 0 + 100 0 6000 7000 0 60 70 diff --git a/tests/f_orphquot/image.bz2 b/tests/f_orphquot/image.bz2 Binary files differnew file mode 100644 index 0000000..7ac17a0 --- /dev/null +++ b/tests/f_orphquot/image.bz2 diff --git a/tests/f_orphquot/script b/tests/f_orphquot/script new file mode 100644 index 0000000..e17bff0 --- /dev/null +++ b/tests/f_orphquot/script @@ -0,0 +1,28 @@ +test_description="e2fsck with quota and orphan inodes" +OUT=$test_name.log +EXP=$test_dir/expect + +bzip2 -dc < $test_dir/image.bz2 > $TMPFILE + +rm -rf $OUT +$FSCK -f -y -N test_filesystem $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +$DEBUGFS -R 'lq user' $TMPFILE >> $OUT.new 2>&1 +$DEBUGFS -R 'lq group' $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed $OUT.new >> $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_overfsblks/expect.1 b/tests/f_overfsblks/expect.1 new file mode 100644 index 0000000..bc8f2a8 --- /dev/null +++ b/tests/f_overfsblks/expect.1 @@ -0,0 +1,21 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for inode bitmap +Filesystem did not have a UUID; generating one. + +Pass 1: Checking inodes, blocks, and sizes +Group 0's inode bitmap at 3 conflicts with some other fs block. +Relocate? yes + +Relocating group 0's inode bitmap from 3 to 4... +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -(12--21) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 1 diff --git a/tests/f_overfsblks/expect.2 b/tests/f_overfsblks/expect.2 new file mode 100644 index 0000000..a821f87 --- /dev/null +++ b/tests/f_overfsblks/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: 11/32 files (0.0% non-contiguous), 22/100 blocks +Exit status is 0 diff --git a/tests/f_overfsblks/image.gz b/tests/f_overfsblks/image.gz Binary files differnew file mode 100644 index 0000000..60b6b2e --- /dev/null +++ b/tests/f_overfsblks/image.gz diff --git a/tests/f_overfsblks/name b/tests/f_overfsblks/name new file mode 100644 index 0000000..8ab6040 --- /dev/null +++ b/tests/f_overfsblks/name @@ -0,0 +1 @@ +overlapping inode and block bitmaps diff --git a/tests/f_pre_1970_date_encoding/expect b/tests/f_pre_1970_date_encoding/expect new file mode 100644 index 0000000..1a71571 --- /dev/null +++ b/tests/f_pre_1970_date_encoding/expect @@ -0,0 +1,45 @@ +times for year-1909 = + ctime: 0x8e475440:00000003 + atime: 0x8e475440:00000003 + mtime: 0x8e475440:00000003 +crtime: 0x8e475440:00000003 +times for year-1979 = + ctime: 0x11db6940:00000000 + atime: 0x11db6940:00000000 + mtime: 0x11db6940:00000000 +crtime: 0x11db6940:00000000 +times for year-2039 = + ctime: 0x82a37b40:00000001 + atime: 0x82a37b40:00000001 + mtime: 0x82a37b40:00000001 +crtime: 0x82a37b40:00000001 +times for year-2139 = + ctime: 0x3e9b9940:00000001 + atime: 0x3e9b9940:00000001 + mtime: 0x3e9b9940:00000001 +crtime: 0x3e9b9940:00000001 +times for year-1909 = + ctime: 0x8e475440:00000000 + atime: 0x8e475440:00000000 + mtime: 0x8e475440:00000000 +crtime: 0x8e475440:00000000 +times for year-1979 = + ctime: 0x11db6940:00000000 + atime: 0x11db6940:00000000 + mtime: 0x11db6940:00000000 +crtime: 0x11db6940:00000000 +times for year-2039 = + ctime: 0x82a37b40:00000001 + atime: 0x82a37b40:00000001 + mtime: 0x82a37b40:00000001 +crtime: 0x82a37b40:00000001 +times for year-2139 = + ctime: 0x3e9b9940:00000001 + atime: 0x3e9b9940:00000001 + mtime: 0x3e9b9940:00000001 +crtime: 0x3e9b9940:00000001 +times for year-1909 = + ctime: 0x8e475440:00000003 + atime: 0x8e475440:00000003 + mtime: 0x8e475440:00000003 +crtime: 0x8e475440:00000003 diff --git a/tests/f_pre_1970_date_encoding/name b/tests/f_pre_1970_date_encoding/name new file mode 100644 index 0000000..9805324 --- /dev/null +++ b/tests/f_pre_1970_date_encoding/name @@ -0,0 +1 @@ +correct mis-encoded pre-1970 dates diff --git a/tests/f_pre_1970_date_encoding/script b/tests/f_pre_1970_date_encoding/script new file mode 100644 index 0000000..952e550 --- /dev/null +++ b/tests/f_pre_1970_date_encoding/script @@ -0,0 +1,106 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +OUT=$test_name.log +TIMESTAMPS=$test_name.timestamps.log +EXP=$test_dir/expect +FSCK_OPT=-yf + +create_file_with_xtime_and_extra() { + name=$1 + time=$2 + extra=$3 + { + echo "write /dev/null $name" + for xtime in atime ctime mtime crtime; do + echo "set_inode_field $name $xtime @$time" + echo "set_inode_field $name ${xtime}_extra $extra" + done + } | $DEBUGFS -w $TMPFILE >> $OUT 2>&1 +} + +get_file_xtime_and_extra() { + name=$1 + echo "times for $name =" >> $TIMESTAMPS + $DEBUGFS -R "stat $name" $TMPFILE 2>&1 | egrep '^( a| c| m|cr)time:' | + sed 's/ --.*//' >> $TIMESTAMPS +} + +rm -f $OUT $TIMESTAMPS + +# create an empty ext4 filesystem with 256-byte inodes for testing +> $TMPFILE +echo mkfs.ext4 -b 1024 -q -I 256 $TMPFILE 5000 >> $OUT +$MKE2FS -t ext4 -b 1024 -q -I 256 -F $TMPFILE 5000 >> $OUT 2>&1 + +# this is a pre-1970 file encoded with the old encoding. +# fsck should repair this +create_file_with_xtime_and_extra year-1909 -1907928000 3 + +# these are all already encoded correctly +create_file_with_xtime_and_extra year-1979 299592000 0 +create_file_with_xtime_and_extra year-2039 2191752000 1 +create_file_with_xtime_and_extra year-2139 5345352000 1 + +# confirm that the xtime is wrong on the pre-1970 file +get_file_xtime_and_extra year-1909 + +# and confirm that it is right on the remaining files +get_file_xtime_and_extra year-1979 +get_file_xtime_and_extra year-2039 +get_file_xtime_and_extra year-2139 + +# before we repair the filesystem, save off a copy so that +# we can use it later + +cp -a $TMPFILE $TMPFILE.sav + +# repair the filesystem +E2FSCK_TIME=1386393539 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 + +# check that the dates and xtime_extra on the file is now correct +get_file_xtime_and_extra year-1909 + +# check that the remaining dates have not been altered +get_file_xtime_and_extra year-1979 +get_file_xtime_and_extra year-2039 +get_file_xtime_and_extra year-2139 + +if test $SIZEOF_TIME_T -gt 4 +then + # now we need to check that after the year 2242, e2fsck does not + # modify dates with extra_xtime=3 + + # restore the unrepaired filesystem + mv $TMPFILE.sav $TMPFILE + + #retry the repair + E2FSCK_TIME=9270393539 $FSCK $FSCK_OPT $TMPFILE >> $OUT 2>&1 + + # check that the 1909 file is unaltered (i.e. it has a post-2378 date) + get_file_xtime_and_extra year-1909 +else + rm -f TMPFILE.sav +cat << EOF >> $TIMESTAMPS +times for year-1909 = + ctime: 0x8e475440:00000003 + atime: 0x8e475440:00000003 + mtime: 0x8e475440:00000003 +crtime: 0x8e475440:00000003 +EOF +fi + +cmp -s $TIMESTAMPS $EXP +status=$? + +if [ "$status" = 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $TIMESTAMPS > $test_name.failed +fi + +unset OUT TIMESTAMPS EXP FSCK_OPT diff --git a/tests/f_preen/expect.1 b/tests/f_preen/expect.1 new file mode 100644 index 0000000..dd20572 --- /dev/null +++ b/tests/f_preen/expect.1 @@ -0,0 +1,12 @@ +test_filesys: Note: if several inode or block bitmap blocks or part +of the inode table require relocation, you may wish to try +running e2fsck with the '-b 8193' option first. The problem +may lie only with the primary block group descriptors, and +the backup block group descriptors may be OK. + +test_filesys: Block bitmap for group 0 is not in group. (block 0) + + +test_filesys: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. + (i.e., without -a or -p options) +Exit status is 4 diff --git a/tests/f_preen/expect.2 b/tests/f_preen/expect.2 new file mode 100644 index 0000000..a7f6ce1 --- /dev/null +++ b/tests/f_preen/expect.2 @@ -0,0 +1,30 @@ +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 +Free blocks count wrong for group #0 (8042, counted=7614). +Fix? yes + +Free blocks count wrong for group #1 (170, counted=169). +Fix? yes + +Free blocks count wrong (8212, counted=7783). +Fix? yes + +Free inodes count wrong for group #0 (1053, counted=1052). +Fix? yes + +Free inodes count wrong for group #1 (1064, counted=1063). +Fix? yes + +Directories count wrong for group #1 (0, counted=1). +Fix? yes + +Free inodes count wrong (2117, counted=2115). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/2128 files (0.0% non-contiguous), 717/8500 blocks +Exit status is 1 diff --git a/tests/f_preen/image.gz b/tests/f_preen/image.gz Binary files differnew file mode 100644 index 0000000..3aa7ca0 --- /dev/null +++ b/tests/f_preen/image.gz diff --git a/tests/f_preen/name b/tests/f_preen/name new file mode 100644 index 0000000..75a3a4f --- /dev/null +++ b/tests/f_preen/name @@ -0,0 +1 @@ +preen shouldn't destroy backup superblocks diff --git a/tests/f_preen/script b/tests/f_preen/script new file mode 100644 index 0000000..40ed11c --- /dev/null +++ b/tests/f_preen/script @@ -0,0 +1,4 @@ +FSCK_OPT=-pf +SECOND_FSCK_OPT=-yfb8193 + +. $cmd_dir/run_e2fsck diff --git a/tests/f_quota/debugfs-cmds b/tests/f_quota/debugfs-cmds new file mode 100644 index 0000000..112a3ff --- /dev/null +++ b/tests/f_quota/debugfs-cmds @@ -0,0 +1,7 @@ +list_quota user +list_quota group +get_quota user 0 +get_quota user 100 +get_quota user 34 +get_quota group 0 + diff --git a/tests/f_quota/expect.0 b/tests/f_quota/expect.0 new file mode 100644 index 0000000..2645485 --- /dev/null +++ b/tests/f_quota/expect.0 @@ -0,0 +1,21 @@ +debugfs: list_quota user + user id space quota limit inodes quota limit + 0 13312 0 0 2 0 0 + 34 1024 0 0 1 0 0 + 100 2048 32 50 2 20 30 +debugfs: list_quota group + group id space quota limit inodes quota limit + 0 16384 0 0 5 0 0 +debugfs: get_quota user 0 + user id space quota limit inodes quota limit + 0 13312 0 0 2 0 0 +debugfs: get_quota user 100 + user id space quota limit inodes quota limit + 100 2048 32 50 2 20 30 +debugfs: get_quota user 34 + user id space quota limit inodes quota limit + 34 1024 0 0 1 0 0 +debugfs: get_quota group 0 + group id space quota limit inodes quota limit + 0 16384 0 0 5 0 0 +debugfs: diff --git a/tests/f_quota/expect.1 b/tests/f_quota/expect.1 new file mode 100644 index 0000000..0b3b4cf --- /dev/null +++ b/tests/f_quota/expect.1 @@ -0,0 +1,13 @@ +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 +[QUOTA WARNING] Usage inconsistent for ID 0:actual (13312, 2) != expected (14336, 3) +[QUOTA WARNING] Usage inconsistent for ID 100:actual (2048, 2) != expected (1024, 1) +Update quota info for quota type 0? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/16 files (14.3% non-contiguous), 36/100 blocks +Exit status is 1 diff --git a/tests/f_quota/expect.2 b/tests/f_quota/expect.2 new file mode 100644 index 0000000..bfc558d --- /dev/null +++ b/tests/f_quota/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: 14/16 files (14.3% non-contiguous), 36/100 blocks +Exit status is 0 diff --git a/tests/f_quota/image.gz b/tests/f_quota/image.gz Binary files differnew file mode 100644 index 0000000..9cea655 --- /dev/null +++ b/tests/f_quota/image.gz diff --git a/tests/f_quota/name b/tests/f_quota/name new file mode 100644 index 0000000..27ea8ba --- /dev/null +++ b/tests/f_quota/name @@ -0,0 +1 @@ +fix incorrect usage stats in quota diff --git a/tests/f_quota/script b/tests/f_quota/script new file mode 100644 index 0000000..bbe6a9f --- /dev/null +++ b/tests/f_quota/script @@ -0,0 +1,11 @@ +AFTER_CMD='$DEBUGFS -f $test_dir/debugfs-cmds $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log' +PASS_ZERO=true + +$TUNE2FS -h 2>&1 | grep -q quota_options +if [ $? != 0 ] ; then + rm -f $TMPFILE + echo "$test_name: $test_description: skipped (quota not enabled)" + return 0 +fi + +. $cmd_dir/run_e2fsck diff --git a/tests/f_quota_extent_opt/expect.1 b/tests/f_quota_extent_opt/expect.1 new file mode 100644 index 0000000..002c9b6 --- /dev/null +++ b/tests/f_quota_extent_opt/expect.1 @@ -0,0 +1,15 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 extent tree (at level 1) could be narrower. Optimize? yes + +Pass 1E: Optimizing extent trees +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +[QUOTA WARNING] Usage inconsistent for ID 0:actual (147456, 3) != expected (148480, 3) +Update quota info for quota type 0? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/1024 files (25.0% non-contiguous), 1339/4096 blocks +Exit status is 1 diff --git a/tests/f_quota_extent_opt/expect.2 b/tests/f_quota_extent_opt/expect.2 new file mode 100644 index 0000000..0bd4632 --- /dev/null +++ b/tests/f_quota_extent_opt/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 (25.0% non-contiguous), 1339/4096 blocks +Exit status is 0 diff --git a/tests/f_quota_extent_opt/image.gz b/tests/f_quota_extent_opt/image.gz Binary files differnew file mode 100644 index 0000000..21dcfbd --- /dev/null +++ b/tests/f_quota_extent_opt/image.gz diff --git a/tests/f_quota_extent_opt/name b/tests/f_quota_extent_opt/name new file mode 100644 index 0000000..8c5d7a9 --- /dev/null +++ b/tests/f_quota_extent_opt/name @@ -0,0 +1 @@ +extent optimization with quota diff --git a/tests/f_quota_invalid_inum/expect.1 b/tests/f_quota_invalid_inum/expect.1 new file mode 100644 index 0000000..322ac09 --- /dev/null +++ b/tests/f_quota_invalid_inum/expect.1 @@ -0,0 +1,15 @@ +Invalid user quota inode 808464432. Fix? yes + +Invalid group quota inode 808464432. Fix? yes + +Invalid project quota inode 808464432. Fix? yes + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 1 diff --git a/tests/f_quota_invalid_inum/expect.2 b/tests/f_quota_invalid_inum/expect.2 new file mode 100644 index 0000000..41ceefb --- /dev/null +++ b/tests/f_quota_invalid_inum/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: 11/16 files (0.0% non-contiguous), 21/100 blocks +Exit status is 0 diff --git a/tests/f_quota_invalid_inum/image.gz b/tests/f_quota_invalid_inum/image.gz Binary files differnew file mode 100644 index 0000000..28be80e --- /dev/null +++ b/tests/f_quota_invalid_inum/image.gz diff --git a/tests/f_quota_invalid_inum/name b/tests/f_quota_invalid_inum/name new file mode 100644 index 0000000..a742406 --- /dev/null +++ b/tests/f_quota_invalid_inum/name @@ -0,0 +1 @@ +invalid quota inode numbers diff --git a/tests/f_readonly_fsck/expect b/tests/f_readonly_fsck/expect new file mode 100644 index 0000000..994dfa4 --- /dev/null +++ b/tests/f_readonly_fsck/expect @@ -0,0 +1,11 @@ +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 +Free blocks count wrong (4294968254, counted=958). +Fix? no + +test_filesys: 11/256 files (9.1% non-contiguous), 18446744069414585410/2048 blocks +Exit status is 0 +crc did not change. 2466215161 diff --git a/tests/f_readonly_fsck/image.gz b/tests/f_readonly_fsck/image.gz Binary files differnew file mode 100644 index 0000000..59f9cd9 --- /dev/null +++ b/tests/f_readonly_fsck/image.gz diff --git a/tests/f_readonly_fsck/name b/tests/f_readonly_fsck/name new file mode 100644 index 0000000..97ab428 --- /dev/null +++ b/tests/f_readonly_fsck/name @@ -0,0 +1 @@ +ensure that a readonly check doesn't modify the fs diff --git a/tests/f_readonly_fsck/script b/tests/f_readonly_fsck/script new file mode 100644 index 0000000..528199d --- /dev/null +++ b/tests/f_readonly_fsck/script @@ -0,0 +1,43 @@ +FSCK_OPT=-fn +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +gzip -d < $test_dir/image.gz > $TMPFILE + +old="$($CRCSUM < $TMPFILE)" + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +new="$($CRCSUM < $TMPFILE)" + +if [ "${old}" != "${new}" ]; then + echo "ERROR: crc mismatch! ${old} ${new}" >> $OUT.new +else + echo "crc did not change. ${old}" >> $OUT.new +fi + +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP old new diff --git a/tests/f_rebuild_csum_rootdir/expect.1 b/tests/f_rebuild_csum_rootdir/expect.1 new file mode 100644 index 0000000..063fb8c --- /dev/null +++ b/tests/f_rebuild_csum_rootdir/expect.1 @@ -0,0 +1,306 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 2, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 2. +Fix? yes + +Missing '..' in directory inode 2. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in / (2) is <The NULL inode> (0), should be / (2). +Fix? yes + +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 11 ref count is 3, should be 2. Fix? yes + +Unattached inode 12 +Connect to /lost+found? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Unattached inode 14 +Connect to /lost+found? yes + +Inode 14 ref count is 2, should be 1. Fix? yes + +Unattached inode 15 +Connect to /lost+found? yes + +Inode 15 ref count is 2, should be 1. Fix? yes + +Unattached inode 16 +Connect to /lost+found? yes + +Inode 16 ref count is 2, should be 1. Fix? yes + +Unattached inode 17 +Connect to /lost+found? yes + +Inode 17 ref count is 2, should be 1. Fix? yes + +Unattached inode 18 +Connect to /lost+found? yes + +Inode 18 ref count is 2, should be 1. Fix? yes + +Unattached inode 19 +Connect to /lost+found? yes + +Inode 19 ref count is 2, should be 1. Fix? yes + +Unattached inode 20 +Connect to /lost+found? yes + +Inode 20 ref count is 2, should be 1. Fix? yes + +Unattached inode 21 +Connect to /lost+found? yes + +Inode 21 ref count is 2, should be 1. Fix? yes + +Unattached inode 22 +Connect to /lost+found? yes + +Inode 22 ref count is 2, should be 1. Fix? yes + +Unattached inode 23 +Connect to /lost+found? yes + +Inode 23 ref count is 2, should be 1. Fix? yes + +Unattached inode 24 +Connect to /lost+found? yes + +Inode 24 ref count is 2, should be 1. Fix? yes + +Unattached inode 25 +Connect to /lost+found? yes + +Inode 25 ref count is 2, should be 1. Fix? yes + +Unattached inode 26 +Connect to /lost+found? yes + +Inode 26 ref count is 2, should be 1. Fix? yes + +Unattached inode 27 +Connect to /lost+found? yes + +Inode 27 ref count is 2, should be 1. Fix? yes + +Unattached inode 28 +Connect to /lost+found? yes + +Inode 28 ref count is 2, should be 1. Fix? yes + +Unattached inode 29 +Connect to /lost+found? yes + +Inode 29 ref count is 2, should be 1. Fix? yes + +Unattached inode 30 +Connect to /lost+found? yes + +Inode 30 ref count is 2, should be 1. Fix? yes + +Unattached inode 31 +Connect to /lost+found? yes + +Inode 31 ref count is 2, should be 1. Fix? yes + +Unattached inode 32 +Connect to /lost+found? yes + +Inode 32 ref count is 2, should be 1. Fix? yes + +Unattached inode 33 +Connect to /lost+found? yes + +Inode 33 ref count is 2, should be 1. Fix? yes + +Unattached inode 34 +Connect to /lost+found? yes + +Inode 34 ref count is 2, should be 1. Fix? yes + +Unattached inode 35 +Connect to /lost+found? yes + +Inode 35 ref count is 2, should be 1. Fix? yes + +Unattached inode 36 +Connect to /lost+found? yes + +Inode 36 ref count is 2, should be 1. Fix? yes + +Unattached inode 37 +Connect to /lost+found? yes + +Inode 37 ref count is 2, should be 1. Fix? yes + +Unattached inode 38 +Connect to /lost+found? yes + +Inode 38 ref count is 2, should be 1. Fix? yes + +Unattached inode 39 +Connect to /lost+found? yes + +Inode 39 ref count is 2, should be 1. Fix? yes + +Unattached inode 40 +Connect to /lost+found? yes + +Inode 40 ref count is 2, should be 1. Fix? yes + +Unattached inode 41 +Connect to /lost+found? yes + +Inode 41 ref count is 2, should be 1. Fix? yes + +Unattached inode 42 +Connect to /lost+found? yes + +Inode 42 ref count is 2, should be 1. Fix? yes + +Unattached inode 43 +Connect to /lost+found? yes + +Inode 43 ref count is 2, should be 1. Fix? yes + +Unattached inode 44 +Connect to /lost+found? yes + +Inode 44 ref count is 2, should be 1. Fix? yes + +Unattached inode 45 +Connect to /lost+found? yes + +Inode 45 ref count is 2, should be 1. Fix? yes + +Unattached inode 46 +Connect to /lost+found? yes + +Inode 46 ref count is 2, should be 1. Fix? yes + +Unattached inode 47 +Connect to /lost+found? yes + +Inode 47 ref count is 2, should be 1. Fix? yes + +Unattached inode 48 +Connect to /lost+found? yes + +Inode 48 ref count is 2, should be 1. Fix? yes + +Unattached inode 49 +Connect to /lost+found? yes + +Inode 49 ref count is 2, should be 1. Fix? yes + +Unattached inode 50 +Connect to /lost+found? yes + +Inode 50 ref count is 2, should be 1. Fix? yes + +Unattached inode 51 +Connect to /lost+found? yes + +Inode 51 ref count is 2, should be 1. Fix? yes + +Unattached inode 52 +Connect to /lost+found? yes + +Inode 52 ref count is 2, should be 1. Fix? yes + +Unattached inode 53 +Connect to /lost+found? yes + +Inode 53 ref count is 2, should be 1. Fix? yes + +Unattached inode 54 +Connect to /lost+found? yes + +Inode 54 ref count is 2, should be 1. Fix? yes + +Unattached inode 55 +Connect to /lost+found? yes + +Inode 55 ref count is 2, should be 1. Fix? yes + +Unattached inode 56 +Connect to /lost+found? yes + +Inode 56 ref count is 2, should be 1. Fix? yes + +Unattached inode 57 +Connect to /lost+found? yes + +Inode 57 ref count is 2, should be 1. Fix? yes + +Unattached inode 58 +Connect to /lost+found? yes + +Inode 58 ref count is 2, should be 1. Fix? yes + +Unattached inode 59 +Connect to /lost+found? yes + +Inode 59 ref count is 2, should be 1. Fix? yes + +Unattached inode 60 +Connect to /lost+found? yes + +Inode 60 ref count is 2, should be 1. Fix? yes + +Unattached inode 61 +Connect to /lost+found? yes + +Inode 61 ref count is 2, should be 1. Fix? yes + +Unattached inode 62 +Connect to /lost+found? yes + +Inode 62 ref count is 2, should be 1. Fix? yes + +Unattached inode 63 +Connect to /lost+found? yes + +Inode 63 ref count is 2, should be 1. Fix? yes + +Unattached inode 64 +Connect to /lost+found? yes + +Inode 64 ref count is 2, should be 1. Fix? yes + +Unattached zero-length inode 65. Clear? yes + +Unattached inode 66 +Connect to /lost+found? yes + +Inode 66 ref count is 2, should be 1. Fix? yes + +Unattached inode 67 +Connect to /lost+found? yes + +Inode 67 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 67/512 files (1.5% non-contiguous), 1127/2048 blocks +Exit status is 1 diff --git a/tests/f_rebuild_csum_rootdir/expect.2 b/tests/f_rebuild_csum_rootdir/expect.2 new file mode 100644 index 0000000..033f1bf --- /dev/null +++ b/tests/f_rebuild_csum_rootdir/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: 67/512 files (1.5% non-contiguous), 1127/2048 blocks +Exit status is 0 diff --git a/tests/f_rebuild_csum_rootdir/image.gz b/tests/f_rebuild_csum_rootdir/image.gz Binary files differnew file mode 100644 index 0000000..a32fd44 --- /dev/null +++ b/tests/f_rebuild_csum_rootdir/image.gz diff --git a/tests/f_rebuild_csum_rootdir/name b/tests/f_rebuild_csum_rootdir/name new file mode 100644 index 0000000..5ea2097 --- /dev/null +++ b/tests/f_rebuild_csum_rootdir/name @@ -0,0 +1 @@ +force rebuild corrupted rootdir w/ metadata_csum diff --git a/tests/f_recnect_bad/expect.1 b/tests/f_recnect_bad/expect.1 new file mode 100644 index 0000000..685eedf --- /dev/null +++ b/tests/f_recnect_bad/expect.1 @@ -0,0 +1,37 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 15, i_size is 51539608576, should be 1024. Fix? yes + +Pass 2: Checking directory structure +i_faddr for inode 15 (/test/quux) is 23, should be zero. +Clear? yes + +i_file_acl for inode 13 (/test/???) is 12, should be zero. +Clear? yes + +i_faddr for inode 13 (/test/???) is 12, should be zero. +Clear? yes + +Pass 3: Checking directory connectivity +Unconnected directory inode 13 (was in /test) +Connect to /lost+found? yes + +Pass 4: Checking reference counts +Inode 13 ref count is 4, should be 3. Fix? yes + +i_file_acl for inode 28 (...) is 4294967295, should be zero. +Clear? yes + +Inode 28 (...) has invalid mode (0177777). +Clear? yes + +Pass 5: Checking group summary information +Free inodes count wrong for group #0 (18, counted=17). +Fix? yes + +Free inodes count wrong (18, counted=17). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 15/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 1 diff --git a/tests/f_recnect_bad/expect.2 b/tests/f_recnect_bad/expect.2 new file mode 100644 index 0000000..fc68e79 --- /dev/null +++ b/tests/f_recnect_bad/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: 15/32 files (0.0% non-contiguous), 26/100 blocks +Exit status is 0 diff --git a/tests/f_recnect_bad/image.gz b/tests/f_recnect_bad/image.gz Binary files differnew file mode 100644 index 0000000..37dcdf9 --- /dev/null +++ b/tests/f_recnect_bad/image.gz diff --git a/tests/f_recnect_bad/name b/tests/f_recnect_bad/name new file mode 100644 index 0000000..c1a9c0c --- /dev/null +++ b/tests/f_recnect_bad/name @@ -0,0 +1 @@ +reconnecting bad inode diff --git a/tests/f_reconnect/expect.1 b/tests/f_reconnect/expect.1 new file mode 100644 index 0000000..331d8b3 --- /dev/null +++ b/tests/f_reconnect/expect.1 @@ -0,0 +1,24 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached inode 12 +Connect to /lost+found? yes + +Inode 12 ref count is 2, should be 1. Fix? yes + +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Unattached inode 14 +Connect to /lost+found? yes + +Inode 14 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 1 diff --git a/tests/f_reconnect/expect.2 b/tests/f_reconnect/expect.2 new file mode 100644 index 0000000..e848eff --- /dev/null +++ b/tests/f_reconnect/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: 14/32 files (0.0% non-contiguous), 25/100 blocks +Exit status is 0 diff --git a/tests/f_reconnect/image.gz b/tests/f_reconnect/image.gz Binary files differnew file mode 100644 index 0000000..56b92c3 --- /dev/null +++ b/tests/f_reconnect/image.gz diff --git a/tests/f_reconnect/name b/tests/f_reconnect/name new file mode 100644 index 0000000..c09c23f --- /dev/null +++ b/tests/f_reconnect/name @@ -0,0 +1 @@ +simple disconnected file inode diff --git a/tests/f_rehash_dir/expect.1 b/tests/f_rehash_dir/expect.1 new file mode 100644 index 0000000..c1449ba --- /dev/null +++ b/tests/f_rehash_dir/expect.1 @@ -0,0 +1,10 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 105/2048 files (2.9% non-contiguous), 336/512 blocks +Exit status is 0 diff --git a/tests/f_rehash_dir/expect.2 b/tests/f_rehash_dir/expect.2 new file mode 100644 index 0000000..3c78fe5 --- /dev/null +++ b/tests/f_rehash_dir/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: 105/2048 files (3.8% non-contiguous), 336/512 blocks +Exit status is 0 diff --git a/tests/f_rehash_dir/image.gz b/tests/f_rehash_dir/image.gz Binary files differnew file mode 100644 index 0000000..4e36dce --- /dev/null +++ b/tests/f_rehash_dir/image.gz diff --git a/tests/f_rehash_dir/name b/tests/f_rehash_dir/name new file mode 100644 index 0000000..a7a869a --- /dev/null +++ b/tests/f_rehash_dir/name @@ -0,0 +1 @@ +optimize htree directories diff --git a/tests/f_rehash_dir/script b/tests/f_rehash_dir/script new file mode 100644 index 0000000..f4dcb74 --- /dev/null +++ b/tests/f_rehash_dir/script @@ -0,0 +1,3 @@ +FSCK_OPT=-yfD + +. $cmd_dir/run_e2fsck diff --git a/tests/f_resize_inode/expect b/tests/f_resize_inode/expect new file mode 100644 index 0000000..c12c92c --- /dev/null +++ b/tests/f_resize_inode/expect @@ -0,0 +1,159 @@ +mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 +Creating filesystem with 16384 1k blocks and 4096 inodes +Superblock backups stored on blocks: + 1025, 3073, 5121, 7169, 9217 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +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: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 0 +----------------------------------------------- + +debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img +Exit status is 0 +Resize inode not valid. Recreate? yes + +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 +Free blocks count wrong for group #0 (685, counted=686). +Fix? yes + +Free blocks count wrong (13764, counted=13765). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 1 +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: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 0 +----------------------------------------------- + +debugfs -R ''clri <7>'' -w test.img +Exit status is 0 +Resize inode not valid. Recreate? yes + +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 +Free blocks count wrong for group #0 (685, counted=686). +Fix? yes + +Free blocks count wrong (13764, counted=13765). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 1 +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: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 0 +----------------------------------------------- + +debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img +Exit status is 0 +Resize inode not valid. Recreate? yes + +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 +Free blocks count wrong for group #0 (685, counted=686). +Fix? yes + +Free blocks count wrong (13764, counted=13765). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 1 +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: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 0 +----------------------------------------------- + +debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img +Exit status is 0 +ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 1 +----------------------------------------------- + +debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img +Exit status is 0 +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 +Block bitmap differences: -(35--258) -(1059--1282) -(3107--3330) -(5155--5378) -(7203--7426) -(9251--9474) +Fix? yes + +Free blocks count wrong for group #0 (686, counted=910). +Fix? yes + +Free blocks count wrong for group #1 (700, counted=924). +Fix? yes + +Free blocks count wrong for group #3 (700, counted=924). +Fix? yes + +Free blocks count wrong for group #5 (700, counted=924). +Fix? yes + +Free blocks count wrong for group #7 (700, counted=924). +Fix? yes + +Free blocks count wrong for group #9 (700, counted=924). +Fix? yes + +Free blocks count wrong (13765, counted=15109). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/4096 files (0.0% non-contiguous), 1275/16384 blocks +Exit status is 1 +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: 11/4096 files (0.0% non-contiguous), 1275/16384 blocks +Exit status is 0 diff --git a/tests/f_resize_inode/script b/tests/f_resize_inode/script new file mode 100644 index 0000000..58915a7 --- /dev/null +++ b/tests/f_resize_inode/script @@ -0,0 +1,115 @@ +test_description="e2fsck with resize_inode" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT.new +$MKE2FS -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo ----------------------------------------------- >> $OUT.new + +echo " " >> $OUT.new +echo "debugfs -R ''set_inode_field <7> block[2] 42'' -w test.img" >> $OUT.new +$DEBUGFS -R "set_inode_field <7> block[2] 42" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo ----------------------------------------------- >> $OUT.new + +echo " " >> $OUT.new +echo "debugfs -R ''clri <7>'' -w test.img" >> $OUT.new +$DEBUGFS -R "clri <7>" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo ----------------------------------------------- >> $OUT.new + +echo " " >> $OUT.new +echo "debugfs -R ''set_inode_field <7> bmap[524] 57'' -w test.img" >> $OUT.new +$DEBUGFS -R "set_inode_field <7> bmap[524] 57" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo ----------------------------------------------- >> $OUT.new + +echo " " >> $OUT.new +echo "debugfs -R ''set_super_value reserved_gdt_blocks 15679'' -w test.img" >> $OUT.new +$DEBUGFS -R "set_super_value reserved_gdt_blocks 15679" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo ----------------------------------------------- >> $OUT.new + +echo " " >> $OUT.new +echo "debugfs -R ''set_super_value reserved_gdt_blocks 32'' -w test.img" >> $OUT.new +$DEBUGFS -R "set_super_value reserved_gdt_blocks 32" -w $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_resize_inode_meta_bg/expect.1 b/tests/f_resize_inode_meta_bg/expect.1 new file mode 100644 index 0000000..e248083 --- /dev/null +++ b/tests/f_resize_inode_meta_bg/expect.1 @@ -0,0 +1,70 @@ +Resize_inode and meta_bg features are enabled. Those features are +not compatible. Resize inode should be disabled. Fix? yes + +Resize_inode not enabled, but the resize inode is non-zero. Clear? yes + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +First entry '' (inode=348) in directory inode 2 (???) should be '.' +Fix? yes + +Missing '..' in directory inode 2. +Fix? yes + +Directory inode 2, block #0, offset 860: directory corrupted +Salvage? yes + +Entry '' in ??? (2) has rec_len of 0, should be 12. +Fix? yes + +Directory inode 11, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 11. +Fix? yes + +Missing '..' in directory inode 11. +Fix? yes + +Directory inode 11, block #1, offset 0: directory corrupted +Salvage? yes + +Directory inode 11, block #2, offset 0: directory corrupted +Salvage? yes + +Entry '' in ??? (11) has a zero-length name. +Clear? yes + +Directory inode 11, block #3, offset 864: directory corrupted +Salvage? yes + +Entry '' in ??? (11) has rec_len of 0, should be 12. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in / (2) is <The NULL inode> (0), should be / (2). +Fix? yes + +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 11 ref count is 3, should be 2. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -246 +Fix? yes + +Free blocks count wrong for group #0 (160, counted=161). +Fix? yes + +Free blocks count wrong (2714, counted=2715). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/960 files (0.0% non-contiguous), 1125/3840 blocks +Exit status is 1 diff --git a/tests/f_resize_inode_meta_bg/expect.2 b/tests/f_resize_inode_meta_bg/expect.2 new file mode 100644 index 0000000..0df9a40 --- /dev/null +++ b/tests/f_resize_inode_meta_bg/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/960 files (0.0% non-contiguous), 1125/3840 blocks +Exit status is 0 diff --git a/tests/f_resize_inode_meta_bg/image.gz b/tests/f_resize_inode_meta_bg/image.gz Binary files differnew file mode 100644 index 0000000..9966a7c --- /dev/null +++ b/tests/f_resize_inode_meta_bg/image.gz diff --git a/tests/f_resize_inode_meta_bg/name b/tests/f_resize_inode_meta_bg/name new file mode 100644 index 0000000..9493654 --- /dev/null +++ b/tests/f_resize_inode_meta_bg/name @@ -0,0 +1 @@ +conflicting features resize_inode and meta_bg diff --git a/tests/f_salvage_dir/expect.1 b/tests/f_salvage_dir/expect.1 new file mode 100644 index 0000000..3286384 --- /dev/null +++ b/tests/f_salvage_dir/expect.1 @@ -0,0 +1,19 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 13, block #0, offset 48: directory corrupted +Salvage? yes + +Directory inode 12, block #1, offset 0: directory corrupted +Salvage? yes + +Setting filetype for entry 'c' in /test (12) to 1. +Directory inode 12, block #1, offset 1016: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 19/64 files (10.5% non-contiguous), 30/100 blocks +Exit status is 1 diff --git a/tests/f_salvage_dir/expect.2 b/tests/f_salvage_dir/expect.2 new file mode 100644 index 0000000..0b77cd1 --- /dev/null +++ b/tests/f_salvage_dir/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: 19/64 files (10.5% non-contiguous), 30/100 blocks +Exit status is 0 diff --git a/tests/f_salvage_dir/image.gz b/tests/f_salvage_dir/image.gz Binary files differnew file mode 100644 index 0000000..b0adde7 --- /dev/null +++ b/tests/f_salvage_dir/image.gz diff --git a/tests/f_salvage_dir/name b/tests/f_salvage_dir/name new file mode 100644 index 0000000..746f43a --- /dev/null +++ b/tests/f_salvage_dir/name @@ -0,0 +1 @@ +salvage corrupted directories diff --git a/tests/f_sb_extra_isize/expect.1 b/tests/f_sb_extra_isize/expect.1 new file mode 100644 index 0000000..75e239b --- /dev/null +++ b/tests/f_sb_extra_isize/expect.1 @@ -0,0 +1,13 @@ +Bad required extra isize in superblock (1). Fix? yes + +Bad desired extra isize in superblock (1024). Fix? yes + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32 files (0.0% non-contiguous), 28/200 blocks +Exit status is 1 diff --git a/tests/f_sb_extra_isize/expect.2 b/tests/f_sb_extra_isize/expect.2 new file mode 100644 index 0000000..c7e0e5f --- /dev/null +++ b/tests/f_sb_extra_isize/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: 11/32 files (0.0% non-contiguous), 28/200 blocks +Exit status is 0 diff --git a/tests/f_sb_extra_isize/image.gz b/tests/f_sb_extra_isize/image.gz Binary files differnew file mode 100644 index 0000000..a7cb827 --- /dev/null +++ b/tests/f_sb_extra_isize/image.gz diff --git a/tests/f_sb_extra_isize/name b/tests/f_sb_extra_isize/name new file mode 100644 index 0000000..45bab4f --- /dev/null +++ b/tests/f_sb_extra_isize/name @@ -0,0 +1 @@ +check invalid extra_isize fields in superblock diff --git a/tests/f_selinux/expect.1 b/tests/f_selinux/expect.1 new file mode 100644 index 0000000..d6fcd3b --- /dev/null +++ b/tests/f_selinux/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: 16/16 files (0.0% non-contiguous), 21/96 blocks +Exit status is 0 diff --git a/tests/f_selinux/expect.2 b/tests/f_selinux/expect.2 new file mode 100644 index 0000000..d6fcd3b --- /dev/null +++ b/tests/f_selinux/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: 16/16 files (0.0% non-contiguous), 21/96 blocks +Exit status is 0 diff --git a/tests/f_selinux/image.gz b/tests/f_selinux/image.gz Binary files differnew file mode 100644 index 0000000..93a67a2 --- /dev/null +++ b/tests/f_selinux/image.gz diff --git a/tests/f_selinux/name b/tests/f_selinux/name new file mode 100644 index 0000000..4cdf4d2 --- /dev/null +++ b/tests/f_selinux/name @@ -0,0 +1 @@ +SELinux generated symlinks with EA data diff --git a/tests/f_shared_blocks_ok/expect.1 b/tests/f_shared_blocks_ok/expect.1 new file mode 100644 index 0000000..de4363b --- /dev/null +++ b/tests/f_shared_blocks_ok/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: 13/32 files (0.0% non-contiguous), 12/64 blocks +Exit status is 0 diff --git a/tests/f_shared_blocks_ok/expect.2 b/tests/f_shared_blocks_ok/expect.2 new file mode 100644 index 0000000..de4363b --- /dev/null +++ b/tests/f_shared_blocks_ok/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: 13/32 files (0.0% non-contiguous), 12/64 blocks +Exit status is 0 diff --git a/tests/f_shared_blocks_ok/image.gz b/tests/f_shared_blocks_ok/image.gz Binary files differnew file mode 100644 index 0000000..db747e2 --- /dev/null +++ b/tests/f_shared_blocks_ok/image.gz diff --git a/tests/f_shared_blocks_ok/name b/tests/f_shared_blocks_ok/name new file mode 100644 index 0000000..c77dbbd --- /dev/null +++ b/tests/f_shared_blocks_ok/name @@ -0,0 +1 @@ +clean check for intentionally shared blocks diff --git a/tests/f_short_encrypted_dirent/expect.1 b/tests/f_short_encrypted_dirent/expect.1 new file mode 100644 index 0000000..29e1625 --- /dev/null +++ b/tests/f_short_encrypted_dirent/expect.1 @@ -0,0 +1,17 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Encrypted entry 'motd' in /get_shorty (12) is too short. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached inode 13 +Connect to /lost+found? yes + +Inode 13 ref count is 2, should be 1. Fix? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/16 files (0.0% non-contiguous), 24/100 blocks +Exit status is 1 diff --git a/tests/f_short_encrypted_dirent/expect.2 b/tests/f_short_encrypted_dirent/expect.2 new file mode 100644 index 0000000..1ebd598 --- /dev/null +++ b/tests/f_short_encrypted_dirent/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: 13/16 files (0.0% non-contiguous), 24/100 blocks +Exit status is 0 diff --git a/tests/f_short_encrypted_dirent/image.gz b/tests/f_short_encrypted_dirent/image.gz Binary files differnew file mode 100644 index 0000000..7eb1c95 --- /dev/null +++ b/tests/f_short_encrypted_dirent/image.gz diff --git a/tests/f_short_encrypted_dirent/name b/tests/f_short_encrypted_dirent/name new file mode 100644 index 0000000..a35028a --- /dev/null +++ b/tests/f_short_encrypted_dirent/name @@ -0,0 +1 @@ +short encrypted directory entry diff --git a/tests/f_special_ea/expect.1 b/tests/f_special_ea/expect.1 new file mode 100644 index 0000000..54076fe --- /dev/null +++ b/tests/f_special_ea/expect.1 @@ -0,0 +1,11 @@ +Backing up journal inode block information. + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 17/1024 files (0.0% non-contiguous), 1180/4096 blocks +Exit status is 1 diff --git a/tests/f_special_ea/image.gz b/tests/f_special_ea/image.gz Binary files differnew file mode 100644 index 0000000..c447cb7 --- /dev/null +++ b/tests/f_special_ea/image.gz diff --git a/tests/f_special_ea/name b/tests/f_special_ea/name new file mode 100644 index 0000000..e9fd85b --- /dev/null +++ b/tests/f_special_ea/name @@ -0,0 +1 @@ +special files with extended attributes diff --git a/tests/f_special_ea/script b/tests/f_special_ea/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_special_ea/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_summary_counts/expect.1 b/tests/f_summary_counts/expect.1 new file mode 100644 index 0000000..ddb14bd --- /dev/null +++ b/tests/f_summary_counts/expect.1 @@ -0,0 +1,19 @@ +test_filesys contains a file system with errors, check forced. +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 +Free blocks count wrong for group #0 (200, counted=80). +Fix? yes + +Free inodes count wrong for group #0 (250, counted=5). +Fix? yes + +Directories count wrong for group #0 (150, counted=2). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 1 diff --git a/tests/f_summary_counts/expect.2 b/tests/f_summary_counts/expect.2 new file mode 100644 index 0000000..44bff62 --- /dev/null +++ b/tests/f_summary_counts/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: 11/16 files (0.0% non-contiguous), 20/100 blocks +Exit status is 0 diff --git a/tests/f_summary_counts/image.gz b/tests/f_summary_counts/image.gz Binary files differnew file mode 100644 index 0000000..d527e9a --- /dev/null +++ b/tests/f_summary_counts/image.gz diff --git a/tests/f_summary_counts/name b/tests/f_summary_counts/name new file mode 100644 index 0000000..9fd1021 --- /dev/null +++ b/tests/f_summary_counts/name @@ -0,0 +1 @@ +incorrect inode/block free counts diff --git a/tests/f_summary_counts/script b/tests/f_summary_counts/script new file mode 100644 index 0000000..fc425ef --- /dev/null +++ b/tests/f_summary_counts/script @@ -0,0 +1,4 @@ +FSCK_OPT=-y +SECOND_FSCK_OPT=-yf + +. $cmd_dir/run_e2fsck diff --git a/tests/f_super_bad_csum/expect.1 b/tests/f_super_bad_csum/expect.1 new file mode 100644 index 0000000..12adee9 --- /dev/null +++ b/tests/f_super_bad_csum/expect.1 @@ -0,0 +1,13 @@ +ext2fs_open2: Superblock checksum does not match superblock +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +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 +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/1024 files (0.0% non-contiguous), 1557/16384 blocks +Exit status is 0 diff --git a/tests/f_super_bad_csum/expect.2 b/tests/f_super_bad_csum/expect.2 new file mode 100644 index 0000000..dd20919 --- /dev/null +++ b/tests/f_super_bad_csum/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: 11/1024 files (0.0% non-contiguous), 1557/16384 blocks +Exit status is 0 diff --git a/tests/f_super_bad_csum/image.bz2 b/tests/f_super_bad_csum/image.bz2 Binary files differnew file mode 100644 index 0000000..cd80d4b --- /dev/null +++ b/tests/f_super_bad_csum/image.bz2 diff --git a/tests/f_super_bad_csum/name b/tests/f_super_bad_csum/name new file mode 100644 index 0000000..745562f --- /dev/null +++ b/tests/f_super_bad_csum/name @@ -0,0 +1 @@ +bad csum in superblock (metadata_csum) diff --git a/tests/f_super_bad_csum/script b/tests/f_super_bad_csum/script new file mode 100755 index 0000000..5c89962 --- /dev/null +++ b/tests/f_super_bad_csum/script @@ -0,0 +1,33 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE +#e2label $TMPFILE test_filesys + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log +rm -f $test_name.failed $test_name.ok + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi +unset EXP1 OUT1 EXP2 OUT2 FSCK_OPT IMAGE diff --git a/tests/f_toobig_extent_dir/expect.1 b/tests/f_toobig_extent_dir/expect.1 new file mode 100644 index 0000000..610ca3f --- /dev/null +++ b/tests/f_toobig_extent_dir/expect.1 @@ -0,0 +1,12 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 is too big. Truncate? yes + +Block #4294967281 (90) causes directory to be too big. CLEARED. +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/56 files (0.0% non-contiguous), 28/400 blocks +Exit status is 1 diff --git a/tests/f_toobig_extent_dir/expect.2 b/tests/f_toobig_extent_dir/expect.2 new file mode 100644 index 0000000..c025645 --- /dev/null +++ b/tests/f_toobig_extent_dir/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/56 files (0.0% non-contiguous), 28/400 blocks +Exit status is 0 diff --git a/tests/f_toobig_extent_dir/image.gz b/tests/f_toobig_extent_dir/image.gz Binary files differnew file mode 100644 index 0000000..622f65a --- /dev/null +++ b/tests/f_toobig_extent_dir/image.gz diff --git a/tests/f_toobig_extent_dir/name b/tests/f_toobig_extent_dir/name new file mode 100644 index 0000000..d7453ad --- /dev/null +++ b/tests/f_toobig_extent_dir/name @@ -0,0 +1 @@ +directory with a very large lblk in extent diff --git a/tests/f_trunc_dirent_header/expect.1 b/tests/f_trunc_dirent_header/expect.1 new file mode 100644 index 0000000..33ce473 --- /dev/null +++ b/tests/f_trunc_dirent_header/expect.1 @@ -0,0 +1,15 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 15, block #0, offset 4092: directory corrupted +Salvage? yes + +Directory inode 13, block #1, offset 28: directory corrupted +Salvage? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 32/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_trunc_dirent_header/expect.2 b/tests/f_trunc_dirent_header/expect.2 new file mode 100644 index 0000000..df81c9d --- /dev/null +++ b/tests/f_trunc_dirent_header/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: 32/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_trunc_dirent_header/image.gz b/tests/f_trunc_dirent_header/image.gz Binary files differnew file mode 100644 index 0000000..9c59bf4 --- /dev/null +++ b/tests/f_trunc_dirent_header/image.gz diff --git a/tests/f_trunc_dirent_header/name b/tests/f_trunc_dirent_header/name new file mode 100644 index 0000000..e244dbf --- /dev/null +++ b/tests/f_trunc_dirent_header/name @@ -0,0 +1 @@ +no space for dirent header at end of buf diff --git a/tests/f_uninit_bad_free_inodes/expect.1 b/tests/f_uninit_bad_free_inodes/expect.1 new file mode 100644 index 0000000..23d7b1f --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/expect.1 @@ -0,0 +1,25 @@ +Group descriptor 1 has invalid unused inodes count 2048. Fix? yes + +Group descriptor 2 has invalid unused inodes count 1344. Fix? yes + +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 +Free inodes count wrong for group #1 (490, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (250, counted=1344). +Fix? yes + +Free inodes count wrong for group #3 (1967, counted=1969). +Fix? yes + +Free inodes count wrong (4744, counted=7398). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_bad_free_inodes/expect.2 b/tests/f_uninit_bad_free_inodes/expect.2 new file mode 100644 index 0000000..431227b --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/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: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_bad_free_inodes/image.gz b/tests/f_uninit_bad_free_inodes/image.gz Binary files differnew file mode 100644 index 0000000..3e6218b --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/image.gz diff --git a/tests/f_uninit_bad_free_inodes/name b/tests/f_uninit_bad_free_inodes/name new file mode 100644 index 0000000..8bd3180 --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/name @@ -0,0 +1 @@ +bad free inode count, but good checksum diff --git a/tests/f_uninit_blk_used_not_set/expect.1 b/tests/f_uninit_blk_used_not_set/expect.1 new file mode 100644 index 0000000..9e473f8 --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/expect.1 @@ -0,0 +1,34 @@ +Group descriptor 1 has invalid unused inodes count 2048. Fix? yes + +Group descriptor 2 has invalid unused inodes count 2048. Fix? yes + +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 +Group 1 block(s) in use but group is marked BLOCK_UNINIT +Fix? yes + +Block bitmap differences: +(8585--8777) +Fix? yes + +Free blocks count wrong for group #2 (0, counted=7934). +Fix? yes + +Free blocks count wrong (19530, counted=27464). +Fix? yes + +Free inodes count wrong for group #1 (0, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=2048). +Fix? yes + +Free inodes count wrong (4084, counted=8180). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/8192 files (8.3% non-contiguous), 5304/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_blk_used_not_set/expect.2 b/tests/f_uninit_blk_used_not_set/expect.2 new file mode 100644 index 0000000..17d0cfa --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/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/8192 files (8.3% non-contiguous), 5304/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_blk_used_not_set/image.gz b/tests/f_uninit_blk_used_not_set/image.gz Binary files differnew file mode 100644 index 0000000..6316285 --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/image.gz diff --git a/tests/f_uninit_blk_used_not_set/name b/tests/f_uninit_blk_used_not_set/name new file mode 100644 index 0000000..e6ee718 --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/name @@ -0,0 +1 @@ +blocks used but block uninit set diff --git a/tests/f_uninit_cat/expect b/tests/f_uninit_cat/expect Binary files differnew file mode 100644 index 0000000..0c0a5cf --- /dev/null +++ b/tests/f_uninit_cat/expect diff --git a/tests/f_uninit_cat/image.gz b/tests/f_uninit_cat/image.gz Binary files differnew file mode 100644 index 0000000..d2ae66c --- /dev/null +++ b/tests/f_uninit_cat/image.gz diff --git a/tests/f_uninit_cat/name b/tests/f_uninit_cat/name new file mode 100644 index 0000000..f6b5674 --- /dev/null +++ b/tests/f_uninit_cat/name @@ -0,0 +1 @@ +cat a file with uninit blocks diff --git a/tests/f_uninit_cat/script b/tests/f_uninit_cat/script new file mode 100755 index 0000000..31a1988 --- /dev/null +++ b/tests/f_uninit_cat/script @@ -0,0 +1,36 @@ +#!/bin/bash + +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi +FSCK_OPT=-fy +IMAGE=$test_dir/image.gz + +gzip -d < $IMAGE > $TMPFILE +#e2label $TMPFILE test_filesys + +# Run fsck to fix things? +EXP=$test_dir/expect +OUT=$test_name.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +echo "Exit status is $?" >> $OUT.new + +echo "debugfs cat uninit file" >> $OUT.new +echo "ex /a" > $TMPFILE.cmd +echo "cat /a" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +echo >> $OUT.new +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT +rm -f $OUT.new $TMPFILE $TMPFILE.cmd + +# Figure out what happened +if cmp -s $EXP $OUT; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT >> $test_name.failed +fi +unset EXP OUT FSCK_OPT IMAGE diff --git a/tests/f_uninit_checksum_bad/expect.1 b/tests/f_uninit_checksum_bad/expect.1 new file mode 100644 index 0000000..4ff8a8b --- /dev/null +++ b/tests/f_uninit_checksum_bad/expect.1 @@ -0,0 +1,29 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 1 checksum is 0xbbaa, should be 0xff0b. FIXED. +Group descriptor 2 has invalid unused inodes count 2048. Fix? yes + +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 +Free blocks count wrong for group #2 (0, counted=7934). +Fix? yes + +Free blocks count wrong (19286, counted=27220). +Fix? yes + +Free inodes count wrong for group #1 (0, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=2048). +Fix? yes + +Free inodes count wrong (4085, counted=8181). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 5548/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_checksum_bad/expect.2 b/tests/f_uninit_checksum_bad/expect.2 new file mode 100644 index 0000000..38f2334 --- /dev/null +++ b/tests/f_uninit_checksum_bad/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: 11/8192 files (0.0% non-contiguous), 5548/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_checksum_bad/image.gz b/tests/f_uninit_checksum_bad/image.gz Binary files differnew file mode 100644 index 0000000..8e91e01 --- /dev/null +++ b/tests/f_uninit_checksum_bad/image.gz diff --git a/tests/f_uninit_checksum_bad/name b/tests/f_uninit_checksum_bad/name new file mode 100644 index 0000000..b9e4a31 --- /dev/null +++ b/tests/f_uninit_checksum_bad/name @@ -0,0 +1 @@ +invalid group descriptor checksum diff --git a/tests/f_uninit_dir/expect.1 b/tests/f_uninit_dir/expect.1 new file mode 100644 index 0000000..31870bd --- /dev/null +++ b/tests/f_uninit_dir/expect.1 @@ -0,0 +1,25 @@ +Pass 1: Checking inodes, blocks, and sizes +Directory inode 12 has extent marked uninitialized at block 0. Fix? yes + +Directory inode 14 has extent marked uninitialized at block 0. Fix? yes + +Pass 2: Checking directory structure +Directory inode 14, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 14. +Fix? yes + +Missing '..' in directory inode 14. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in /abc (14) is <The NULL inode> (0), should be / (2). +Fix? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (0.0% non-contiguous), 20/512 blocks +Exit status is 1 diff --git a/tests/f_uninit_dir/expect.2 b/tests/f_uninit_dir/expect.2 new file mode 100644 index 0000000..7b28f43 --- /dev/null +++ b/tests/f_uninit_dir/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: 14/128 files (0.0% non-contiguous), 20/512 blocks +Exit status is 0 diff --git a/tests/f_uninit_dir/image.gz b/tests/f_uninit_dir/image.gz Binary files differnew file mode 100644 index 0000000..ac9131d --- /dev/null +++ b/tests/f_uninit_dir/image.gz diff --git a/tests/f_uninit_dir/name b/tests/f_uninit_dir/name new file mode 100644 index 0000000..d7f5bee --- /dev/null +++ b/tests/f_uninit_dir/name @@ -0,0 +1 @@ +fix uninit flag on directory extents and check the dir blocks diff --git a/tests/f_uninit_disable/expect.1 b/tests/f_uninit_disable/expect.1 new file mode 100644 index 0000000..f568bec --- /dev/null +++ b/tests/f_uninit_disable/expect.1 @@ -0,0 +1,10 @@ +Group descriptor 0 marked uninitialized without feature set. +Fix? yes + +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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_disable/expect.2 b/tests/f_uninit_disable/expect.2 new file mode 100644 index 0000000..4cd9aa9 --- /dev/null +++ b/tests/f_uninit_disable/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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_disable/image.gz b/tests/f_uninit_disable/image.gz Binary files differnew file mode 100644 index 0000000..38c7455 --- /dev/null +++ b/tests/f_uninit_disable/image.gz diff --git a/tests/f_uninit_disable/name b/tests/f_uninit_disable/name new file mode 100644 index 0000000..494b472 --- /dev/null +++ b/tests/f_uninit_disable/name @@ -0,0 +1 @@ +disable uninit_bg feature diff --git a/tests/f_uninit_enable/expect.1 b/tests/f_uninit_enable/expect.1 new file mode 100644 index 0000000..02801bf --- /dev/null +++ b/tests/f_uninit_enable/expect.1 @@ -0,0 +1,10 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x0000, should be 0x13f6. FIXED. +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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_enable/expect.2 b/tests/f_uninit_enable/expect.2 new file mode 100644 index 0000000..4cd9aa9 --- /dev/null +++ b/tests/f_uninit_enable/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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_enable/image.gz b/tests/f_uninit_enable/image.gz Binary files differnew file mode 100644 index 0000000..4da79c9 --- /dev/null +++ b/tests/f_uninit_enable/image.gz diff --git a/tests/f_uninit_enable/name b/tests/f_uninit_enable/name new file mode 100644 index 0000000..a818f5c --- /dev/null +++ b/tests/f_uninit_enable/name @@ -0,0 +1 @@ +enable uninit_bg feature diff --git a/tests/f_uninit_ext_past_eof/expect.1 b/tests/f_uninit_ext_past_eof/expect.1 new file mode 100644 index 0000000..762159c --- /dev/null +++ b/tests/f_uninit_ext_past_eof/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_uninit_ext_past_eof/expect.2 b/tests/f_uninit_ext_past_eof/expect.2 new file mode 100644 index 0000000..762159c --- /dev/null +++ b/tests/f_uninit_ext_past_eof/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_uninit_ext_past_eof/image.gz b/tests/f_uninit_ext_past_eof/image.gz Binary files differnew file mode 100644 index 0000000..0b69158 --- /dev/null +++ b/tests/f_uninit_ext_past_eof/image.gz diff --git a/tests/f_uninit_ext_past_eof/name b/tests/f_uninit_ext_past_eof/name new file mode 100644 index 0000000..9e0c6e0 --- /dev/null +++ b/tests/f_uninit_ext_past_eof/name @@ -0,0 +1 @@ +fallocated extents after i_size diff --git a/tests/f_uninit_ext_past_eof2/expect.1 b/tests/f_uninit_ext_past_eof2/expect.1 new file mode 100644 index 0000000..eb8248e --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/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/16 files (8.3% non-contiguous), 70/100 blocks +Exit status is 0 diff --git a/tests/f_uninit_ext_past_eof2/expect.2 b/tests/f_uninit_ext_past_eof2/expect.2 new file mode 100644 index 0000000..eb8248e --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/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/16 files (8.3% non-contiguous), 70/100 blocks +Exit status is 0 diff --git a/tests/f_uninit_ext_past_eof2/image.gz b/tests/f_uninit_ext_past_eof2/image.gz Binary files differnew file mode 100644 index 0000000..c739e49 --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/image.gz diff --git a/tests/f_uninit_ext_past_eof2/name b/tests/f_uninit_ext_past_eof2/name new file mode 100644 index 0000000..025cc44 --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/name @@ -0,0 +1 @@ +fallocate extents w/ nonzero i_size and extents > 4 diff --git a/tests/f_uninit_inode_past_unused/expect.1 b/tests/f_uninit_inode_past_unused/expect.1 new file mode 100644 index 0000000..de1ac23 --- /dev/null +++ b/tests/f_uninit_inode_past_unused/expect.1 @@ -0,0 +1,24 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo' in / (2) references inode 14 found in group 0's unused inodes area. +Fix? yes + +Restarting e2fsck from the beginning... +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 +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (2037, counted=2035). +Fix? yes + +Free inodes count wrong (4073, counted=2035). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_inode_past_unused/expect.2 b/tests/f_uninit_inode_past_unused/expect.2 new file mode 100644 index 0000000..bdb029e --- /dev/null +++ b/tests/f_uninit_inode_past_unused/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: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_inode_past_unused/image.gz b/tests/f_uninit_inode_past_unused/image.gz Binary files differnew file mode 100644 index 0000000..9104a70 --- /dev/null +++ b/tests/f_uninit_inode_past_unused/image.gz diff --git a/tests/f_uninit_inode_past_unused/name b/tests/f_uninit_inode_past_unused/name new file mode 100644 index 0000000..95d07f1 --- /dev/null +++ b/tests/f_uninit_inode_past_unused/name @@ -0,0 +1 @@ +inode in use beyond bg_itable_unused diff --git a/tests/f_uninit_last_uninit/expect.1 b/tests/f_uninit_last_uninit/expect.1 new file mode 100644 index 0000000..a9a9dc1 --- /dev/null +++ b/tests/f_uninit_last_uninit/expect.1 @@ -0,0 +1,9 @@ +Last group block bitmap uninitialized. Fix? yes + +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: 11/32 files (0.0% non-contiguous), 109/10000 blocks +Exit status is 0 diff --git a/tests/f_uninit_last_uninit/expect.2 b/tests/f_uninit_last_uninit/expect.2 new file mode 100644 index 0000000..4593717 --- /dev/null +++ b/tests/f_uninit_last_uninit/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: 11/32 files (0.0% non-contiguous), 109/10000 blocks +Exit status is 0 diff --git a/tests/f_uninit_last_uninit/name b/tests/f_uninit_last_uninit/name new file mode 100644 index 0000000..609e684 --- /dev/null +++ b/tests/f_uninit_last_uninit/name @@ -0,0 +1 @@ +last group has BLOCK_UNINIT set diff --git a/tests/f_uninit_last_uninit/script b/tests/f_uninit_last_uninit/script new file mode 100644 index 0000000..53105a4 --- /dev/null +++ b/tests/f_uninit_last_uninit/script @@ -0,0 +1,25 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +SKIP_GUNZIP="true" + +touch $TMPFILE +$MKE2FS -N 32 -F -o Linux -O uninit_bg -b 1024 $TMPFILE 10000 > /dev/null 2>&1 +$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1 +set_current_time 20070410210000 +set_super_value lastcheck 0 +set_super_value hash_seed null +set_super_value mkfs_time 0 +set_bg 1 flags 0x7 +set_bg 1 checksum calc +q +EOF + +E2FSCK_TIME=200704102100 +export E2FSCK_TIME + +. $cmd_dir/run_e2fsck + +unset E2FSCK_TIME diff --git a/tests/f_uninit_restart_fsck/expect.1 b/tests/f_uninit_restart_fsck/expect.1 new file mode 100644 index 0000000..64a2d06 --- /dev/null +++ b/tests/f_uninit_restart_fsck/expect.1 @@ -0,0 +1,32 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo2' in /d1 (1881) references inode 500 found in group 0's unused inodes area. +Fix? yes + +Entry 'foo2' in /d1 (1881) has an incorrect filetype (was 1, should be 0). +Fix? yes + +Entry 'bar2' in /d2 (3761) references inode 2100 found in group 1's unused inodes area. +Fix? yes + +Entry 'bar2' in /d2 (3761) has an incorrect filetype (was 1, should be 0). +Fix? yes + +Restarting e2fsck from the beginning... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo2' in /d1 (1881) has deleted/unused inode 500. Clear? yes + +Entry 'bar2' in /d2 (3761) has deleted/unused inode 2100. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached zero-length inode 1883. Clear? yes + +Unattached zero-length inode 3763. Clear? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks +Exit status is 1 diff --git a/tests/f_uninit_restart_fsck/expect.2 b/tests/f_uninit_restart_fsck/expect.2 new file mode 100644 index 0000000..156eb07 --- /dev/null +++ b/tests/f_uninit_restart_fsck/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: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks +Exit status is 0 diff --git a/tests/f_uninit_restart_fsck/image.gz b/tests/f_uninit_restart_fsck/image.gz Binary files differnew file mode 100644 index 0000000..f073186 --- /dev/null +++ b/tests/f_uninit_restart_fsck/image.gz diff --git a/tests/f_uninit_restart_fsck/name b/tests/f_uninit_restart_fsck/name new file mode 100644 index 0000000..def2234 --- /dev/null +++ b/tests/f_uninit_restart_fsck/name @@ -0,0 +1 @@ +re-start e2fsck only once for inodes in uninit space diff --git a/tests/f_uninit_set_inode_not_set/expect.1 b/tests/f_uninit_set_inode_not_set/expect.1 new file mode 100644 index 0000000..4ea3f10 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/expect.1 @@ -0,0 +1,25 @@ +Group descriptor 1 has invalid unused inodes count 1464. Fix? yes + +Group descriptor 2 has invalid unused inodes count 1849. Fix? yes + +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 +Group 1 block(s) in use but group is marked BLOCK_UNINIT +Fix? yes + +Block bitmap differences: +(9729--14621) +Fix? yes + +Free inodes count wrong for group #1 (0, counted=1464). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=1849). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_set_inode_not_set/expect.2 b/tests/f_uninit_set_inode_not_set/expect.2 new file mode 100644 index 0000000..846c558 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/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: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_set_inode_not_set/image.gz b/tests/f_uninit_set_inode_not_set/image.gz Binary files differnew file mode 100644 index 0000000..cd38e27 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/image.gz diff --git a/tests/f_uninit_set_inode_not_set/name b/tests/f_uninit_set_inode_not_set/name new file mode 100644 index 0000000..42b9c53 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/name @@ -0,0 +1 @@ +block uninit set but inode uninit not set diff --git a/tests/f_unshare_blocks_no_space/expect.1 b/tests/f_unshare_blocks_no_space/expect.1 new file mode 100644 index 0000000..b2f6ab1 --- /dev/null +++ b/tests/f_unshare_blocks_no_space/expect.1 @@ -0,0 +1,136 @@ +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 24: 10 +Multiply-claimed block(s) in inode 25: 9 9 9--10 +Multiply-claimed block(s) in inode 26: 9 9 9--10 +Multiply-claimed block(s) in inode 27: 9 9 9--10 +Multiply-claimed block(s) in inode 28: 9 9 9--10 +Multiply-claimed block(s) in inode 29: 9 9 9--10 +Multiply-claimed block(s) in inode 30: 9 9 9--10 +Multiply-claimed block(s) in inode 31: 9 9 9--10 +Multiply-claimed block(s) in inode 32: 9 9 9--10 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 9 inodes containing multiply-claimed blocks.) + +File /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) + has 1 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +File /file18.txt (inode #32, mod time Mon Mar 5 20:30:04 2018) + has 4 multiply-claimed block(s), shared with 8 file(s): + /file6.txt (inode #31, mod time Mon Mar 5 20:30:04 2018) + /file12.txt (inode #30, mod time Mon Mar 5 20:30:04 2018) + /file3.txt (inode #29, mod time Mon Mar 5 20:30:04 2018) + /file9.txt (inode #28, mod time Mon Mar 5 20:30:04 2018) + /file8.txt (inode #27, mod time Mon Mar 5 20:30:04 2018) + /file15.txt (inode #26, mod time Mon Mar 5 20:30:04 2018) + /file20.txt (inode #25, mod time Mon Mar 5 20:30:04 2018) + /file4.txt (inode #24, mod time Mon Mar 5 20:30:04 2018) +clone_file: Could not allocate block in ext2 filesystem returned from clone_file_block +Couldn't clone file: Could not allocate block in ext2 filesystem +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +test_filesys: 32/32 files (34.4% non-contiguous), 64/64 blocks +Exit status is 4 diff --git a/tests/f_unshare_blocks_no_space/expect.2 b/tests/f_unshare_blocks_no_space/expect.2 new file mode 100644 index 0000000..8137dc7 --- /dev/null +++ b/tests/f_unshare_blocks_no_space/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: 32/32 files (34.4% non-contiguous), 64/64 blocks +Exit status is 1 diff --git a/tests/f_unshare_blocks_no_space/image.gz b/tests/f_unshare_blocks_no_space/image.gz Binary files differnew file mode 100644 index 0000000..8fff6d4 --- /dev/null +++ b/tests/f_unshare_blocks_no_space/image.gz diff --git a/tests/f_unshare_blocks_no_space/name b/tests/f_unshare_blocks_no_space/name new file mode 100644 index 0000000..ca323a6 --- /dev/null +++ b/tests/f_unshare_blocks_no_space/name @@ -0,0 +1 @@ +unshare blocks should fail with no free space diff --git a/tests/f_unshare_blocks_no_space/script b/tests/f_unshare_blocks_no_space/script new file mode 100644 index 0000000..89d2aef --- /dev/null +++ b/tests/f_unshare_blocks_no_space/script @@ -0,0 +1,2 @@ +FSCK_OPT="-y -E unshare_blocks" +. $cmd_dir/run_e2fsck diff --git a/tests/f_unshare_blocks_ok/expect.1 b/tests/f_unshare_blocks_ok/expect.1 new file mode 100644 index 0000000..e0ea764 --- /dev/null +++ b/tests/f_unshare_blocks_ok/expect.1 @@ -0,0 +1,26 @@ +Pass 1: Checking inodes, blocks, and sizes + +Running additional passes to resolve blocks claimed by more than one inode... +Pass 1B: Rescanning for multiply-claimed blocks +Multiply-claimed block(s) in inode 12: 9 +Multiply-claimed block(s) in inode 13: 9 +Pass 1C: Scanning directories for inodes with multiply-claimed blocks +Pass 1D: Reconciling multiply-claimed blocks +(There are 2 inodes containing multiply-claimed blocks.) + +File /file2.txt (inode #12, mod time Sat Mar 3 02:12:33 2018) + has 1 multiply-claimed block(s), shared with 1 file(s): + /file1.txt (inode #13, mod time Sat Mar 3 02:12:15 2018) +File /file1.txt (inode #13, mod time Sat Mar 3 02:12:15 2018) + has 1 multiply-claimed block(s), shared with 1 file(s): + /file2.txt (inode #12, mod time Sat Mar 3 02:12:33 2018) +Multiply-claimed blocks already reassigned or cloned. + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/32 files (0.0% non-contiguous), 13/64 blocks +Exit status is 0 diff --git a/tests/f_unshare_blocks_ok/expect.2 b/tests/f_unshare_blocks_ok/expect.2 new file mode 100644 index 0000000..b215382 --- /dev/null +++ b/tests/f_unshare_blocks_ok/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: 13/32 files (0.0% non-contiguous), 13/64 blocks +Exit status is 0 diff --git a/tests/f_unshare_blocks_ok/image.gz b/tests/f_unshare_blocks_ok/image.gz Binary files differnew file mode 100644 index 0000000..db747e2 --- /dev/null +++ b/tests/f_unshare_blocks_ok/image.gz diff --git a/tests/f_unshare_blocks_ok/name b/tests/f_unshare_blocks_ok/name new file mode 100644 index 0000000..e051a62 --- /dev/null +++ b/tests/f_unshare_blocks_ok/name @@ -0,0 +1 @@ +unshare blocks successfully diff --git a/tests/f_unshare_blocks_ok/script b/tests/f_unshare_blocks_ok/script new file mode 100644 index 0000000..89d2aef --- /dev/null +++ b/tests/f_unshare_blocks_ok/script @@ -0,0 +1,2 @@ +FSCK_OPT="-y -E unshare_blocks" +. $cmd_dir/run_e2fsck diff --git a/tests/f_unsorted_EAs/expect.1 b/tests/f_unsorted_EAs/expect.1 new file mode 100644 index 0000000..64b9045 --- /dev/null +++ b/tests/f_unsorted_EAs/expect.1 @@ -0,0 +1,11 @@ +Adding dirhash hint to filesystem. + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/2048 files (0.0% non-contiguous), 1294/2048 blocks +Exit status is 0 diff --git a/tests/f_unsorted_EAs/expect.2 b/tests/f_unsorted_EAs/expect.2 new file mode 100644 index 0000000..414cc29 --- /dev/null +++ b/tests/f_unsorted_EAs/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/2048 files (0.0% non-contiguous), 1294/2048 blocks +Exit status is 0 diff --git a/tests/f_unsorted_EAs/image.gz b/tests/f_unsorted_EAs/image.gz Binary files differnew file mode 100644 index 0000000..42ab502 --- /dev/null +++ b/tests/f_unsorted_EAs/image.gz diff --git a/tests/f_unsorted_EAs/name b/tests/f_unsorted_EAs/name new file mode 100644 index 0000000..da9c9c3 --- /dev/null +++ b/tests/f_unsorted_EAs/name @@ -0,0 +1 @@ +unsorted EAs in inode should not be deleted diff --git a/tests/f_unused_itable/expect.1 b/tests/f_unused_itable/expect.1 new file mode 100644 index 0000000..ffda3c4 --- /dev/null +++ b/tests/f_unused_itable/expect.1 @@ -0,0 +1,24 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo' in / (2) references inode 65 found in group 1's unused inodes area. +Fix? yes + +Entry '1' in / (2) references inode 12 found in group 0's unused inodes area. +Fix? yes + +Restarting e2fsck from the beginning... +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 +Free inodes count wrong for group #0 (53, counted=51). +Fix? yes + +Free inodes count wrong for group #1 (64, counted=58). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 19/128 files (0.0% non-contiguous), 165/1000 blocks +Exit status is 1 diff --git a/tests/f_unused_itable/expect.2 b/tests/f_unused_itable/expect.2 new file mode 100644 index 0000000..b79d318 --- /dev/null +++ b/tests/f_unused_itable/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: 19/128 files (0.0% non-contiguous), 165/1000 blocks +Exit status is 0 diff --git a/tests/f_unused_itable/image.gz b/tests/f_unused_itable/image.gz Binary files differnew file mode 100644 index 0000000..ca93e98 --- /dev/null +++ b/tests/f_unused_itable/image.gz diff --git a/tests/f_unused_itable/name b/tests/f_unused_itable/name new file mode 100644 index 0000000..b899aec --- /dev/null +++ b/tests/f_unused_itable/name @@ -0,0 +1 @@ +don't move files to lost+found for bg_unused_itable diff --git a/tests/f_valid_ea_in_inode/expect.1 b/tests/f_valid_ea_in_inode/expect.1 new file mode 100644 index 0000000..5613bc0 --- /dev/null +++ b/tests/f_valid_ea_in_inode/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: 24/24 files (0.0% non-contiguous), 45/200 blocks +Exit status is 0 diff --git a/tests/f_valid_ea_in_inode/image.gz b/tests/f_valid_ea_in_inode/image.gz Binary files differnew file mode 100644 index 0000000..98e72dc --- /dev/null +++ b/tests/f_valid_ea_in_inode/image.gz diff --git a/tests/f_valid_ea_in_inode/name b/tests/f_valid_ea_in_inode/name new file mode 100644 index 0000000..3f02877 --- /dev/null +++ b/tests/f_valid_ea_in_inode/name @@ -0,0 +1 @@ +valid ea-in-inode examplars diff --git a/tests/f_valid_ea_in_inode/script b/tests/f_valid_ea_in_inode/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_valid_ea_in_inode/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_verity/expect.1 b/tests/f_verity/expect.1 new file mode 100644 index 0000000..0705967 --- /dev/null +++ b/tests/f_verity/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/128 files (8.3% non-contiguous), 58/128 blocks +Exit status is 0 diff --git a/tests/f_verity/image.gz b/tests/f_verity/image.gz Binary files differnew file mode 100644 index 0000000..72dfd81 --- /dev/null +++ b/tests/f_verity/image.gz diff --git a/tests/f_verity/mkimage.sh b/tests/f_verity/mkimage.sh new file mode 100755 index 0000000..565083e --- /dev/null +++ b/tests/f_verity/mkimage.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# This is the script that was used to create the image.gz in this directory. + +set -e -u + +mkdir -p mnt +umount mnt &> /dev/null || true + +dd if=/dev/zero of=image bs=4096 count=128 +mke2fs -O 'verity,extents' -b 4096 -N 128 image +mount image mnt + +# Create a verity file, but make it fragmented so that it needs at least one +# extent tree index node, in order to cover the scan_extent_node() case. +for i in {1..80}; do + head -c 4096 /dev/zero > mnt/tmp_$i +done +for i in {1..80..2}; do + rm mnt/tmp_$i +done +head -c $((40 * 4096)) /dev/zero > mnt/file +fsverity enable mnt/file +rm mnt/tmp_* + +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_verity/name b/tests/f_verity/name new file mode 100644 index 0000000..f43910f --- /dev/null +++ b/tests/f_verity/name @@ -0,0 +1 @@ +verity file diff --git a/tests/f_verity/script b/tests/f_verity/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_verity/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_write_ea_no_extra_isize/expect.1 b/tests/f_write_ea_no_extra_isize/expect.1 new file mode 100644 index 0000000..43d7d36 --- /dev/null +++ b/tests/f_write_ea_no_extra_isize/expect.1 @@ -0,0 +1,29 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Inode 12 is a zero-length directory. Clear? yes + +Pass 2: Checking directory structure +Entry 'x' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Pass 5: Checking group summary information +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (116, counted=117). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (116, counted=117). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_write_ea_no_extra_isize/expect.2 b/tests/f_write_ea_no_extra_isize/expect.2 new file mode 100644 index 0000000..8025ccb --- /dev/null +++ b/tests/f_write_ea_no_extra_isize/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: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_write_ea_no_extra_isize/image.gz b/tests/f_write_ea_no_extra_isize/image.gz Binary files differnew file mode 100644 index 0000000..928daff --- /dev/null +++ b/tests/f_write_ea_no_extra_isize/image.gz diff --git a/tests/f_write_ea_no_extra_isize/name b/tests/f_write_ea_no_extra_isize/name new file mode 100644 index 0000000..200e365 --- /dev/null +++ b/tests/f_write_ea_no_extra_isize/name @@ -0,0 +1 @@ +write EA when i_extra_size is zero diff --git a/tests/f_write_ea_toobig_extra_isize/expect.1 b/tests/f_write_ea_toobig_extra_isize/expect.1 new file mode 100644 index 0000000..fc9ba6c --- /dev/null +++ b/tests/f_write_ea_toobig_extra_isize/expect.1 @@ -0,0 +1,32 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Inode 12 has a extra size (126) which is invalid +Fix? yes + +Inode 12 is a zero-length directory. Clear? yes + +Pass 2: Checking directory structure +Entry 'x' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Pass 5: Checking group summary information +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (116, counted=117). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (116, counted=117). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_write_ea_toobig_extra_isize/expect.2 b/tests/f_write_ea_toobig_extra_isize/expect.2 new file mode 100644 index 0000000..8025ccb --- /dev/null +++ b/tests/f_write_ea_toobig_extra_isize/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: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_write_ea_toobig_extra_isize/image.gz b/tests/f_write_ea_toobig_extra_isize/image.gz Binary files differnew file mode 100644 index 0000000..291924b --- /dev/null +++ b/tests/f_write_ea_toobig_extra_isize/image.gz diff --git a/tests/f_write_ea_toobig_extra_isize/name b/tests/f_write_ea_toobig_extra_isize/name new file mode 100644 index 0000000..a5ed718 --- /dev/null +++ b/tests/f_write_ea_toobig_extra_isize/name @@ -0,0 +1 @@ +write EA when i_extra_size is too big for EA diff --git a/tests/f_write_ea_toosmall_extra_isize/expect.1 b/tests/f_write_ea_toosmall_extra_isize/expect.1 new file mode 100644 index 0000000..8d9381e --- /dev/null +++ b/tests/f_write_ea_toosmall_extra_isize/expect.1 @@ -0,0 +1,32 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? yes + +Inode 12 has a extra size (1) which is invalid +Fix? yes + +Inode 12 is a zero-length directory. Clear? yes + +Pass 2: Checking directory structure +Entry 'x' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 2 ref count is 4, should be 3. Fix? yes + +Pass 5: Checking group summary information +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (116, counted=117). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (116, counted=117). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 1 diff --git a/tests/f_write_ea_toosmall_extra_isize/expect.2 b/tests/f_write_ea_toosmall_extra_isize/expect.2 new file mode 100644 index 0000000..8025ccb --- /dev/null +++ b/tests/f_write_ea_toosmall_extra_isize/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: 11/128 files (0.0% non-contiguous), 17/512 blocks +Exit status is 0 diff --git a/tests/f_write_ea_toosmall_extra_isize/image.gz b/tests/f_write_ea_toosmall_extra_isize/image.gz Binary files differnew file mode 100644 index 0000000..78a0149 --- /dev/null +++ b/tests/f_write_ea_toosmall_extra_isize/image.gz diff --git a/tests/f_write_ea_toosmall_extra_isize/name b/tests/f_write_ea_toosmall_extra_isize/name new file mode 100644 index 0000000..a1ebc7f --- /dev/null +++ b/tests/f_write_ea_toosmall_extra_isize/name @@ -0,0 +1 @@ +write EA when i_extra_size is too small diff --git a/tests/f_yes/expect b/tests/f_yes/expect new file mode 100644 index 0000000..93b04ef --- /dev/null +++ b/tests/f_yes/expect @@ -0,0 +1,46 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 999999999, len 1) +Clear<y>? yes +Inode 12 has an invalid extent + (logical block 1, invalid physical block 9999999999, len 1) +Clear<y>? yes +Inode 13 is in use, but has dtime set. Fix<y>? yes +Inode 13 has an invalid extent + (logical block 1, invalid physical block 8888888888888, len 1) +Clear<y>? yes +Inode 13 has an invalid extent + (logical block 0, invalid physical block 888888888888, len 1) +Clear<y>? yes +Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes +Inode 14 was part of the orphaned inode list. FIXED. +Inode 14 has an invalid extent + (logical block 300, invalid physical block 777777777777, len 300) +Clear<y>? yes +Inode 14 has an invalid extent + (logical block 0, invalid physical block 7777777777, len 1) +Clear<y>? yes +Inode 14, i_blocks is 52574694748113, should be 0. Fix<y>? yes +Pass 2: Checking directory structure +Extended attribute block for inode 12 (/a) is invalid (999999). +Clear ('a' enables 'yes' to all) <y>? yes +Extended attribute block for inode 13 (/b) is invalid (298954296). +Clear ('a' enables 'yes' to all) <y>? yes +Extended attribute block for inode 14 (/c) is invalid (388697201). +Clear ('a' enables 'yes' to all) <y>? yes +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 12 ref count is 34463, should be 1. Fix ('a' enables 'yes' to all) <y>? yes +Inode 13 ref count is 9999, should be 1. Fix<y>? yes +Inode 14 ref count is 12241, should be 1. Fix<y>? yes +Pass 5: Checking group summary information +Block bitmap differences: -202 -381 -457 +Fix<y>? yes +Free blocks count wrong for group #0 (0, counted=494). +Fix<y>? yes +Free inodes count wrong for group #0 (4294967293, counted=114). +Fix<y>? yes + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_yes/script b/tests/f_yes/script new file mode 100644 index 0000000..3cbeb20 --- /dev/null +++ b/tests/f_yes/script @@ -0,0 +1,26 @@ +test_description="e2fsck with repeated yes" +FSCK_OPT=-f +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $test_dir/../f_yesall/image.gz > $TMPFILE + +echo "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_yesall/expect b/tests/f_yesall/expect new file mode 100644 index 0000000..757b048 --- /dev/null +++ b/tests/f_yesall/expect @@ -0,0 +1,63 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 999999999, len 1) +Clear<y>? yes to all +Inode 12 has an invalid extent + (logical block 1, invalid physical block 9999999999, len 1) +Clear? yes + +Inode 13 is in use, but has dtime set. Fix? yes + +Inode 13 has an invalid extent + (logical block 1, invalid physical block 8888888888888, len 1) +Clear? yes + +Inode 13 has an invalid extent + (logical block 0, invalid physical block 888888888888, len 1) +Clear? yes + +Inodes that were part of a corrupted orphan linked list found. Fix? yes + +Inode 14 was part of the orphaned inode list. FIXED. +Inode 14 has an invalid extent + (logical block 300, invalid physical block 777777777777, len 300) +Clear? yes + +Inode 14 has an invalid extent + (logical block 0, invalid physical block 7777777777, len 1) +Clear? yes + +Inode 14, i_blocks is 52574694748113, should be 0. Fix? yes + +Pass 2: Checking directory structure +Extended attribute block for inode 12 (/a) is invalid (999999). +Clear? yes + +Extended attribute block for inode 13 (/b) is invalid (298954296). +Clear? yes + +Extended attribute block for inode 14 (/c) is invalid (388697201). +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 12 ref count is 34463, should be 1. Fix? yes + +Inode 13 ref count is 9999, should be 1. Fix? yes + +Inode 14 ref count is 12241, should be 1. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -202 -381 -457 +Fix? yes + +Free blocks count wrong for group #0 (0, counted=494). +Fix? yes + +Free inodes count wrong for group #0 (4294967293, counted=114). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_yesall/image.gz b/tests/f_yesall/image.gz Binary files differnew file mode 100644 index 0000000..0f8b205 --- /dev/null +++ b/tests/f_yesall/image.gz diff --git a/tests/f_yesall/script b/tests/f_yesall/script new file mode 100644 index 0000000..cb67ee7 --- /dev/null +++ b/tests/f_yesall/script @@ -0,0 +1,26 @@ +test_description="e2fsck with yes-to-all" +FSCK_OPT=-f +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $test_dir/image.gz > $TMPFILE + +echo "annnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_yesthenall/expect b/tests/f_yesthenall/expect new file mode 100644 index 0000000..73f35a3 --- /dev/null +++ b/tests/f_yesthenall/expect @@ -0,0 +1,53 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 999999999, len 1) +Clear<y>? yes +Inode 12 has an invalid extent + (logical block 1, invalid physical block 9999999999, len 1) +Clear<y>? yes +Inode 13 is in use, but has dtime set. Fix<y>? yes +Inode 13 has an invalid extent + (logical block 1, invalid physical block 8888888888888, len 1) +Clear<y>? yes +Inode 13 has an invalid extent + (logical block 0, invalid physical block 888888888888, len 1) +Clear<y>? yes +Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes +Inode 14 was part of the orphaned inode list. FIXED. +Inode 14 has an invalid extent + (logical block 300, invalid physical block 777777777777, len 300) +Clear<y>? yes +Inode 14 has an invalid extent + (logical block 0, invalid physical block 7777777777, len 1) +Clear<y>? yes +Inode 14, i_blocks is 52574694748113, should be 0. Fix<y>? yes +Pass 2: Checking directory structure +Extended attribute block for inode 12 (/a) is invalid (999999). +Clear ('a' enables 'yes' to all) <y>? yes +Extended attribute block for inode 13 (/b) is invalid (298954296). +Clear ('a' enables 'yes' to all) <y>? yes to all +Extended attribute block for inode 14 (/c) is invalid (388697201). +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 12 ref count is 34463, should be 1. Fix? yes + +Inode 13 ref count is 9999, should be 1. Fix? yes + +Inode 14 ref count is 12241, should be 1. Fix? yes + +Pass 5: Checking group summary information +Block bitmap differences: -202 -381 -457 +Fix? yes + +Free blocks count wrong for group #0 (0, counted=494). +Fix? yes + +Free inodes count wrong for group #0 (4294967293, counted=114). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_yesthenall/script b/tests/f_yesthenall/script new file mode 100644 index 0000000..5f4c8ee --- /dev/null +++ b/tests/f_yesthenall/script @@ -0,0 +1,26 @@ +test_description="e2fsck with yes then yes-to-all" +FSCK_OPT=-f +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $test_dir/../f_yesall/image.gz > $TMPFILE + +echo "yyyyyyyyyyannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_yesthenno/expect b/tests/f_yesthenno/expect new file mode 100644 index 0000000..94bcc6a --- /dev/null +++ b/tests/f_yesthenno/expect @@ -0,0 +1,51 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has an invalid extent + (logical block 0, invalid physical block 999999999, len 1) +Clear<y>? yes +Inode 12 has an invalid extent + (logical block 1, invalid physical block 9999999999, len 1) +Clear<y>? yes +Inode 13 is in use, but has dtime set. Fix<y>? yes +Inode 13 has an invalid extent + (logical block 1, invalid physical block 8888888888888, len 1) +Clear<y>? yes +Inode 13 has an invalid extent + (logical block 0, invalid physical block 888888888888, len 1) +Clear<y>? yes +Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes +Inode 14 was part of the orphaned inode list. FIXED. +Inode 14 has an invalid extent + (logical block 300, invalid physical block 777777777777, len 300) +Clear<y>? yes +Inode 14 has an invalid extent + (logical block 0, invalid physical block 7777777777, len 1) +Clear<y>? yes +Inode 14, i_blocks is 52574694748113, should be 0. Fix<y>? yes +Pass 2: Checking directory structure +Extended attribute block for inode 12 (/a) is invalid (999999). +Clear ('a' enables 'yes' to all) <y>? yes +Extended attribute block for inode 13 (/b) is invalid (298954296). +Clear ('a' enables 'yes' to all) <y>? no +Extended attribute block for inode 14 (/c) is invalid (388697201). +Clear<y>? no +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Inode 12 ref count is 34463, should be 1. Fix<y>? no +Inode 13 ref count is 9999, should be 1. Fix<y>? no +Inode 14 ref count is 12241, should be 1. Fix<y>? no +Pass 5: Checking group summary information +Block bitmap differences: -202 -381 -457 +Fix<y>? no +Free blocks count wrong for group #0 (0, counted=491). +Fix<y>? no +Free blocks count wrong (494, counted=491). +Fix<y>? no +Free inodes count wrong for group #0 (4294967293, counted=114). +Fix<y>? no + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +test_filesys: 14/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 4 diff --git a/tests/f_yesthenno/script b/tests/f_yesthenno/script new file mode 100644 index 0000000..5bbc0c6 --- /dev/null +++ b/tests/f_yesthenno/script @@ -0,0 +1,26 @@ +test_description="e2fsck with yes then no" +FSCK_OPT=-f +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $test_dir/../f_yesall/image.gz > $TMPFILE + +echo "yyyyyyyyyynnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f tmp_expect +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/f_zero_group/expect.1 b/tests/f_zero_group/expect.1 new file mode 100644 index 0000000..2a07767 --- /dev/null +++ b/tests/f_zero_group/expect.1 @@ -0,0 +1,23 @@ +ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap +../e2fsck/e2fsck: Group descriptors look bad... trying backup blocks... +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 +Free blocks count wrong for group #0 (7987, counted=7982). +Fix? yes + +Free blocks count wrong (11602, counted=11597). +Fix? yes + +Free inodes count wrong for group #0 (1493, counted=1488). +Fix? yes + +Free inodes count wrong (2997, counted=2992). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/3008 files (0.0% non-contiguous), 403/12000 blocks +Exit status is 1 diff --git a/tests/f_zero_group/expect.2 b/tests/f_zero_group/expect.2 new file mode 100644 index 0000000..a833aef --- /dev/null +++ b/tests/f_zero_group/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: 16/3008 files (0.0% non-contiguous), 403/12000 blocks +Exit status is 0 diff --git a/tests/f_zero_group/image.gz b/tests/f_zero_group/image.gz Binary files differnew file mode 100644 index 0000000..755493c --- /dev/null +++ b/tests/f_zero_group/image.gz diff --git a/tests/f_zero_group/name b/tests/f_zero_group/name new file mode 100644 index 0000000..ccb3b96 --- /dev/null +++ b/tests/f_zero_group/name @@ -0,0 +1 @@ +fallback for damaged group descriptors diff --git a/tests/f_zero_inode_size/expect.1 b/tests/f_zero_inode_size/expect.1 new file mode 100644 index 0000000..b8bd7da --- /dev/null +++ b/tests/f_zero_inode_size/expect.1 @@ -0,0 +1,11 @@ +ext2fs_open2: The ext2 superblock is corrupt +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/2512 files (0.0% non-contiguous), 415/10000 blocks +Exit status is 1 diff --git a/tests/f_zero_inode_size/expect.2 b/tests/f_zero_inode_size/expect.2 new file mode 100644 index 0000000..da94806 --- /dev/null +++ b/tests/f_zero_inode_size/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: 11/2512 files (0.0% non-contiguous), 415/10000 blocks +Exit status is 0 diff --git a/tests/f_zero_inode_size/image.gz b/tests/f_zero_inode_size/image.gz Binary files differnew file mode 100644 index 0000000..f4503c8 --- /dev/null +++ b/tests/f_zero_inode_size/image.gz diff --git a/tests/f_zero_inode_size/name b/tests/f_zero_inode_size/name new file mode 100644 index 0000000..ce88d96 --- /dev/null +++ b/tests/f_zero_inode_size/name @@ -0,0 +1 @@ +superblock with a zero inode size diff --git a/tests/f_zero_super/expect.1 b/tests/f_zero_super/expect.1 new file mode 100644 index 0000000..e2b954d --- /dev/null +++ b/tests/f_zero_super/expect.1 @@ -0,0 +1,23 @@ +ext2fs_open2: Bad magic number in super-block +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +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 +Free blocks count wrong for group #0 (7987, counted=7982). +Fix? yes + +Free blocks count wrong (11602, counted=11597). +Fix? yes + +Free inodes count wrong for group #0 (1493, counted=1488). +Fix? yes + +Free inodes count wrong (2997, counted=2992). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 16/3008 files (0.0% non-contiguous), 403/12000 blocks +Exit status is 1 diff --git a/tests/f_zero_super/expect.2 b/tests/f_zero_super/expect.2 new file mode 100644 index 0000000..a833aef --- /dev/null +++ b/tests/f_zero_super/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: 16/3008 files (0.0% non-contiguous), 403/12000 blocks +Exit status is 0 diff --git a/tests/f_zero_super/image.gz b/tests/f_zero_super/image.gz Binary files differnew file mode 100644 index 0000000..eea9140 --- /dev/null +++ b/tests/f_zero_super/image.gz diff --git a/tests/f_zero_super/name b/tests/f_zero_super/name new file mode 100644 index 0000000..5d99984 --- /dev/null +++ b/tests/f_zero_super/name @@ -0,0 +1 @@ +fallback for damaged superblock diff --git a/tests/f_zero_xattr/expect.1 b/tests/f_zero_xattr/expect.1 new file mode 100644 index 0000000..0733af6 --- /dev/null +++ b/tests/f_zero_xattr/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/24 files (0.0% non-contiguous), 25/200 blocks +Exit status is 0 diff --git a/tests/f_zero_xattr/image.gz b/tests/f_zero_xattr/image.gz Binary files differnew file mode 100644 index 0000000..4005552 --- /dev/null +++ b/tests/f_zero_xattr/image.gz diff --git a/tests/f_zero_xattr/name b/tests/f_zero_xattr/name new file mode 100644 index 0000000..52aab15 --- /dev/null +++ b/tests/f_zero_xattr/name @@ -0,0 +1 @@ +zero length extended attribute in in-inode xattr diff --git a/tests/f_zero_xattr/script b/tests/f_zero_xattr/script new file mode 100644 index 0000000..8ab2b9c --- /dev/null +++ b/tests/f_zero_xattr/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck diff --git a/tests/f_zeroed_ext_header/expect.1 b/tests/f_zeroed_ext_header/expect.1 new file mode 100644 index 0000000..2613e9f --- /dev/null +++ b/tests/f_zeroed_ext_header/expect.1 @@ -0,0 +1,22 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 has corrupt extent header. Clear inode? yes + +Pass 2: Checking directory structure +Entry 'testa' in / (2) has deleted/unused inode 12. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -12 +Fix? yes + +Free inodes count wrong for group #0 (115, counted=116). +Fix? yes + +Free inodes count wrong (115, counted=116). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 15/256 blocks +Exit status is 1 diff --git a/tests/f_zeroed_ext_header/expect.2 b/tests/f_zeroed_ext_header/expect.2 new file mode 100644 index 0000000..177288f --- /dev/null +++ b/tests/f_zeroed_ext_header/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/128 files (0.0% non-contiguous), 15/256 blocks +Exit status is 0 diff --git a/tests/f_zeroed_ext_header/image.gz b/tests/f_zeroed_ext_header/image.gz Binary files differnew file mode 100644 index 0000000..67a4334 --- /dev/null +++ b/tests/f_zeroed_ext_header/image.gz diff --git a/tests/f_zeroed_ext_header/name b/tests/f_zeroed_ext_header/name new file mode 100644 index 0000000..31394cf --- /dev/null +++ b/tests/f_zeroed_ext_header/name @@ -0,0 +1 @@ +zap inode with zeroed extent header diff --git a/tests/filter.sed b/tests/filter.sed new file mode 100644 index 0000000..265f458 --- /dev/null +++ b/tests/filter.sed @@ -0,0 +1,42 @@ +/^debugfs [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^dumpe2fs [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^e2fsck [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^mke2fs [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^resize2fs [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^tune2fs [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +/^e2image [1-9]\.[0-9]*[^ ]* ([0-9]*-[A-Za-z]*-[0-9]*)/d +s/\\015//g +/automatically checked/d +/^Directory Hash Seed:/d +/Discarding device blocks/d +/^Filesystem created:/d +/^Filesystem flags:/d +/^Filesystem UUID:/d +/^JFS DEBUG:/d +/^Last write time:/d +/^Last mount time:/d +/^Last checked:/d +/^Lifetime writes:/d +/^Maximum mount count:/d +/^Next check after:/d +/^Suggestion:/d +/security.selinux/d +/Reserved blocks uid:/s/ (user .*)// +/Reserved blocks gid:/s/ (group .*)// +/whichever comes first/d +/^ Checksum /d +s/, csum 0x\([0-9a-f]*\)//g +s/ csum 0x\([0-9a-f]*\)//g +/^Checksum:/d +/^Checksum seed:/d +s/while trying to open [^ ]*/while trying to open test.img/ +s/he filesystem on [^ ]* /he filesystem on test.img / +s/^[^ ]* contains a \([a-z]*\) file system /test.img contains a \1 file system / +s/MMP block [0-9]* from [^ ]*/MMP block from test.img/ +s/safe to mount '.*', MMP/safe to mount 'test.img', MMP/ +s/mmp_device_name: .*/mmp_device_name: test.img/ +s/mmp_node_name: .*/mmp_node_name: test_node/ +s/mmp_update_date: .*/mmp_update_date: test date/ +s/mmp_update_time: .*/mmp_update_time: test_time/ +s/MMP last updated by '.*' on .*/MMP last updated by 'test_node' on test date/ +s/MMP update by '.*' at .*/MMP last updated by 'test_node' on test date/ diff --git a/tests/fuzz/.gitignore b/tests/fuzz/.gitignore new file mode 100644 index 0000000..381b20a --- /dev/null +++ b/tests/fuzz/.gitignore @@ -0,0 +1,3 @@ +ext2fs_check_directory_fuzzer +ext2fs_image_read_write_fuzzer +ext2fs_read_bitmap_fuzzer diff --git a/tests/fuzz/Makefile.in b/tests/fuzz/Makefile.in new file mode 100644 index 0000000..949579e --- /dev/null +++ b/tests/fuzz/Makefile.in @@ -0,0 +1,93 @@ +# +# Makefile for the tests/fuzz directory +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +my_dir = tests/fuzz + +@MCONFIG@ + +PROGS= ext2fs_check_directory_fuzzer \ + ext2fs_image_read_write_fuzzer \ + ext2fs_read_bitmap_fuzzer + +SRCS= $(srcdir)/ext2fs_check_directory_fuzzer.cc \ + $(srcdir)/ext2fs_image_read_write_fuzzer.cc \ + $(srcdir)/ext2fs_read_bitmap_fuzzer.cc + +LOCAL_CFLAGS= @fuzzer_cflags@ +LOCAL_LDFLAGS= @fuzzer_ldflags@ + +LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBSUPPORT) +DEPLIBS= $(LIBEXT2FS) $(DEPLIBCOM_ERR) $(DEPLIBSUPPORT) + +STATIC_LIBS= $(LIBSUPPORT) $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) \ + $(STATIC_LIBCOM_ERR) +STATIC_DEPLIBS= $(DEPLIBSUPPORT) $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) \ + $(DEPSTATIC_LIBCOM_ERR) + +FUZZ_LDFLAGS= $(ALL_LDFLAGS) +FUZZ_DEP= $(STATIC_DEPLIBS) $(srcdir)/Makefile.in + +.cc.o: + $(E) " CXX $<" + $(Q) $(CXX) -c $(ALL_CFLAGS) $< -o $@ + +@FUZZING_CMT@all:: $(PROGS) + +clean:: + $(RM) -f $(PROGS) *.o + +install: + +install-strip: + +uninstall: + +mostlyclean: clean +distclean: clean + $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old + +ext2fs_check_directory_fuzzer: ext2fs_check_directory_fuzzer.o $(FUZZ_DEP) + $(E) " LD $@" + $(Q) $(CXX) $(FUZZ_LDFLAGS) -o $@ $< $(STATIC_LIBS) $(SYSLIBS) + +ext2fs_image_read_write_fuzzer: ext2fs_image_read_write_fuzzer.o $(FUZZ_DEP) + $(E) " LD $@" + $(Q) $(CXX) $(FUZZ_LDFLAGS) -o $@ $< $(STATIC_LIBS) $(SYSLIBS) + +ext2fs_read_bitmap_fuzzer: ext2fs_read_bitmap_fuzzer.o $(FUZZ_DEP) + $(E) " LD $@" + $(Q) $(CXX) $(FUZZ_LDFLAGS) -o $@ $< $(STATIC_LIBS) $(SYSLIBS) + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +ext2fs_check_directory_fuzzer.o: $(srcdir)/ext2fs_check_directory_fuzzer.cc \ + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \ + $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ + $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ + $(top_srcdir)/lib/ext2fs/bitops.h +ext2fs_image_read_write_fuzzer.o: $(srcdir)/ext2fs_image_read_write_fuzzer.cc \ + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \ + $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ + $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ + $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/e2p/e2p.h \ + $(top_srcdir)/lib/support/print_fs_flags.h +ext2fs_read_bitmap_fuzzer.o: $(srcdir)/ext2fs_read_bitmap_fuzzer.cc \ + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \ + $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ + $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ + $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/e2p/e2p.h \ + $(top_srcdir)/lib/support/print_fs_flags.h diff --git a/tests/fuzz/ext2fs_check_directory_fuzzer.cc b/tests/fuzz/ext2fs_check_directory_fuzzer.cc new file mode 100644 index 0000000..61cf42f --- /dev/null +++ b/tests/fuzz/ext2fs_check_directory_fuzzer.cc @@ -0,0 +1,43 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include <stddef.h> +#include <stdint.h> +#include <fcntl.h> +#include <unistd.h> + +#include "ext2fs/ext2fs.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + static const char* fname = "/tmp/ext2_test_file"; + + // Write our data to a temp file. + int fd = open(fname, O_RDWR|O_CREAT|O_TRUNC); + write(fd, data, size); + close(fd); + + ext2_filsys fs; + errcode_t retval = ext2fs_open( + fname, + EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0, + unix_io_manager, + &fs); + + if (!retval) { + retval = ext2fs_check_directory(fs, EXT2_ROOT_INO); + ext2fs_close(fs); + } + + return 0; +} diff --git a/tests/fuzz/ext2fs_image_read_write_fuzzer.cc b/tests/fuzz/ext2fs_image_read_write_fuzzer.cc new file mode 100644 index 0000000..8aa0cb8 --- /dev/null +++ b/tests/fuzz/ext2fs_image_read_write_fuzzer.cc @@ -0,0 +1,135 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// #define USE_FLAGS +// #define DUMP_SUPER +// #define SAVE_FS_IMAGE + +#include <stdio.h> +#include <stddef.h> +#include <stdint.h> +#include <unistd.h> +#include <assert.h> +#include <fcntl.h> +#include <sys/syscall.h> +#include <linux/memfd.h> +#include <fuzzer/FuzzedDataProvider.h> + +#include "ext2fs/ext2fs.h" +extern "C" { +#include "e2p/e2p.h" +#include "support/print_fs_flags.h" +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + + const char *progname = "ext2fs_image_read_write_fuzzer"; + add_error_table(&et_ext2_error_table); + + enum FuzzerType { + ext2fsImageBitmapRead, + ext2fsImageInodeRead, + ext2fsImageSuperRead, + ext2fsImageBitmapWrite, + ext2fsImageInodeWrite, + ext2fsImageSuperWrite, + kMaxValue = ext2fsImageSuperWrite + }; + + FuzzedDataProvider stream(data, size); + const FuzzerType f = stream.ConsumeEnum<FuzzerType>(); + int flags = stream.ConsumeIntegral<int>(); +#ifndef USE_FLAGS + flags = 0; +#endif + + static const char* fname = "/tmp/ext2_test_file"; + + // Write our data to a temp file. +#ifdef SAVE_FS_IMAGE + int fd = open(fname, O_CREAT|O_TRUNC|O_RDWR, 0644); +#else + int fd = syscall(SYS_memfd_create, fname, 0); +#endif + std::vector<char> buffer = stream.ConsumeRemainingBytes<char>(); + write(fd, buffer.data(), buffer.size()); + + std::string fspath("/proc/self/fd/" + std::to_string(fd)); + + ext2_filsys fs; +#ifdef USE_FLAGS + printf("Flags: 0x%08x ", flags); + print_fs_flags(stdout, flags); + flags &= ~EXT2_FLAG_NOFREE_ON_ERROR; +#endif + errcode_t retval = ext2fs_open( + fspath.c_str(), + flags | EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0, + unix_io_manager, + &fs); + + if (retval) { + com_err(progname, retval, "while trying to open file system"); + } else { +#ifdef DUMP_SUPER + list_super2(fs->super, stdout); +#endif + printf("FuzzerType: %d\n", (int) f); + switch (f) { + case ext2fsImageBitmapRead: { + retval = ext2fs_image_bitmap_read(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to read image bitmap"); + break; + } + case ext2fsImageInodeRead: { + retval = ext2fs_image_inode_read(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to read image inode"); + break; + } + case ext2fsImageSuperRead: { + retval = ext2fs_image_super_read(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to read image superblock"); + break; + } + case ext2fsImageBitmapWrite: { + retval = ext2fs_image_bitmap_write(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to write image bitmap"); + break; + } + case ext2fsImageInodeWrite: { + retval = ext2fs_image_inode_write(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to write image inode"); + break; + } + case ext2fsImageSuperWrite: { + retval = ext2fs_image_super_write(fs, fd, 0); + if (retval) + com_err(progname, retval, "while trying to write image superblock"); + break; + } + default: { + assert(false); + } + } + ext2fs_close(fs); + } + close(fd); + + return 0; +} diff --git a/tests/fuzz/ext2fs_read_bitmap_fuzzer.cc b/tests/fuzz/ext2fs_read_bitmap_fuzzer.cc new file mode 100644 index 0000000..fa3d7e7 --- /dev/null +++ b/tests/fuzz/ext2fs_read_bitmap_fuzzer.cc @@ -0,0 +1,108 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// #define USE_FLAGS +// #define DUMP_SUPER +// #define SAVE_FS_IMAGE + +#include <stdio.h> +#include <stddef.h> +#include <stdint.h> +#include <unistd.h> +#include <assert.h> +#include <fcntl.h> +#include <sys/syscall.h> +#include <linux/memfd.h> +#include <fuzzer/FuzzedDataProvider.h> + +#include "ext2fs/ext2fs.h" +extern "C" { +#include "e2p/e2p.h" +#include "support/print_fs_flags.h" +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + + const char *progname = "ext2fs_read_bitmap_fuzzer"; + add_error_table(&et_ext2_error_table); + + enum FuzzerType { + ext2fsReadBlockBitmap, + ext2fsReadInodeBitmap, + kMaxValue = ext2fsReadInodeBitmap + }; + + FuzzedDataProvider stream(data, size); + const FuzzerType f = stream.ConsumeEnum<FuzzerType>(); + int flags = stream.ConsumeIntegral<int>(); +#ifndef USE_FLAGS + flags = 0; +#endif + + static const char* fname = "/tmp/ext2_test_file"; + + // Write our data to a temp file. +#ifdef SAVE_FS_IMAGE + int fd = open(fname, O_CREAT|O_TRUNC|O_RDWR, 0644); +#else + int fd = syscall(SYS_memfd_create, fname, 0); +#endif + std::vector<char> buffer = stream.ConsumeRemainingBytes<char>(); + write(fd, buffer.data(), buffer.size()); + + std::string fspath("/proc/self/fd/" + std::to_string(fd)); + + ext2_filsys fs; +#ifdef USE_FLAGS + printf("Flags: 0x%08x ", flags); + print_fs_flags(stdout, flags); + flags &= ~EXT2_FLAG_NOFREE_ON_ERROR; +#endif + errcode_t retval = ext2fs_open( + fspath.c_str(), + flags | EXT2_FLAG_IGNORE_CSUM_ERRORS, 0, 0, + unix_io_manager, + &fs); + + if (retval) { + com_err(progname, retval, "while trying to open file system"); + } else { +#ifdef DUMP_SUPER + list_super2(fs->super, stdout); +#endif + switch (f) { + case ext2fsReadBlockBitmap: { + retval = ext2fs_read_block_bitmap(fs); + if (retval) + com_err(progname, retval, "while trying to read block bitmap"); + break; + } + case ext2fsReadInodeBitmap: { + retval = ext2fs_read_inode_bitmap(fs); + if (retval) + com_err(progname, retval, "while trying to read inode bitmap"); + break; + } + default: { + assert(false); + } + } + retval = ext2fs_close(fs); + if (retval) + com_err(progname, retval, "while trying to close file system"); + } + close(fd); + + return 0; +} diff --git a/tests/i_bad_csum/expect b/tests/i_bad_csum/expect new file mode 100644 index 0000000..eeb967f --- /dev/null +++ b/tests/i_bad_csum/expect @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 passes checks, but checksum does not match inode. Fix? no + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys.bin: ********** WARNING: Filesystem still has errors ********** + +test_filesys.bin: 12/128 files (0.0% non-contiguous), 19/512 blocks diff --git a/tests/i_bad_csum/image.gz b/tests/i_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..e17e921 --- /dev/null +++ b/tests/i_bad_csum/image.gz diff --git a/tests/i_bad_csum/name b/tests/i_bad_csum/name new file mode 100644 index 0000000..f7197f0 --- /dev/null +++ b/tests/i_bad_csum/name @@ -0,0 +1 @@ +run e2image on a file system with bad checksums diff --git a/tests/i_bad_csum/script b/tests/i_bad_csum/script new file mode 100644 index 0000000..8b5bef9 --- /dev/null +++ b/tests/i_bad_csum/script @@ -0,0 +1,26 @@ +test_description="e2image corrupt fs" + +IMAGE=$test_dir/image.gz +OUT=$test_name.log +EXP=$test_dir/expect + +gzip -d < $IMAGE > $TMPFILE +$E2IMAGE -r $TMPFILE $TMPFILE.bin > $OUT 2>&1 +$FSCK -fn $TMPFILE.bin >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test_filesys;" $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +rm -f $OUT $TMPFILE $TMPFILE.bin $TMPFILE.test +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/i_bitmaps/expect b/tests/i_bitmaps/expect new file mode 100644 index 0000000..6199bb7 --- /dev/null +++ b/tests/i_bitmaps/expect @@ -0,0 +1,8 @@ +46,52d45 +< Journal features: (none) +< Total journal size: 1024k +< Total journal blocks: 1024 +< Max transaction length: 1024 +< Fast commit length: 0 +< Journal sequence: 0x00000001 +< Journal start: 0 diff --git a/tests/i_bitmaps/image.bz2 b/tests/i_bitmaps/image.bz2 Binary files differnew file mode 100644 index 0000000..cc33565 --- /dev/null +++ b/tests/i_bitmaps/image.bz2 diff --git a/tests/i_bitmaps/script b/tests/i_bitmaps/script new file mode 100644 index 0000000..1a16d55 --- /dev/null +++ b/tests/i_bitmaps/script @@ -0,0 +1,28 @@ +test_description="e2image bitmap read/write test" + +IMAGE=$test_dir/image.bz2 +OUT=$test_name.log +EXP=$test_dir/expect + +bzip2 -d < $IMAGE > $TMPFILE +$E2IMAGE $TMPFILE $TMPFILE.e2i > $OUT 2>&1 +$DUMPE2FS $TMPFILE > $TMPFILE.1 2>&1 +$DUMPE2FS -i $TMPFILE.e2i > $TMPFILE.2 2>&1 +diff $TMPFILE.1 $TMPFILE.2 >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test_filesys;" $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +rm -rf $TMPFILE $TMPFILE.bin $TMPFILE.1 $TMPFILE.2 $TMPFILE.e2i +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/i_qcow/i_qcow.crc b/tests/i_qcow/i_qcow.crc new file mode 100644 index 0000000..8591ae4 --- /dev/null +++ b/tests/i_qcow/i_qcow.crc @@ -0,0 +1,15 @@ +i_qcow/image1024.orig +image 2161078647 +raw_image 467277198 +qcow_image 2164212449 +qcow_to_raw 467277198 +i_qcow/image2048.orig +image 672740642 +raw_image 3688408350 +qcow_image 3821412753 +qcow_to_raw 3688408350 +i_qcow/image4096.orig +image 4077552412 +raw_image 4159471388 +qcow_image 636354894 +qcow_to_raw 4159471388 diff --git a/tests/i_qcow/image1024.orig.bz2 b/tests/i_qcow/image1024.orig.bz2 Binary files differnew file mode 100644 index 0000000..ac90f86 --- /dev/null +++ b/tests/i_qcow/image1024.orig.bz2 diff --git a/tests/i_qcow/image2048.orig.bz2 b/tests/i_qcow/image2048.orig.bz2 Binary files differnew file mode 100644 index 0000000..18d07a8 --- /dev/null +++ b/tests/i_qcow/image2048.orig.bz2 diff --git a/tests/i_qcow/image4096.orig.bz2 b/tests/i_qcow/image4096.orig.bz2 Binary files differnew file mode 100644 index 0000000..e17b5a3 --- /dev/null +++ b/tests/i_qcow/image4096.orig.bz2 diff --git a/tests/i_qcow/script b/tests/i_qcow/script new file mode 100644 index 0000000..6bf995e --- /dev/null +++ b/tests/i_qcow/script @@ -0,0 +1,64 @@ +test_description="create/convert raw/qcow2 images" +if test -x $E2IMAGE_EXE; then + +ORIG_IMAGES="image1024.orig image2048.orig image4096.orig" + +RAW_IMG=_image.raw +QCOW2_IMG=_image.qcow2 +QCOW2_TO_RAW=_image.qcow2.raw +OUT=$test_name.log +CRC=$SRCDIR/$test_name/$test_name.crc +CRC_TMP=$test_name.crc.tmp + +rm -f $CRC_TMP $OUT >/dev/null 2>&1 + +( +for i in $ORIG_IMAGES; do + ORIG_IMG=$test_name/$i + echo $ORIG_IMG >> $CRC_TMP + + IMAGE=$(mktemp ${TMPDIR:-/tmp}/$i.XXXXXX) + RAW_IMG="${IMAGE}.raw" + QCOW2_IMG="${IMAGE}.qcow2" + QCOW2_TO_RAW="${IMAGE}.qcow2.raw" + + bunzip2 < $SRCDIR/$ORIG_IMG.bz2 > $IMAGE + echo "image $($CRCSUM $IMAGE)" >> $CRC_TMP + + rm -f $RAW_IMG + echo "e2image -r $ORIG_IMG $RAW_IMG" + $E2IMAGE -r $IMAGE $RAW_IMG + echo "raw_image $($CRCSUM $RAW_IMG)" >> $CRC_TMP + + echo "e2image -Q $ORIG_IMG $QCOW2_IMG" + $E2IMAGE -Q $IMAGE $QCOW2_IMG + echo "qcow_image $($CRCSUM $QCOW2_IMG)" >> $CRC_TMP + + rm -f $QCOW2_TO_RAW + echo "e2image -r $QCOW2_IMG $QCOW2_TO_RAW" + $E2IMAGE -r $QCOW2_IMG $QCOW2_TO_RAW + echo "qcow_to_raw $($CRCSUM $QCOW2_TO_RAW)" >> $CRC_TMP + + rm -f $IMAGE $RAW_IMG $QCOW2_IMG $QCOW2_TO_RAW +done +) >> $OUT 2>&1 + +echo "checksum:" >> $OUT +cat $CRC_TMP >> $OUT +echo "" >> $OUT + +diff $CRC $CRC_TMP >> $OUT 2>&1 + +if [ $? -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi + +rm -f $CRC_TMP >/dev/null 2>&1 + +else #if test -x $E2IMAGE_EXE; then + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/i_zero_super/expect.1 b/tests/i_zero_super/expect.1 new file mode 100644 index 0000000..fda32b9 --- /dev/null +++ b/tests/i_zero_super/expect.1 @@ -0,0 +1,22 @@ +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 +Free blocks count wrong for group #0 (7987, counted=7982). +Fix? no + +Free blocks count wrong (11602, counted=11597). +Fix? no + +Free inodes count wrong for group #0 (1493, counted=1488). +Fix? no + +Free inodes count wrong (2997, counted=2992). +Fix? no + + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +test_filesys: 11/3008 files (0.0% non-contiguous), 398/12000 blocks +Exit status is 4 diff --git a/tests/i_zero_super/image.gz b/tests/i_zero_super/image.gz Binary files differnew file mode 100644 index 0000000..eea9140 --- /dev/null +++ b/tests/i_zero_super/image.gz diff --git a/tests/i_zero_super/script b/tests/i_zero_super/script new file mode 100644 index 0000000..0cef6ac --- /dev/null +++ b/tests/i_zero_super/script @@ -0,0 +1,11 @@ +if test -x $E2IMAGE_EXE; then + +ONE_PASS_ONLY=true +FSCK_OPT="-n -b 8193 -f" +PREP_CMD="$E2IMAGE_EXE -r -b 8193 -B 1024 $TMPFILE $TMPFILE.raw 2>/dev/null; \ + mv $TMPFILE.raw $TMPFILE" +. $cmd_dir/run_e2fsck + +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/j_corrupt_commit_csum/expect b/tests/j_corrupt_commit_csum/expect new file mode 100644 index 0000000..d799772 --- /dev/null +++ b/tests/j_corrupt_commit_csum/expect @@ -0,0 +1,18 @@ +test_filesys: recovering journal +Journal transaction 3 was corrupt, replay was aborted. +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_commit_csum/image.gz b/tests/j_corrupt_commit_csum/image.gz Binary files differnew file mode 100644 index 0000000..334fcd0 --- /dev/null +++ b/tests/j_corrupt_commit_csum/image.gz diff --git a/tests/j_corrupt_commit_csum/name b/tests/j_corrupt_commit_csum/name new file mode 100644 index 0000000..05a99ea --- /dev/null +++ b/tests/j_corrupt_commit_csum/name @@ -0,0 +1 @@ +corrupt commit csum (csum v3) diff --git a/tests/j_corrupt_commit_csum/script b/tests/j_corrupt_commit_csum/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_commit_csum/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_commit_tid/expect b/tests/j_corrupt_commit_tid/expect new file mode 100644 index 0000000..0a7df89 --- /dev/null +++ b/tests/j_corrupt_commit_tid/expect @@ -0,0 +1,17 @@ +test_filesys: recovering journal +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_commit_tid/image.gz b/tests/j_corrupt_commit_tid/image.gz Binary files differnew file mode 100644 index 0000000..988e5c6 --- /dev/null +++ b/tests/j_corrupt_commit_tid/image.gz diff --git a/tests/j_corrupt_commit_tid/name b/tests/j_corrupt_commit_tid/name new file mode 100644 index 0000000..9b4054c --- /dev/null +++ b/tests/j_corrupt_commit_tid/name @@ -0,0 +1 @@ +corrupt commit tid (csum v3) diff --git a/tests/j_corrupt_commit_tid/script b/tests/j_corrupt_commit_tid/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_commit_tid/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_descr_csum/expect b/tests/j_corrupt_descr_csum/expect new file mode 100644 index 0000000..72b8f73 --- /dev/null +++ b/tests/j_corrupt_descr_csum/expect @@ -0,0 +1,18 @@ +test_filesys: recovering journal +Journal checksum error found in test_filesys +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 1 +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_descr_csum/image.gz b/tests/j_corrupt_descr_csum/image.gz Binary files differnew file mode 100644 index 0000000..2a81e5d --- /dev/null +++ b/tests/j_corrupt_descr_csum/image.gz diff --git a/tests/j_corrupt_descr_csum/name b/tests/j_corrupt_descr_csum/name new file mode 100644 index 0000000..e15ccfb --- /dev/null +++ b/tests/j_corrupt_descr_csum/name @@ -0,0 +1 @@ +corrupt descr csum (csum v3) diff --git a/tests/j_corrupt_descr_csum/script b/tests/j_corrupt_descr_csum/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_descr_csum/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_descr_tid/expect b/tests/j_corrupt_descr_tid/expect new file mode 100644 index 0000000..00bd2d5 --- /dev/null +++ b/tests/j_corrupt_descr_tid/expect @@ -0,0 +1,17 @@ +test_filesys: recovering journal +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 0 +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_descr_tid/image.gz b/tests/j_corrupt_descr_tid/image.gz Binary files differnew file mode 100644 index 0000000..3ad88f9 --- /dev/null +++ b/tests/j_corrupt_descr_tid/image.gz diff --git a/tests/j_corrupt_descr_tid/name b/tests/j_corrupt_descr_tid/name new file mode 100644 index 0000000..2325d6d --- /dev/null +++ b/tests/j_corrupt_descr_tid/name @@ -0,0 +1 @@ +corrupt descr tid (csum v3) diff --git a/tests/j_corrupt_descr_tid/script b/tests/j_corrupt_descr_tid/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_descr_tid/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_ext_jnl_sb_block/expect b/tests/j_corrupt_ext_jnl_sb_block/expect new file mode 100644 index 0000000..e638e11 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_block/expect @@ -0,0 +1,5 @@ +External journal does not support this filesystem + +test_filesys: ********** WARNING: Filesystem still has errors ********** + +Exit status is 12 diff --git a/tests/j_corrupt_ext_jnl_sb_block/image.tar.bz2 b/tests/j_corrupt_ext_jnl_sb_block/image.tar.bz2 Binary files differnew file mode 100644 index 0000000..efb382f --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_block/image.tar.bz2 diff --git a/tests/j_corrupt_ext_jnl_sb_block/name b/tests/j_corrupt_ext_jnl_sb_block/name new file mode 100644 index 0000000..35f1689 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_block/name @@ -0,0 +1 @@ +corrupt mcsum ext jnl fs superblock block diff --git a/tests/j_corrupt_ext_jnl_sb_block/script b/tests/j_corrupt_ext_jnl_sb_block/script new file mode 100644 index 0000000..b038943 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_block/script @@ -0,0 +1,32 @@ +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +bzip2 -dc < $test_dir/image.tar.bz2 | tar xf - +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img "$JOURNAL_DUMP_DIR/$test_name.img" +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img.jnl "$JOURNAL_DUMP_DIR/$test_name.img.jnl" + +$FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $test_name.img $test_name.img.jnl $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_ext_jnl_sb_csum/expect b/tests/j_corrupt_ext_jnl_sb_csum/expect new file mode 100644 index 0000000..4212a00 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_csum/expect @@ -0,0 +1,27 @@ +External journal superblock checksum does not match superblock. Fix? yes + +test_filesys: recovering journal +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 +Block bitmap differences: +(1--31) +34 +(50--82) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 66/2048 blocks +Exit status is 1 +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: 11/128 files (0.0% non-contiguous), 66/2048 blocks +Exit status is 0 diff --git a/tests/j_corrupt_ext_jnl_sb_csum/image.tar.bz2 b/tests/j_corrupt_ext_jnl_sb_csum/image.tar.bz2 Binary files differnew file mode 100644 index 0000000..d04d584 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_csum/image.tar.bz2 diff --git a/tests/j_corrupt_ext_jnl_sb_csum/name b/tests/j_corrupt_ext_jnl_sb_csum/name new file mode 100644 index 0000000..7e73971 --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_csum/name @@ -0,0 +1 @@ +corrupt external journal superblock metadata_csum diff --git a/tests/j_corrupt_ext_jnl_sb_csum/script b/tests/j_corrupt_ext_jnl_sb_csum/script new file mode 100644 index 0000000..6c0256b --- /dev/null +++ b/tests/j_corrupt_ext_jnl_sb_csum/script @@ -0,0 +1,36 @@ +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +bzip2 -dc < $test_dir/image.tar.bz2 | tar xf - +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img "$JOURNAL_DUMP_DIR/$test_name.img" +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp $test_name.img.jnl "$JOURNAL_DUMP_DIR/$test_name.img.jnl" + +$FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK $FSCK_OPT -N test_filesys -j $test_name.img.jnl $test_name.img >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $test_name.img $test_name.img.jnl $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_journal_block/expect b/tests/j_corrupt_journal_block/expect new file mode 100644 index 0000000..8b6545a --- /dev/null +++ b/tests/j_corrupt_journal_block/expect @@ -0,0 +1,20 @@ +test_filesys: recovering journal +JBD2: Invalid checksum recovering data block 1090 in log +Journal checksum error found in test_filesys +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 1 +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/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 0 +debugfs: cat /a +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddebugfs: + diff --git a/tests/j_corrupt_journal_block/image.gz b/tests/j_corrupt_journal_block/image.gz Binary files differnew file mode 100644 index 0000000..6ab196e --- /dev/null +++ b/tests/j_corrupt_journal_block/image.gz diff --git a/tests/j_corrupt_journal_block/name b/tests/j_corrupt_journal_block/name new file mode 100644 index 0000000..5d862cd --- /dev/null +++ b/tests/j_corrupt_journal_block/name @@ -0,0 +1 @@ +corrupt journal block (csum v3) diff --git a/tests/j_corrupt_journal_block/script b/tests/j_corrupt_journal_block/script new file mode 100644 index 0000000..a380805 --- /dev/null +++ b/tests/j_corrupt_journal_block/script @@ -0,0 +1,45 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +echo >> $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_revoke_block/expect b/tests/j_corrupt_revoke_block/expect new file mode 100644 index 0000000..c357f53 --- /dev/null +++ b/tests/j_corrupt_revoke_block/expect @@ -0,0 +1,17 @@ +test_filesys: recovering journal +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbdebugfs: diff --git a/tests/j_corrupt_revoke_block/image.gz b/tests/j_corrupt_revoke_block/image.gz Binary files differnew file mode 100644 index 0000000..b165d00 --- /dev/null +++ b/tests/j_corrupt_revoke_block/image.gz diff --git a/tests/j_corrupt_revoke_block/name b/tests/j_corrupt_revoke_block/name new file mode 100644 index 0000000..c7a0088 --- /dev/null +++ b/tests/j_corrupt_revoke_block/name @@ -0,0 +1 @@ +corrupt revoke block (csum v3) diff --git a/tests/j_corrupt_revoke_block/script b/tests/j_corrupt_revoke_block/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_revoke_block/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_revoke_csum/expect b/tests/j_corrupt_revoke_csum/expect new file mode 100644 index 0000000..c357f53 --- /dev/null +++ b/tests/j_corrupt_revoke_csum/expect @@ -0,0 +1,17 @@ +test_filesys: recovering journal +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbdebugfs: diff --git a/tests/j_corrupt_revoke_csum/image.gz b/tests/j_corrupt_revoke_csum/image.gz Binary files differnew file mode 100644 index 0000000..f505592 --- /dev/null +++ b/tests/j_corrupt_revoke_csum/image.gz diff --git a/tests/j_corrupt_revoke_csum/name b/tests/j_corrupt_revoke_csum/name new file mode 100644 index 0000000..b63ea23 --- /dev/null +++ b/tests/j_corrupt_revoke_csum/name @@ -0,0 +1 @@ +corrupt revoke csum (csum v3) diff --git a/tests/j_corrupt_revoke_csum/script b/tests/j_corrupt_revoke_csum/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_revoke_csum/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_revoke_rcount/expect.1 b/tests/j_corrupt_revoke_rcount/expect.1 new file mode 100644 index 0000000..2d1b5cd --- /dev/null +++ b/tests/j_corrupt_revoke_rcount/expect.1 @@ -0,0 +1,9 @@ +test_filesys: recovering journal +../e2fsck/e2fsck: Invalid argument while recovering journal of test_filesys +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: 11/512 files (9.1% non-contiguous), 1066/2048 blocks +Exit status is 1 diff --git a/tests/j_corrupt_revoke_rcount/expect.2 b/tests/j_corrupt_revoke_rcount/expect.2 new file mode 100644 index 0000000..c746fda --- /dev/null +++ b/tests/j_corrupt_revoke_rcount/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: 11/512 files (9.1% non-contiguous), 1066/2048 blocks +Exit status is 0 diff --git a/tests/j_corrupt_revoke_rcount/image.gz b/tests/j_corrupt_revoke_rcount/image.gz Binary files differnew file mode 100644 index 0000000..c8b19e8 --- /dev/null +++ b/tests/j_corrupt_revoke_rcount/image.gz diff --git a/tests/j_corrupt_revoke_rcount/name b/tests/j_corrupt_revoke_rcount/name new file mode 100644 index 0000000..92b523e --- /dev/null +++ b/tests/j_corrupt_revoke_rcount/name @@ -0,0 +1 @@ +corrupt revoke r_count buffer overflow diff --git a/tests/j_corrupt_sb_csum/expect b/tests/j_corrupt_sb_csum/expect new file mode 100644 index 0000000..5c88a09 --- /dev/null +++ b/tests/j_corrupt_sb_csum/expect @@ -0,0 +1,21 @@ +Journal superblock is corrupt. +Fix? yes + +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: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 1 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_sb_csum/image.gz b/tests/j_corrupt_sb_csum/image.gz Binary files differnew file mode 100644 index 0000000..ee92f6b --- /dev/null +++ b/tests/j_corrupt_sb_csum/image.gz diff --git a/tests/j_corrupt_sb_csum/name b/tests/j_corrupt_sb_csum/name new file mode 100644 index 0000000..921a0fd --- /dev/null +++ b/tests/j_corrupt_sb_csum/name @@ -0,0 +1 @@ +corrupt sb csum (csum v3) diff --git a/tests/j_corrupt_sb_csum/script b/tests/j_corrupt_sb_csum/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_sb_csum/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_corrupt_sb_magic/expect b/tests/j_corrupt_sb_magic/expect new file mode 100644 index 0000000..d1dae88 --- /dev/null +++ b/tests/j_corrupt_sb_magic/expect @@ -0,0 +1,42 @@ +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Superblock has_journal flag is clear, but a journal is present. +Clear? yes + +Pass 1: Checking inodes, blocks, and sizes +Journal inode is not in use, but contains data. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(32--33) -(35--49) -(83--1089) +Fix? yes + +Free blocks count wrong for group #0 (956, counted=1980). +Fix? yes + +Free blocks count wrong (956, counted=1980). +Fix? yes + +Recreate journal? yes + +Creating journal (1024 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/128 files (0.0% non-contiguous), 1092/2048 blocks +Exit status is 1 +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/128 files (8.3% non-contiguous), 1092/2048 blocks +Exit status is 0 +debugfs: cat /a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadebugfs: diff --git a/tests/j_corrupt_sb_magic/image.gz b/tests/j_corrupt_sb_magic/image.gz Binary files differnew file mode 100644 index 0000000..5d895e7 --- /dev/null +++ b/tests/j_corrupt_sb_magic/image.gz diff --git a/tests/j_corrupt_sb_magic/name b/tests/j_corrupt_sb_magic/name new file mode 100644 index 0000000..dc781aa --- /dev/null +++ b/tests/j_corrupt_sb_magic/name @@ -0,0 +1 @@ +corrupt sb magic (csum v3) diff --git a/tests/j_corrupt_sb_magic/script b/tests/j_corrupt_sb_magic/script new file mode 100644 index 0000000..ab314f6 --- /dev/null +++ b/tests/j_corrupt_sb_magic/script @@ -0,0 +1,44 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gzip -d < $IMAGE > $TMPFILE + +$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "cat /a" > $TMPFILE.cmd +echo >> $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_ext_dumpe2fs/expect b/tests/j_ext_dumpe2fs/expect new file mode 100644 index 0000000..2838bbd --- /dev/null +++ b/tests/j_ext_dumpe2fs/expect @@ -0,0 +1,55 @@ +e2fsck external journal +../e2fsck/e2fsck: Filesystem has unsupported feature(s) while trying to open test.img + +The superblock could not be read or does not describe a valid ext2/ext3/ext4 +filesystem. If the device is valid and it really contains an ext2/ext3/ext4 +filesystem (and not swap or ufs or something else), then the superblock +is corrupt, and you might try running e2fsck with an alternate superblock: + e2fsck -b 8193 <device> + or + e2fsck -b 32768 <device> + +Exit status is 8 +dumpe2fs external journal +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: journal_dev metadata_csum +Default mount options: user_xattr acl block_validity +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 0 +Block count: 2048 +Reserved block count: 0 +Free blocks: 0 +Free inodes: 0 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 0 +Inode blocks per group: 0 +Mount count: 0 +Check interval: 0 (<none>) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 28 +Desired extra isize: 28 +Default directory hash: half_md4 +Checksum type: crc32c +Journal features: journal_64bit journal_checksum_v3 +Total journal size: 2048k +Total journal blocks: 2048 +Max transaction length: 2048 +Fast commit length: 0 +Journal first block: 3 +Journal sequence: 0x00000003 +Journal start: 0 +Journal checksum type: crc32c +Journal checksum: 0x661e816f +Journal users: 117f752e-f27d-4f6f-a652-072586a29b82 diff --git a/tests/j_ext_dumpe2fs/image.gz b/tests/j_ext_dumpe2fs/image.gz Binary files differnew file mode 100644 index 0000000..781b591 --- /dev/null +++ b/tests/j_ext_dumpe2fs/image.gz diff --git a/tests/j_ext_dumpe2fs/name b/tests/j_ext_dumpe2fs/name new file mode 100644 index 0000000..60d276c --- /dev/null +++ b/tests/j_ext_dumpe2fs/name @@ -0,0 +1 @@ +dumpe2fs of external journal device diff --git a/tests/j_ext_dumpe2fs/script b/tests/j_ext_dumpe2fs/script new file mode 100644 index 0000000..b7bae59 --- /dev/null +++ b/tests/j_ext_dumpe2fs/script @@ -0,0 +1,34 @@ +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +gunzip < $test_dir/image.gz > $TMPFILE + +echo "e2fsck external journal" > $OUT.new +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "dumpe2fs external journal" >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_ext_long_revoke_trans/expect b/tests/j_ext_long_revoke_trans/expect new file mode 100644 index 0000000..ed19872 --- /dev/null +++ b/tests/j_ext_long_revoke_trans/expect @@ -0,0 +1,91 @@ +Creating filesystem with 262144 1k blocks and 0 inodes +Superblock backups stored on blocks: + +Zeroing journal device: +Creating filesystem with 262144 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +debugfs add journal device/UUID +debugfs: feature has_journal +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +debugfs: ssv journal_dev 0x9999 +debugfs: ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +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: 11/16384 files (0.0% non-contiguous), 6239/262144 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Ext2 superblock header found. +Journal starts at block 3, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 3 +Found expected sequence 1, type 1 (descriptor block) at block 128 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 378 +Found expected sequence 1, type 1 (descriptor block) at block 503 +Found expected sequence 1, type 1 (descriptor block) at block 628 +Found expected sequence 1, type 1 (descriptor block) at block 753 +Found expected sequence 1, type 1 (descriptor block) at block 878 +Found expected sequence 1, type 1 (descriptor block) at block 1003 +Found expected sequence 1, type 1 (descriptor block) at block 1128 +Found expected sequence 1, type 1 (descriptor block) at block 1253 +Found expected sequence 1, type 1 (descriptor block) at block 1378 +Found expected sequence 1, type 1 (descriptor block) at block 1503 +Found expected sequence 1, type 1 (descriptor block) at block 1628 +Found expected sequence 1, type 1 (descriptor block) at block 1753 +Found expected sequence 1, type 1 (descriptor block) at block 1878 +Found expected sequence 1, type 1 (descriptor block) at block 2003 +Found expected sequence 1, type 1 (descriptor block) at block 2128 +Found expected sequence 1, type 1 (descriptor block) at block 2253 +Found expected sequence 1, type 1 (descriptor block) at block 2378 +Found expected sequence 1, type 1 (descriptor block) at block 2503 +Found expected sequence 1, type 1 (descriptor block) at block 2628 +Found expected sequence 1, type 1 (descriptor block) at block 2753 +Found expected sequence 1, type 1 (descriptor block) at block 2878 +Found expected sequence 1, type 1 (descriptor block) at block 3003 +Found expected sequence 1, type 1 (descriptor block) at block 3128 +Found expected sequence 1, type 1 (descriptor block) at block 3253 +Found expected sequence 1, type 1 (descriptor block) at block 3378 +Found expected sequence 1, type 1 (descriptor block) at block 3503 +Found expected sequence 1, type 1 (descriptor block) at block 3628 +Found expected sequence 1, type 1 (descriptor block) at block 3753 +Found expected sequence 1, type 1 (descriptor block) at block 3878 +Found expected sequence 1, type 1 (descriptor block) at block 4003 +Found expected sequence 1, type 1 (descriptor block) at block 4128 +Found expected sequence 1, type 2 (commit block) at block 4135 +Found expected sequence 2, type 5 (revoke table) at block 4136 +Found expected sequence 2, type 5 (revoke table) at block 4137 +Found expected sequence 2, type 5 (revoke table) at block 4138 +Found expected sequence 2, type 5 (revoke table) at block 4139 +Found expected sequence 2, type 5 (revoke table) at block 4140 +Found expected sequence 2, type 5 (revoke table) at block 4141 +Found expected sequence 2, type 5 (revoke table) at block 4142 +Found expected sequence 2, type 5 (revoke table) at block 4143 +Found expected sequence 2, type 5 (revoke table) at block 4144 +Found expected sequence 2, type 5 (revoke table) at block 4145 +Found expected sequence 2, type 5 (revoke table) at block 4146 +Found expected sequence 2, type 5 (revoke table) at block 4147 +Found expected sequence 2, type 5 (revoke table) at block 4148 +Found expected sequence 2, type 5 (revoke table) at block 4149 +Found expected sequence 2, type 5 (revoke table) at block 4150 +Found expected sequence 2, type 5 (revoke table) at block 4151 +Found expected sequence 2, type 5 (revoke table) at block 4152 +Found expected sequence 2, type 2 (commit block) at block 4153 +No magic number at block 4154: end of journal. +debugfs fsck +test_filesys: recovering journal +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: 11/16384 files (0.0% non-contiguous), 6239/262144 blocks +Exit status is 0 diff --git a/tests/j_ext_long_revoke_trans/name b/tests/j_ext_long_revoke_trans/name new file mode 100644 index 0000000..932a5bd --- /dev/null +++ b/tests/j_ext_long_revoke_trans/name @@ -0,0 +1 @@ +revoke trans nuking free space w/ ext. journal diff --git a/tests/j_ext_long_revoke_trans/script b/tests/j_ext_long_revoke_trans/script new file mode 100644 index 0000000..c99c8f1 --- /dev/null +++ b/tests/j_ext_long_revoke_trans/script @@ -0,0 +1,65 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +JNLFILE=$TMPFILE.jnl + +touch $JNLFILE +$MKE2FS -F -o Linux -b 1024 -O journal_dev -T ext4 -U 1db3f677-6832-4adb-bafc-8e4059c30a34 $JNLFILE 262144 > $OUT.new 2>&1 +$MKE2FS -F -o Linux -b 1024 -O ^has_journal -T ext4 $TMPFILE 262144 >> $OUT.new 2>&1 + +echo "debugfs add journal device/UUID" >> $OUT.new +$DEBUGFS -w -f - $TMPFILE <<-EOF >> $OUT.new 2>&1 + feature has_journal + ssv journal_dev 0x9999 + ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +EOF + +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -f $JNLFILE" > $TMPFILE.cmd +echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo -f $JNLFILE" >> $TMPFILE.cmd +echo "jw -r 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$JNLFILE" "$JOURNAL_DUMP_DIR/$test_name.img.jnl" +echo "logdump -c -f $JNLFILE" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs fsck" >> $OUT.new +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $JNLFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP JNLFILE diff --git a/tests/j_ext_long_trans/expect b/tests/j_ext_long_trans/expect new file mode 100644 index 0000000..ea3c87f --- /dev/null +++ b/tests/j_ext_long_trans/expect @@ -0,0 +1,106 @@ +Creating filesystem with 262144 1k blocks and 0 inodes +Superblock backups stored on blocks: + +Zeroing journal device: +Creating filesystem with 262144 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +debugfs add journal device/UUID +debugfs: feature has_journal +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +debugfs: ssv journal_dev 0x9999 +debugfs: ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +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: 11/16384 files (0.0% non-contiguous), 6239/262144 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Ext2 superblock header found. +Journal starts at block 3, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 3 +Found expected sequence 1, type 1 (descriptor block) at block 128 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 378 +Found expected sequence 1, type 1 (descriptor block) at block 503 +Found expected sequence 1, type 1 (descriptor block) at block 628 +Found expected sequence 1, type 1 (descriptor block) at block 753 +Found expected sequence 1, type 1 (descriptor block) at block 878 +Found expected sequence 1, type 1 (descriptor block) at block 1003 +Found expected sequence 1, type 1 (descriptor block) at block 1128 +Found expected sequence 1, type 1 (descriptor block) at block 1253 +Found expected sequence 1, type 1 (descriptor block) at block 1378 +Found expected sequence 1, type 1 (descriptor block) at block 1503 +Found expected sequence 1, type 1 (descriptor block) at block 1628 +Found expected sequence 1, type 1 (descriptor block) at block 1753 +Found expected sequence 1, type 1 (descriptor block) at block 1878 +Found expected sequence 1, type 1 (descriptor block) at block 2003 +Found expected sequence 1, type 1 (descriptor block) at block 2128 +Found expected sequence 1, type 1 (descriptor block) at block 2253 +Found expected sequence 1, type 1 (descriptor block) at block 2378 +Found expected sequence 1, type 1 (descriptor block) at block 2503 +Found expected sequence 1, type 1 (descriptor block) at block 2628 +Found expected sequence 1, type 1 (descriptor block) at block 2753 +Found expected sequence 1, type 1 (descriptor block) at block 2878 +Found expected sequence 1, type 1 (descriptor block) at block 3003 +Found expected sequence 1, type 1 (descriptor block) at block 3128 +Found expected sequence 1, type 1 (descriptor block) at block 3253 +Found expected sequence 1, type 1 (descriptor block) at block 3378 +Found expected sequence 1, type 1 (descriptor block) at block 3503 +Found expected sequence 1, type 1 (descriptor block) at block 3628 +Found expected sequence 1, type 1 (descriptor block) at block 3753 +Found expected sequence 1, type 1 (descriptor block) at block 3878 +Found expected sequence 1, type 1 (descriptor block) at block 4003 +Found expected sequence 1, type 1 (descriptor block) at block 4128 +Found expected sequence 1, type 2 (commit block) at block 4135 +No magic number at block 4136: end of journal. +debugfs fsck +test_filesys: recovering journal +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--259) +275 +(291--418) +2341 +Fix? yes + +Free blocks count wrong for group #0 (5838, counted=5851). +Fix? yes + +Free blocks count wrong (255903, counted=255916). +Fix? yes + +Inode bitmap differences: +1 +(3--10) +Fix? yes + +Free inodes count wrong for group #0 (500, counted=501). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (16372, counted=16373). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 6228/262144 blocks +Exit status is 1 diff --git a/tests/j_ext_long_trans/name b/tests/j_ext_long_trans/name new file mode 100644 index 0000000..8ae5722 --- /dev/null +++ b/tests/j_ext_long_trans/name @@ -0,0 +1 @@ +transaction nuking free space w/ ext. journal diff --git a/tests/j_ext_long_trans/script b/tests/j_ext_long_trans/script new file mode 100644 index 0000000..f19fb89 --- /dev/null +++ b/tests/j_ext_long_trans/script @@ -0,0 +1,62 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +JNLFILE=$TMPFILE.jnl + +touch $JNLFILE +$MKE2FS -F -o Linux -b 1024 -O journal_dev -T ext4 -U 1db3f677-6832-4adb-bafc-8e4059c30a34 $JNLFILE 262144 > $OUT.new 2>&1 +$MKE2FS -F -o Linux -b 1024 -O ^has_journal -T ext4 $TMPFILE 262144 >> $OUT.new 2>&1 + +echo "debugfs add journal device/UUID" >> $OUT.new +$DEBUGFS -w -f - $TMPFILE <<- EOF >> $OUT.new 2>&1 + feature has_journal + ssv journal_dev 0x9999 + ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a34 +EOF + +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -f $JNLFILE" > $TMPFILE.cmd +echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$JNLFILE" "$JOURNAL_DUMP_DIR/$test_name.img.jnl" +echo "logdump -c -f $JNLFILE" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs fsck" >> $OUT.new +$FSCK -fy -N test_filesys -j $JNLFILE $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e 's/logdump -c -f.*/logdump -c/g' $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $JNLFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP JNLFILE diff --git a/tests/j_long_revoke_trans/expect b/tests/j_long_revoke_trans/expect new file mode 100644 index 0000000..c0730e6 --- /dev/null +++ b/tests/j_long_revoke_trans/expect @@ -0,0 +1,81 @@ +Creating filesystem with 262144 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185 + +Allocating group tables: done +Writing inode tables: done +Creating journal (8192 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 14431/262144 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 126 +Found expected sequence 1, type 1 (descriptor block) at block 251 +Found expected sequence 1, type 1 (descriptor block) at block 376 +Found expected sequence 1, type 1 (descriptor block) at block 501 +Found expected sequence 1, type 1 (descriptor block) at block 626 +Found expected sequence 1, type 1 (descriptor block) at block 751 +Found expected sequence 1, type 1 (descriptor block) at block 876 +Found expected sequence 1, type 1 (descriptor block) at block 1001 +Found expected sequence 1, type 1 (descriptor block) at block 1126 +Found expected sequence 1, type 1 (descriptor block) at block 1251 +Found expected sequence 1, type 1 (descriptor block) at block 1376 +Found expected sequence 1, type 1 (descriptor block) at block 1501 +Found expected sequence 1, type 1 (descriptor block) at block 1626 +Found expected sequence 1, type 1 (descriptor block) at block 1751 +Found expected sequence 1, type 1 (descriptor block) at block 1876 +Found expected sequence 1, type 1 (descriptor block) at block 2001 +Found expected sequence 1, type 1 (descriptor block) at block 2126 +Found expected sequence 1, type 1 (descriptor block) at block 2251 +Found expected sequence 1, type 1 (descriptor block) at block 2376 +Found expected sequence 1, type 1 (descriptor block) at block 2501 +Found expected sequence 1, type 1 (descriptor block) at block 2626 +Found expected sequence 1, type 1 (descriptor block) at block 2751 +Found expected sequence 1, type 1 (descriptor block) at block 2876 +Found expected sequence 1, type 1 (descriptor block) at block 3001 +Found expected sequence 1, type 1 (descriptor block) at block 3126 +Found expected sequence 1, type 1 (descriptor block) at block 3251 +Found expected sequence 1, type 1 (descriptor block) at block 3376 +Found expected sequence 1, type 1 (descriptor block) at block 3501 +Found expected sequence 1, type 1 (descriptor block) at block 3626 +Found expected sequence 1, type 1 (descriptor block) at block 3751 +Found expected sequence 1, type 1 (descriptor block) at block 3876 +Found expected sequence 1, type 1 (descriptor block) at block 4001 +Found expected sequence 1, type 1 (descriptor block) at block 4126 +Found expected sequence 1, type 2 (commit block) at block 4133 +Found expected sequence 2, type 5 (revoke table) at block 4134 +Found expected sequence 2, type 5 (revoke table) at block 4135 +Found expected sequence 2, type 5 (revoke table) at block 4136 +Found expected sequence 2, type 5 (revoke table) at block 4137 +Found expected sequence 2, type 5 (revoke table) at block 4138 +Found expected sequence 2, type 5 (revoke table) at block 4139 +Found expected sequence 2, type 5 (revoke table) at block 4140 +Found expected sequence 2, type 5 (revoke table) at block 4141 +Found expected sequence 2, type 5 (revoke table) at block 4142 +Found expected sequence 2, type 5 (revoke table) at block 4143 +Found expected sequence 2, type 5 (revoke table) at block 4144 +Found expected sequence 2, type 5 (revoke table) at block 4145 +Found expected sequence 2, type 5 (revoke table) at block 4146 +Found expected sequence 2, type 5 (revoke table) at block 4147 +Found expected sequence 2, type 5 (revoke table) at block 4148 +Found expected sequence 2, type 5 (revoke table) at block 4149 +Found expected sequence 2, type 5 (revoke table) at block 4150 +Found expected sequence 2, type 2 (commit block) at block 4151 +No magic number at block 4152: end of journal. +test_filesys: recovering journal +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: 11/16384 files (0.0% non-contiguous), 14431/262144 blocks +Exit status is 0 diff --git a/tests/j_long_revoke_trans/name b/tests/j_long_revoke_trans/name new file mode 100644 index 0000000..3cbb2cd --- /dev/null +++ b/tests/j_long_revoke_trans/name @@ -0,0 +1 @@ +revoked transaction nuking free space diff --git a/tests/j_long_revoke_trans/script b/tests/j_long_revoke_trans/script new file mode 100644 index 0000000..d59578d --- /dev/null +++ b/tests/j_long_revoke_trans/script @@ -0,0 +1,52 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O has_journal -T ext4 $TMPFILE 262144 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r 259-4356" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_long_revoke_trans_mcsum_32bit/expect b/tests/j_long_revoke_trans_mcsum_32bit/expect new file mode 100644 index 0000000..664a301 --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_32bit/expect @@ -0,0 +1,117 @@ +64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -O 64bit to rectify. +Creating filesystem with 524288 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 27050/524288 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_incompat_revoke journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 64 +Found expected sequence 1, type 1 (descriptor block) at block 127 +Found expected sequence 1, type 1 (descriptor block) at block 190 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 316 +Found expected sequence 1, type 1 (descriptor block) at block 379 +Found expected sequence 1, type 1 (descriptor block) at block 442 +Found expected sequence 1, type 1 (descriptor block) at block 505 +Found expected sequence 1, type 1 (descriptor block) at block 568 +Found expected sequence 1, type 1 (descriptor block) at block 631 +Found expected sequence 1, type 1 (descriptor block) at block 694 +Found expected sequence 1, type 1 (descriptor block) at block 757 +Found expected sequence 1, type 1 (descriptor block) at block 820 +Found expected sequence 1, type 1 (descriptor block) at block 883 +Found expected sequence 1, type 1 (descriptor block) at block 946 +Found expected sequence 1, type 1 (descriptor block) at block 1009 +Found expected sequence 1, type 1 (descriptor block) at block 1072 +Found expected sequence 1, type 1 (descriptor block) at block 1135 +Found expected sequence 1, type 1 (descriptor block) at block 1198 +Found expected sequence 1, type 1 (descriptor block) at block 1261 +Found expected sequence 1, type 1 (descriptor block) at block 1324 +Found expected sequence 1, type 1 (descriptor block) at block 1387 +Found expected sequence 1, type 1 (descriptor block) at block 1450 +Found expected sequence 1, type 1 (descriptor block) at block 1513 +Found expected sequence 1, type 1 (descriptor block) at block 1576 +Found expected sequence 1, type 1 (descriptor block) at block 1639 +Found expected sequence 1, type 1 (descriptor block) at block 1702 +Found expected sequence 1, type 1 (descriptor block) at block 1765 +Found expected sequence 1, type 1 (descriptor block) at block 1828 +Found expected sequence 1, type 1 (descriptor block) at block 1891 +Found expected sequence 1, type 1 (descriptor block) at block 1954 +Found expected sequence 1, type 1 (descriptor block) at block 2017 +Found expected sequence 1, type 1 (descriptor block) at block 2080 +Found expected sequence 1, type 1 (descriptor block) at block 2143 +Found expected sequence 1, type 1 (descriptor block) at block 2206 +Found expected sequence 1, type 1 (descriptor block) at block 2269 +Found expected sequence 1, type 1 (descriptor block) at block 2332 +Found expected sequence 1, type 1 (descriptor block) at block 2395 +Found expected sequence 1, type 1 (descriptor block) at block 2458 +Found expected sequence 1, type 1 (descriptor block) at block 2521 +Found expected sequence 1, type 1 (descriptor block) at block 2584 +Found expected sequence 1, type 1 (descriptor block) at block 2647 +Found expected sequence 1, type 1 (descriptor block) at block 2710 +Found expected sequence 1, type 1 (descriptor block) at block 2773 +Found expected sequence 1, type 1 (descriptor block) at block 2836 +Found expected sequence 1, type 1 (descriptor block) at block 2899 +Found expected sequence 1, type 1 (descriptor block) at block 2962 +Found expected sequence 1, type 1 (descriptor block) at block 3025 +Found expected sequence 1, type 1 (descriptor block) at block 3088 +Found expected sequence 1, type 1 (descriptor block) at block 3151 +Found expected sequence 1, type 1 (descriptor block) at block 3214 +Found expected sequence 1, type 1 (descriptor block) at block 3277 +Found expected sequence 1, type 1 (descriptor block) at block 3340 +Found expected sequence 1, type 1 (descriptor block) at block 3403 +Found expected sequence 1, type 1 (descriptor block) at block 3466 +Found expected sequence 1, type 1 (descriptor block) at block 3529 +Found expected sequence 1, type 1 (descriptor block) at block 3592 +Found expected sequence 1, type 1 (descriptor block) at block 3655 +Found expected sequence 1, type 1 (descriptor block) at block 3718 +Found expected sequence 1, type 1 (descriptor block) at block 3781 +Found expected sequence 1, type 1 (descriptor block) at block 3844 +Found expected sequence 1, type 1 (descriptor block) at block 3907 +Found expected sequence 1, type 1 (descriptor block) at block 3970 +Found expected sequence 1, type 1 (descriptor block) at block 4033 +Found expected sequence 1, type 1 (descriptor block) at block 4096 +Found expected sequence 1, type 1 (descriptor block) at block 4159 +Found expected sequence 1, type 2 (commit block) at block 4165 +Found expected sequence 2, type 5 (revoke table) at block 4166 +Found expected sequence 2, type 5 (revoke table) at block 4167 +Found expected sequence 2, type 5 (revoke table) at block 4168 +Found expected sequence 2, type 5 (revoke table) at block 4169 +Found expected sequence 2, type 5 (revoke table) at block 4170 +Found expected sequence 2, type 5 (revoke table) at block 4171 +Found expected sequence 2, type 5 (revoke table) at block 4172 +Found expected sequence 2, type 5 (revoke table) at block 4173 +Found expected sequence 2, type 5 (revoke table) at block 4174 +Found expected sequence 2, type 5 (revoke table) at block 4175 +Found expected sequence 2, type 5 (revoke table) at block 4176 +Found expected sequence 2, type 5 (revoke table) at block 4177 +Found expected sequence 2, type 5 (revoke table) at block 4178 +Found expected sequence 2, type 5 (revoke table) at block 4179 +Found expected sequence 2, type 5 (revoke table) at block 4180 +Found expected sequence 2, type 5 (revoke table) at block 4181 +Found expected sequence 2, type 5 (revoke table) at block 4182 +Found expected sequence 2, type 2 (commit block) at block 4183 +No magic number at block 4184: end of journal. +test_filesys: recovering journal +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: 11/32768 files (0.0% non-contiguous), 27050/524288 blocks +Exit status is 0 diff --git a/tests/j_long_revoke_trans_mcsum_32bit/name b/tests/j_long_revoke_trans_mcsum_32bit/name new file mode 100644 index 0000000..1aca67d --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_32bit/name @@ -0,0 +1 @@ +revoked trans nuking free space 32bit,mcsum diff --git a/tests/j_long_revoke_trans_mcsum_32bit/script b/tests/j_long_revoke_trans_mcsum_32bit/script new file mode 100644 index 0000000..8e5a029 --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_32bit/script @@ -0,0 +1,56 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O ^64bit,has_journal,metadata_csum -T ext4 $TMPFILE 524288 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b 260-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r 260-4356" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_long_revoke_trans_mcsum_64bit/expect b/tests/j_long_revoke_trans_mcsum_64bit/expect new file mode 100644 index 0000000..29dc407 --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_64bit/expect @@ -0,0 +1,132 @@ +Creating filesystem with 524288 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 27068/524288 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_incompat_revoke journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 64 +Found expected sequence 1, type 1 (descriptor block) at block 127 +Found expected sequence 1, type 1 (descriptor block) at block 190 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 316 +Found expected sequence 1, type 1 (descriptor block) at block 379 +Found expected sequence 1, type 1 (descriptor block) at block 442 +Found expected sequence 1, type 1 (descriptor block) at block 505 +Found expected sequence 1, type 1 (descriptor block) at block 568 +Found expected sequence 1, type 1 (descriptor block) at block 631 +Found expected sequence 1, type 1 (descriptor block) at block 694 +Found expected sequence 1, type 1 (descriptor block) at block 757 +Found expected sequence 1, type 1 (descriptor block) at block 820 +Found expected sequence 1, type 1 (descriptor block) at block 883 +Found expected sequence 1, type 1 (descriptor block) at block 946 +Found expected sequence 1, type 1 (descriptor block) at block 1009 +Found expected sequence 1, type 1 (descriptor block) at block 1072 +Found expected sequence 1, type 1 (descriptor block) at block 1135 +Found expected sequence 1, type 1 (descriptor block) at block 1198 +Found expected sequence 1, type 1 (descriptor block) at block 1261 +Found expected sequence 1, type 1 (descriptor block) at block 1324 +Found expected sequence 1, type 1 (descriptor block) at block 1387 +Found expected sequence 1, type 1 (descriptor block) at block 1450 +Found expected sequence 1, type 1 (descriptor block) at block 1513 +Found expected sequence 1, type 1 (descriptor block) at block 1576 +Found expected sequence 1, type 1 (descriptor block) at block 1639 +Found expected sequence 1, type 1 (descriptor block) at block 1702 +Found expected sequence 1, type 1 (descriptor block) at block 1765 +Found expected sequence 1, type 1 (descriptor block) at block 1828 +Found expected sequence 1, type 1 (descriptor block) at block 1891 +Found expected sequence 1, type 1 (descriptor block) at block 1954 +Found expected sequence 1, type 1 (descriptor block) at block 2017 +Found expected sequence 1, type 1 (descriptor block) at block 2080 +Found expected sequence 1, type 1 (descriptor block) at block 2143 +Found expected sequence 1, type 1 (descriptor block) at block 2206 +Found expected sequence 1, type 1 (descriptor block) at block 2269 +Found expected sequence 1, type 1 (descriptor block) at block 2332 +Found expected sequence 1, type 1 (descriptor block) at block 2395 +Found expected sequence 1, type 1 (descriptor block) at block 2458 +Found expected sequence 1, type 1 (descriptor block) at block 2521 +Found expected sequence 1, type 1 (descriptor block) at block 2584 +Found expected sequence 1, type 1 (descriptor block) at block 2647 +Found expected sequence 1, type 1 (descriptor block) at block 2710 +Found expected sequence 1, type 1 (descriptor block) at block 2773 +Found expected sequence 1, type 1 (descriptor block) at block 2836 +Found expected sequence 1, type 1 (descriptor block) at block 2899 +Found expected sequence 1, type 1 (descriptor block) at block 2962 +Found expected sequence 1, type 1 (descriptor block) at block 3025 +Found expected sequence 1, type 1 (descriptor block) at block 3088 +Found expected sequence 1, type 1 (descriptor block) at block 3151 +Found expected sequence 1, type 1 (descriptor block) at block 3214 +Found expected sequence 1, type 1 (descriptor block) at block 3277 +Found expected sequence 1, type 1 (descriptor block) at block 3340 +Found expected sequence 1, type 1 (descriptor block) at block 3403 +Found expected sequence 1, type 1 (descriptor block) at block 3466 +Found expected sequence 1, type 1 (descriptor block) at block 3529 +Found expected sequence 1, type 1 (descriptor block) at block 3592 +Found expected sequence 1, type 1 (descriptor block) at block 3655 +Found expected sequence 1, type 1 (descriptor block) at block 3718 +Found expected sequence 1, type 1 (descriptor block) at block 3781 +Found expected sequence 1, type 1 (descriptor block) at block 3844 +Found expected sequence 1, type 1 (descriptor block) at block 3907 +Found expected sequence 1, type 1 (descriptor block) at block 3970 +Found expected sequence 1, type 1 (descriptor block) at block 4033 +Found expected sequence 1, type 1 (descriptor block) at block 4096 +Found expected sequence 1, type 1 (descriptor block) at block 4159 +Found expected sequence 1, type 2 (commit block) at block 4165 +Found expected sequence 2, type 5 (revoke table) at block 4166 +Found expected sequence 2, type 5 (revoke table) at block 4167 +Found expected sequence 2, type 5 (revoke table) at block 4168 +Found expected sequence 2, type 5 (revoke table) at block 4169 +Found expected sequence 2, type 5 (revoke table) at block 4170 +Found expected sequence 2, type 5 (revoke table) at block 4171 +Found expected sequence 2, type 5 (revoke table) at block 4172 +Found expected sequence 2, type 5 (revoke table) at block 4173 +Found expected sequence 2, type 5 (revoke table) at block 4174 +Found expected sequence 2, type 5 (revoke table) at block 4175 +Found expected sequence 2, type 5 (revoke table) at block 4176 +Found expected sequence 2, type 5 (revoke table) at block 4177 +Found expected sequence 2, type 5 (revoke table) at block 4178 +Found expected sequence 2, type 5 (revoke table) at block 4179 +Found expected sequence 2, type 5 (revoke table) at block 4180 +Found expected sequence 2, type 5 (revoke table) at block 4181 +Found expected sequence 2, type 5 (revoke table) at block 4182 +Found expected sequence 2, type 5 (revoke table) at block 4183 +Found expected sequence 2, type 5 (revoke table) at block 4184 +Found expected sequence 2, type 5 (revoke table) at block 4185 +Found expected sequence 2, type 5 (revoke table) at block 4186 +Found expected sequence 2, type 5 (revoke table) at block 4187 +Found expected sequence 2, type 5 (revoke table) at block 4188 +Found expected sequence 2, type 5 (revoke table) at block 4189 +Found expected sequence 2, type 5 (revoke table) at block 4190 +Found expected sequence 2, type 5 (revoke table) at block 4191 +Found expected sequence 2, type 5 (revoke table) at block 4192 +Found expected sequence 2, type 5 (revoke table) at block 4193 +Found expected sequence 2, type 5 (revoke table) at block 4194 +Found expected sequence 2, type 5 (revoke table) at block 4195 +Found expected sequence 2, type 5 (revoke table) at block 4196 +Found expected sequence 2, type 5 (revoke table) at block 4197 +Found expected sequence 2, type 5 (revoke table) at block 4198 +Found expected sequence 2, type 2 (commit block) at block 4199 +No magic number at block 4200: end of journal. +test_filesys: recovering journal +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: 11/32768 files (0.0% non-contiguous), 27068/524288 blocks +Exit status is 0 diff --git a/tests/j_long_revoke_trans_mcsum_64bit/name b/tests/j_long_revoke_trans_mcsum_64bit/name new file mode 100644 index 0000000..0fa20fe --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_64bit/name @@ -0,0 +1 @@ +revoke trans nuking free space 64bit,mcsum diff --git a/tests/j_long_revoke_trans_mcsum_64bit/script b/tests/j_long_revoke_trans_mcsum_64bit/script new file mode 100644 index 0000000..4bc0962 --- /dev/null +++ b/tests/j_long_revoke_trans_mcsum_64bit/script @@ -0,0 +1,56 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 524288 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b 262-4358 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r 262-4358" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_long_trans/expect b/tests/j_long_trans/expect new file mode 100644 index 0000000..82b3caf --- /dev/null +++ b/tests/j_long_trans/expect @@ -0,0 +1,109 @@ +Creating filesystem with 262144 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185 + +Allocating group tables: done +Writing inode tables: done +Creating journal (8192 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 14431/262144 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 126 +Found expected sequence 1, type 1 (descriptor block) at block 251 +Found expected sequence 1, type 1 (descriptor block) at block 376 +Found expected sequence 1, type 1 (descriptor block) at block 501 +Found expected sequence 1, type 1 (descriptor block) at block 626 +Found expected sequence 1, type 1 (descriptor block) at block 751 +Found expected sequence 1, type 1 (descriptor block) at block 876 +Found expected sequence 1, type 1 (descriptor block) at block 1001 +Found expected sequence 1, type 1 (descriptor block) at block 1126 +Found expected sequence 1, type 1 (descriptor block) at block 1251 +Found expected sequence 1, type 1 (descriptor block) at block 1376 +Found expected sequence 1, type 1 (descriptor block) at block 1501 +Found expected sequence 1, type 1 (descriptor block) at block 1626 +Found expected sequence 1, type 1 (descriptor block) at block 1751 +Found expected sequence 1, type 1 (descriptor block) at block 1876 +Found expected sequence 1, type 1 (descriptor block) at block 2001 +Found expected sequence 1, type 1 (descriptor block) at block 2126 +Found expected sequence 1, type 1 (descriptor block) at block 2251 +Found expected sequence 1, type 1 (descriptor block) at block 2376 +Found expected sequence 1, type 1 (descriptor block) at block 2501 +Found expected sequence 1, type 1 (descriptor block) at block 2626 +Found expected sequence 1, type 1 (descriptor block) at block 2751 +Found expected sequence 1, type 1 (descriptor block) at block 2876 +Found expected sequence 1, type 1 (descriptor block) at block 3001 +Found expected sequence 1, type 1 (descriptor block) at block 3126 +Found expected sequence 1, type 1 (descriptor block) at block 3251 +Found expected sequence 1, type 1 (descriptor block) at block 3376 +Found expected sequence 1, type 1 (descriptor block) at block 3501 +Found expected sequence 1, type 1 (descriptor block) at block 3626 +Found expected sequence 1, type 1 (descriptor block) at block 3751 +Found expected sequence 1, type 1 (descriptor block) at block 3876 +Found expected sequence 1, type 1 (descriptor block) at block 4001 +Found expected sequence 1, type 1 (descriptor block) at block 4126 +Found expected sequence 1, type 2 (commit block) at block 4133 +No magic number at block 4134: end of journal. +test_filesys: recovering journal +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--259) +273 +275 +289 +(291--418) +(2083--2210) +2341 +Fix? yes + +Free blocks count wrong for group #0 (5838, counted=5851). +Fix? yes + +Free blocks count wrong for group #14 (0, counted=8192). +Fix? yes + +Free blocks count wrong (247711, counted=255916). +Fix? yes + +Inode bitmap differences: +1 +(3--10) +Fix? yes + +Free inodes count wrong for group #0 (500, counted=501). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (16372, counted=16373). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Recreate journal? yes + +Creating journal (8192 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 14420/262144 blocks +Exit status is 1 diff --git a/tests/j_long_trans/name b/tests/j_long_trans/name new file mode 100644 index 0000000..7a70f8f --- /dev/null +++ b/tests/j_long_trans/name @@ -0,0 +1 @@ +transaction nuking free space diff --git a/tests/j_long_trans/script b/tests/j_long_trans/script new file mode 100644 index 0000000..ff4dab3 --- /dev/null +++ b/tests/j_long_trans/script @@ -0,0 +1,49 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O has_journal -T ext4 $TMPFILE 262144 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_long_trans_mcsum_32bit/expect b/tests/j_long_trans_mcsum_32bit/expect new file mode 100644 index 0000000..ffae07a --- /dev/null +++ b/tests/j_long_trans_mcsum_32bit/expect @@ -0,0 +1,148 @@ +64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -O 64bit to rectify. +Creating filesystem with 524288 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 27050/524288 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 64 +Found expected sequence 1, type 1 (descriptor block) at block 127 +Found expected sequence 1, type 1 (descriptor block) at block 190 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 316 +Found expected sequence 1, type 1 (descriptor block) at block 379 +Found expected sequence 1, type 1 (descriptor block) at block 442 +Found expected sequence 1, type 1 (descriptor block) at block 505 +Found expected sequence 1, type 1 (descriptor block) at block 568 +Found expected sequence 1, type 1 (descriptor block) at block 631 +Found expected sequence 1, type 1 (descriptor block) at block 694 +Found expected sequence 1, type 1 (descriptor block) at block 757 +Found expected sequence 1, type 1 (descriptor block) at block 820 +Found expected sequence 1, type 1 (descriptor block) at block 883 +Found expected sequence 1, type 1 (descriptor block) at block 946 +Found expected sequence 1, type 1 (descriptor block) at block 1009 +Found expected sequence 1, type 1 (descriptor block) at block 1072 +Found expected sequence 1, type 1 (descriptor block) at block 1135 +Found expected sequence 1, type 1 (descriptor block) at block 1198 +Found expected sequence 1, type 1 (descriptor block) at block 1261 +Found expected sequence 1, type 1 (descriptor block) at block 1324 +Found expected sequence 1, type 1 (descriptor block) at block 1387 +Found expected sequence 1, type 1 (descriptor block) at block 1450 +Found expected sequence 1, type 1 (descriptor block) at block 1513 +Found expected sequence 1, type 1 (descriptor block) at block 1576 +Found expected sequence 1, type 1 (descriptor block) at block 1639 +Found expected sequence 1, type 1 (descriptor block) at block 1702 +Found expected sequence 1, type 1 (descriptor block) at block 1765 +Found expected sequence 1, type 1 (descriptor block) at block 1828 +Found expected sequence 1, type 1 (descriptor block) at block 1891 +Found expected sequence 1, type 1 (descriptor block) at block 1954 +Found expected sequence 1, type 1 (descriptor block) at block 2017 +Found expected sequence 1, type 1 (descriptor block) at block 2080 +Found expected sequence 1, type 1 (descriptor block) at block 2143 +Found expected sequence 1, type 1 (descriptor block) at block 2206 +Found expected sequence 1, type 1 (descriptor block) at block 2269 +Found expected sequence 1, type 1 (descriptor block) at block 2332 +Found expected sequence 1, type 1 (descriptor block) at block 2395 +Found expected sequence 1, type 1 (descriptor block) at block 2458 +Found expected sequence 1, type 1 (descriptor block) at block 2521 +Found expected sequence 1, type 1 (descriptor block) at block 2584 +Found expected sequence 1, type 1 (descriptor block) at block 2647 +Found expected sequence 1, type 1 (descriptor block) at block 2710 +Found expected sequence 1, type 1 (descriptor block) at block 2773 +Found expected sequence 1, type 1 (descriptor block) at block 2836 +Found expected sequence 1, type 1 (descriptor block) at block 2899 +Found expected sequence 1, type 1 (descriptor block) at block 2962 +Found expected sequence 1, type 1 (descriptor block) at block 3025 +Found expected sequence 1, type 1 (descriptor block) at block 3088 +Found expected sequence 1, type 1 (descriptor block) at block 3151 +Found expected sequence 1, type 1 (descriptor block) at block 3214 +Found expected sequence 1, type 1 (descriptor block) at block 3277 +Found expected sequence 1, type 1 (descriptor block) at block 3340 +Found expected sequence 1, type 1 (descriptor block) at block 3403 +Found expected sequence 1, type 1 (descriptor block) at block 3466 +Found expected sequence 1, type 1 (descriptor block) at block 3529 +Found expected sequence 1, type 1 (descriptor block) at block 3592 +Found expected sequence 1, type 1 (descriptor block) at block 3655 +Found expected sequence 1, type 1 (descriptor block) at block 3718 +Found expected sequence 1, type 1 (descriptor block) at block 3781 +Found expected sequence 1, type 1 (descriptor block) at block 3844 +Found expected sequence 1, type 1 (descriptor block) at block 3907 +Found expected sequence 1, type 1 (descriptor block) at block 3970 +Found expected sequence 1, type 1 (descriptor block) at block 4033 +Found expected sequence 1, type 1 (descriptor block) at block 4096 +Found expected sequence 1, type 1 (descriptor block) at block 4159 +Found expected sequence 1, type 2 (commit block) at block 4165 +No magic number at block 4166: end of journal. +test_filesys: recovering journal +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--260) +276 +(292--419) +2342 -(139265--155648) +Fix? yes + +Free blocks count wrong for group #0 (5837, counted=5850). +Fix? yes + +Free blocks count wrong for group #17 (0, counted=8192). +Fix? yes + +Free blocks count wrong for group #18 (0, counted=8192). +Fix? yes + +Free blocks count wrong (497236, counted=513633). +Fix? yes + +Inode bitmap differences: +1 +(3--10) +Fix? yes + +Free inodes count wrong for group #0 (500, counted=501). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (32756, counted=32757). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Recreate journal? yes + +Creating journal (16384 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32768 files (0.0% non-contiguous), 27039/524288 blocks +Exit status is 1 diff --git a/tests/j_long_trans_mcsum_32bit/name b/tests/j_long_trans_mcsum_32bit/name new file mode 100644 index 0000000..d4473d9 --- /dev/null +++ b/tests/j_long_trans_mcsum_32bit/name @@ -0,0 +1 @@ +trans nuking free space 32bit,meta_csum diff --git a/tests/j_long_trans_mcsum_32bit/script b/tests/j_long_trans_mcsum_32bit/script new file mode 100644 index 0000000..76da8ca --- /dev/null +++ b/tests/j_long_trans_mcsum_32bit/script @@ -0,0 +1,53 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O ^64bit,has_journal,metadata_csum -T ext4 $TMPFILE 524288 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b 260-4356 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_long_trans_mcsum_64bit/expect b/tests/j_long_trans_mcsum_64bit/expect new file mode 100644 index 0000000..e891def --- /dev/null +++ b/tests/j_long_trans_mcsum_64bit/expect @@ -0,0 +1,147 @@ +Creating filesystem with 524288 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 27068/524288 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 1 (descriptor block) at block 64 +Found expected sequence 1, type 1 (descriptor block) at block 127 +Found expected sequence 1, type 1 (descriptor block) at block 190 +Found expected sequence 1, type 1 (descriptor block) at block 253 +Found expected sequence 1, type 1 (descriptor block) at block 316 +Found expected sequence 1, type 1 (descriptor block) at block 379 +Found expected sequence 1, type 1 (descriptor block) at block 442 +Found expected sequence 1, type 1 (descriptor block) at block 505 +Found expected sequence 1, type 1 (descriptor block) at block 568 +Found expected sequence 1, type 1 (descriptor block) at block 631 +Found expected sequence 1, type 1 (descriptor block) at block 694 +Found expected sequence 1, type 1 (descriptor block) at block 757 +Found expected sequence 1, type 1 (descriptor block) at block 820 +Found expected sequence 1, type 1 (descriptor block) at block 883 +Found expected sequence 1, type 1 (descriptor block) at block 946 +Found expected sequence 1, type 1 (descriptor block) at block 1009 +Found expected sequence 1, type 1 (descriptor block) at block 1072 +Found expected sequence 1, type 1 (descriptor block) at block 1135 +Found expected sequence 1, type 1 (descriptor block) at block 1198 +Found expected sequence 1, type 1 (descriptor block) at block 1261 +Found expected sequence 1, type 1 (descriptor block) at block 1324 +Found expected sequence 1, type 1 (descriptor block) at block 1387 +Found expected sequence 1, type 1 (descriptor block) at block 1450 +Found expected sequence 1, type 1 (descriptor block) at block 1513 +Found expected sequence 1, type 1 (descriptor block) at block 1576 +Found expected sequence 1, type 1 (descriptor block) at block 1639 +Found expected sequence 1, type 1 (descriptor block) at block 1702 +Found expected sequence 1, type 1 (descriptor block) at block 1765 +Found expected sequence 1, type 1 (descriptor block) at block 1828 +Found expected sequence 1, type 1 (descriptor block) at block 1891 +Found expected sequence 1, type 1 (descriptor block) at block 1954 +Found expected sequence 1, type 1 (descriptor block) at block 2017 +Found expected sequence 1, type 1 (descriptor block) at block 2080 +Found expected sequence 1, type 1 (descriptor block) at block 2143 +Found expected sequence 1, type 1 (descriptor block) at block 2206 +Found expected sequence 1, type 1 (descriptor block) at block 2269 +Found expected sequence 1, type 1 (descriptor block) at block 2332 +Found expected sequence 1, type 1 (descriptor block) at block 2395 +Found expected sequence 1, type 1 (descriptor block) at block 2458 +Found expected sequence 1, type 1 (descriptor block) at block 2521 +Found expected sequence 1, type 1 (descriptor block) at block 2584 +Found expected sequence 1, type 1 (descriptor block) at block 2647 +Found expected sequence 1, type 1 (descriptor block) at block 2710 +Found expected sequence 1, type 1 (descriptor block) at block 2773 +Found expected sequence 1, type 1 (descriptor block) at block 2836 +Found expected sequence 1, type 1 (descriptor block) at block 2899 +Found expected sequence 1, type 1 (descriptor block) at block 2962 +Found expected sequence 1, type 1 (descriptor block) at block 3025 +Found expected sequence 1, type 1 (descriptor block) at block 3088 +Found expected sequence 1, type 1 (descriptor block) at block 3151 +Found expected sequence 1, type 1 (descriptor block) at block 3214 +Found expected sequence 1, type 1 (descriptor block) at block 3277 +Found expected sequence 1, type 1 (descriptor block) at block 3340 +Found expected sequence 1, type 1 (descriptor block) at block 3403 +Found expected sequence 1, type 1 (descriptor block) at block 3466 +Found expected sequence 1, type 1 (descriptor block) at block 3529 +Found expected sequence 1, type 1 (descriptor block) at block 3592 +Found expected sequence 1, type 1 (descriptor block) at block 3655 +Found expected sequence 1, type 1 (descriptor block) at block 3718 +Found expected sequence 1, type 1 (descriptor block) at block 3781 +Found expected sequence 1, type 1 (descriptor block) at block 3844 +Found expected sequence 1, type 1 (descriptor block) at block 3907 +Found expected sequence 1, type 1 (descriptor block) at block 3970 +Found expected sequence 1, type 1 (descriptor block) at block 4033 +Found expected sequence 1, type 1 (descriptor block) at block 4096 +Found expected sequence 1, type 1 (descriptor block) at block 4159 +Found expected sequence 1, type 2 (commit block) at block 4165 +No magic number at block 4166: end of journal. +test_filesys: recovering journal +Superblock has an invalid journal (inode 8). +Clear? yes + +*** journal has been deleted *** + +Resize inode not valid. Recreate? yes + +Pass 1: Checking inodes, blocks, and sizes +Root inode is not a directory. Clear? yes + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Root inode not allocated. Allocate? yes + +/lost+found not found. Create? yes + +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: +(1--262) +278 +(294--421) +2344 -(139265--155648) +Fix? yes + +Free blocks count wrong for group #0 (5835, counted=5848). +Fix? yes + +Free blocks count wrong for group #17 (0, counted=8192). +Fix? yes + +Free blocks count wrong for group #18 (0, counted=8192). +Fix? yes + +Free blocks count wrong (497218, counted=513615). +Fix? yes + +Inode bitmap differences: +1 +(3--10) +Fix? yes + +Free inodes count wrong for group #0 (500, counted=501). +Fix? yes + +Directories count wrong for group #0 (3, counted=2). +Fix? yes + +Free inodes count wrong (32756, counted=32757). +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + +Recreate journal? yes + +Creating journal (16384 blocks): Done. + +*** journal has been regenerated *** + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32768 files (0.0% non-contiguous), 27057/524288 blocks +Exit status is 1 diff --git a/tests/j_long_trans_mcsum_64bit/name b/tests/j_long_trans_mcsum_64bit/name new file mode 100644 index 0000000..e204e79 --- /dev/null +++ b/tests/j_long_trans_mcsum_64bit/name @@ -0,0 +1 @@ +trans nuking free space 64bit,meta_csum diff --git a/tests/j_long_trans_mcsum_64bit/script b/tests/j_long_trans_mcsum_64bit/script new file mode 100644 index 0000000..b68d1d5 --- /dev/null +++ b/tests/j_long_trans_mcsum_64bit/script @@ -0,0 +1,53 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 524288 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b 262-4358 /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_recover_csum2_32bit/expect.1 b/tests/j_recover_csum2_32bit/expect.1 new file mode 100644 index 0000000..fdbda36 --- /dev/null +++ b/tests/j_recover_csum2_32bit/expect.1 @@ -0,0 +1,18 @@ +test_filesys: recovering journal +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 +Block bitmap differences: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_32bit/expect.2 b/tests/j_recover_csum2_32bit/expect.2 new file mode 100644 index 0000000..d223026 --- /dev/null +++ b/tests/j_recover_csum2_32bit/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: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_32bit/image.bz2 b/tests/j_recover_csum2_32bit/image.bz2 Binary files differnew file mode 100644 index 0000000..2212edd --- /dev/null +++ b/tests/j_recover_csum2_32bit/image.bz2 diff --git a/tests/j_recover_csum2_32bit/name b/tests/j_recover_csum2_32bit/name new file mode 100644 index 0000000..6fd378c --- /dev/null +++ b/tests/j_recover_csum2_32bit/name @@ -0,0 +1 @@ +recover 32-bit journal checksum v2 diff --git a/tests/j_recover_csum2_32bit/script b/tests/j_recover_csum2_32bit/script new file mode 100755 index 0000000..cc736ca --- /dev/null +++ b/tests/j_recover_csum2_32bit/script @@ -0,0 +1,30 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/j_recover_csum2_64bit/expect.1 b/tests/j_recover_csum2_64bit/expect.1 new file mode 100644 index 0000000..fdbda36 --- /dev/null +++ b/tests/j_recover_csum2_64bit/expect.1 @@ -0,0 +1,18 @@ +test_filesys: recovering journal +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 +Block bitmap differences: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_64bit/expect.2 b/tests/j_recover_csum2_64bit/expect.2 new file mode 100644 index 0000000..d223026 --- /dev/null +++ b/tests/j_recover_csum2_64bit/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: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_64bit/image.bz2 b/tests/j_recover_csum2_64bit/image.bz2 Binary files differnew file mode 100644 index 0000000..acf1dae --- /dev/null +++ b/tests/j_recover_csum2_64bit/image.bz2 diff --git a/tests/j_recover_csum2_64bit/name b/tests/j_recover_csum2_64bit/name new file mode 100644 index 0000000..1770502 --- /dev/null +++ b/tests/j_recover_csum2_64bit/name @@ -0,0 +1 @@ +recover 64-bit journal checksum v2 diff --git a/tests/j_recover_csum2_64bit/script b/tests/j_recover_csum2_64bit/script new file mode 100755 index 0000000..cc736ca --- /dev/null +++ b/tests/j_recover_csum2_64bit/script @@ -0,0 +1,30 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/j_recover_csum3_64bit/expect.1 b/tests/j_recover_csum3_64bit/expect.1 new file mode 100644 index 0000000..6aed56a --- /dev/null +++ b/tests/j_recover_csum3_64bit/expect.1 @@ -0,0 +1,16 @@ +test_filesys: recovering journal +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 +Free blocks count wrong (121285, counted=121282). +Fix? yes + +Free inodes count wrong (32757, counted=32754). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/32768 files (0.0% non-contiguous), 9790/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum3_64bit/expect.2 b/tests/j_recover_csum3_64bit/expect.2 new file mode 100644 index 0000000..b7a14da --- /dev/null +++ b/tests/j_recover_csum3_64bit/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: 14/32768 files (0.0% non-contiguous), 9790/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum3_64bit/image.bz2 b/tests/j_recover_csum3_64bit/image.bz2 Binary files differnew file mode 100644 index 0000000..13b2956 --- /dev/null +++ b/tests/j_recover_csum3_64bit/image.bz2 diff --git a/tests/j_recover_csum3_64bit/name b/tests/j_recover_csum3_64bit/name new file mode 100644 index 0000000..8f91d97 --- /dev/null +++ b/tests/j_recover_csum3_64bit/name @@ -0,0 +1 @@ +recover 64-bit journal checksum v3 diff --git a/tests/j_recover_csum3_64bit/script b/tests/j_recover_csum3_64bit/script new file mode 100755 index 0000000..cc736ca --- /dev/null +++ b/tests/j_recover_csum3_64bit/script @@ -0,0 +1,30 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/j_recover_fast_commit/commands b/tests/j_recover_fast_commit/commands new file mode 100644 index 0000000..74e20e4 --- /dev/null +++ b/tests/j_recover_fast_commit/commands @@ -0,0 +1,4 @@ +ls +ls a/ +ex a/new +ex a/data diff --git a/tests/j_recover_fast_commit/expect b/tests/j_recover_fast_commit/expect new file mode 100644 index 0000000..18e2fe0 --- /dev/null +++ b/tests/j_recover_fast_commit/expect @@ -0,0 +1,22 @@ +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: 14/256 files (14.3% non-contiguous), 1365/2048 blocks +Exit status is 0 +debugfs: ls + 2 (12) . 2 (12) .. 11 (20) lost+found 12 (968) a +debugfs: ls a/ + 12 (12) . 2 (12) .. 13 (12) data 14 (976) new +debugfs: ex a/new +Level Entries Logical Physical Length Flags + 0/ 0 1/ 1 0 - 0 1107 - 1107 1 +debugfs: ex a/data +Level Entries Logical Physical Length Flags + 0/ 1 1/ 1 0 - 255 1618 256 + 1/ 1 1/ 5 0 - 15 1619 - 1634 16 + 1/ 1 2/ 5 16 - 31 1601 - 1616 16 + 1/ 1 3/ 5 32 - 63 1985 - 2016 32 + 1/ 1 4/ 5 64 - 127 1537 - 1600 64 + 1/ 1 5/ 5 128 - 255 1793 - 1920 128 diff --git a/tests/j_recover_fast_commit/image.gz b/tests/j_recover_fast_commit/image.gz Binary files differnew file mode 100644 index 0000000..b7357af --- /dev/null +++ b/tests/j_recover_fast_commit/image.gz diff --git a/tests/j_recover_fast_commit/script b/tests/j_recover_fast_commit/script new file mode 100755 index 0000000..14cbb60 --- /dev/null +++ b/tests/j_recover_fast_commit/script @@ -0,0 +1,26 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.gz +CMDS=$test_dir/commands +test_description="replay fast commit journal" + +gunzip < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP=$test_dir/expect +OUT=$test_name.log + +$FSCK $FSCK_OPT -E journal_only -N test_filesys $TMPFILE 2>/dev/null | head -n 1000 | tail -n +2 > $OUT +echo "Exit status is $?" >> $OUT + +$DEBUGFS -f $CMDS $TMPFILE >> $OUT 2>/dev/null + +# Figure out what happened +if cmp -s $EXP $OUT; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT >> $test_name.failed +fi diff --git a/tests/j_short_revoke_trans/expect b/tests/j_short_revoke_trans/expect new file mode 100644 index 0000000..e83c5ea --- /dev/null +++ b/tests/j_short_revoke_trans/expect @@ -0,0 +1,32 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 6 +Found expected sequence 2, type 5 (revoke table) at block 7 +Found expected sequence 2, type 2 (commit block) at block 8 +No magic number at block 9: end of journal. +test_filesys: recovering journal +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 diff --git a/tests/j_short_revoke_trans/name b/tests/j_short_revoke_trans/name new file mode 100644 index 0000000..5470018 --- /dev/null +++ b/tests/j_short_revoke_trans/name @@ -0,0 +1 @@ +revoke blocks of transaction nuking bitmaps diff --git a/tests/j_short_revoke_trans/script b/tests/j_short_revoke_trans/script new file mode 100644 index 0000000..0e84e46 --- /dev/null +++ b/tests/j_short_revoke_trans/script @@ -0,0 +1,54 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r $bitmaps" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_revoke_trans_mcsum_64bit/expect b/tests/j_short_revoke_trans_mcsum_64bit/expect new file mode 100644 index 0000000..2b0eeb3 --- /dev/null +++ b/tests/j_short_revoke_trans_mcsum_64bit/expect @@ -0,0 +1,34 @@ +Creating filesystem with 131072 4k blocks and 32768 inodes +Superblock backups stored on blocks: + 32768, 98304 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_incompat_revoke journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 10 +Found expected sequence 2, type 5 (revoke table) at block 11 +Found expected sequence 2, type 2 (commit block) at block 12 +No magic number at block 13: end of journal. +test_filesys: recovering journal +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 diff --git a/tests/j_short_revoke_trans_mcsum_64bit/name b/tests/j_short_revoke_trans_mcsum_64bit/name new file mode 100644 index 0000000..de05e51 --- /dev/null +++ b/tests/j_short_revoke_trans_mcsum_64bit/name @@ -0,0 +1 @@ +revoke trans nuking bmap 64bit,meta_csum diff --git a/tests/j_short_revoke_trans_mcsum_64bit/script b/tests/j_short_revoke_trans_mcsum_64bit/script new file mode 100644 index 0000000..9b97b11 --- /dev/null +++ b/tests/j_short_revoke_trans_mcsum_64bit/script @@ -0,0 +1,58 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 131072 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r $bitmaps" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans/expect b/tests/j_short_trans/expect new file mode 100644 index 0000000..2bd0e50 --- /dev/null +++ b/tests/j_short_trans/expect @@ -0,0 +1,40 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 6 +No magic number at block 7: end of journal. +test_filesys: recovering journal +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 +Block bitmap differences: +(0--1050) +(32768--36880) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 1 diff --git a/tests/j_short_trans/name b/tests/j_short_trans/name new file mode 100644 index 0000000..730fbad --- /dev/null +++ b/tests/j_short_trans/name @@ -0,0 +1 @@ +transaction nuking the bitmaps diff --git a/tests/j_short_trans/script b/tests/j_short_trans/script new file mode 100644 index 0000000..ec28a59 --- /dev/null +++ b/tests/j_short_trans/script @@ -0,0 +1,51 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_64bit/expect b/tests/j_short_trans_64bit/expect new file mode 100644 index 0000000..808dc61 --- /dev/null +++ b/tests/j_short_trans_64bit/expect @@ -0,0 +1,42 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5196/65536 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_64bit +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 6 +No magic number at block 7: end of journal. +test_filesys: recovering journal +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 +Block bitmap differences: +(0--1066) +(32768--36896) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5196/65536 blocks +Exit status is 1 diff --git a/tests/j_short_trans_64bit/name b/tests/j_short_trans_64bit/name new file mode 100644 index 0000000..17b70d0 --- /dev/null +++ b/tests/j_short_trans_64bit/name @@ -0,0 +1 @@ +transaction nuking the bitmaps on 64bit diff --git a/tests/j_short_trans_64bit/script b/tests/j_short_trans_64bit/script new file mode 100644 index 0000000..7680473 --- /dev/null +++ b/tests/j_short_trans_64bit/script @@ -0,0 +1,55 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_mcsum_64bit/expect b/tests/j_short_trans_mcsum_64bit/expect new file mode 100644 index 0000000..d73e282 --- /dev/null +++ b/tests/j_short_trans_mcsum_64bit/expect @@ -0,0 +1,42 @@ +Creating filesystem with 131072 4k blocks and 32768 inodes +Superblock backups stored on blocks: + 32768, 98304 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 10 +No magic number at block 11: end of journal. +test_filesys: recovering journal +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 +Block bitmap differences: +(0--65) +(67--69) +(71--584) +(1097--2126) +(65536--69631) +(98304--98368) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 1 diff --git a/tests/j_short_trans_mcsum_64bit/name b/tests/j_short_trans_mcsum_64bit/name new file mode 100644 index 0000000..da839e9 --- /dev/null +++ b/tests/j_short_trans_mcsum_64bit/name @@ -0,0 +1 @@ +trans nuking bitmaps 64bit,meta_csum diff --git a/tests/j_short_trans_mcsum_64bit/script b/tests/j_short_trans_mcsum_64bit/script new file mode 100644 index 0000000..511d4b7 --- /dev/null +++ b/tests/j_short_trans_mcsum_64bit/script @@ -0,0 +1,55 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 131072 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_old_csum/expect b/tests/j_short_trans_old_csum/expect new file mode 100644 index 0000000..6cf06d4 --- /dev/null +++ b/tests/j_short_trans_old_csum/expect @@ -0,0 +1,42 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_checksum +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 6 +No magic number at block 7: end of journal. +test_filesys: recovering journal +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 +Block bitmap differences: +(0--1050) +(32768--36880) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 1 diff --git a/tests/j_short_trans_old_csum/name b/tests/j_short_trans_old_csum/name new file mode 100644 index 0000000..435e9bc --- /dev/null +++ b/tests/j_short_trans_old_csum/name @@ -0,0 +1 @@ +trans nuking bitmaps v1 journal csum diff --git a/tests/j_short_trans_old_csum/script b/tests/j_short_trans_old_csum/script new file mode 100644 index 0000000..f58f213 --- /dev/null +++ b/tests/j_short_trans_old_csum/script @@ -0,0 +1,55 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_open_recover/expect b/tests/j_short_trans_open_recover/expect new file mode 100644 index 0000000..3e86819 --- /dev/null +++ b/tests/j_short_trans_open_recover/expect @@ -0,0 +1,45 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 6 +No magic number at block 7: end of journal. +debugfs can't recover open journal +debugfs: jo +debugfs: jr +Please close the journal before recovering it. +debugfs: jc +test_filesys: recovering journal +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 +Block bitmap differences: +(0--1050) +(32768--36880) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 1 diff --git a/tests/j_short_trans_open_recover/name b/tests/j_short_trans_open_recover/name new file mode 100644 index 0000000..c6bb568 --- /dev/null +++ b/tests/j_short_trans_open_recover/name @@ -0,0 +1 @@ +don't recover open journal diff --git a/tests/j_short_trans_open_recover/script b/tests/j_short_trans_open_recover/script new file mode 100644 index 0000000..d68504b --- /dev/null +++ b/tests/j_short_trans_open_recover/script @@ -0,0 +1,57 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs can't recover open journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jr" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_recover/expect b/tests/j_short_trans_recover/expect new file mode 100644 index 0000000..508858c --- /dev/null +++ b/tests/j_short_trans_recover/expect @@ -0,0 +1,42 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 7 +Found expected sequence 2, type 5 (revoke table) at block 8 +Found expected sequence 2, type 2 (commit block) at block 9 +No magic number at block 10: end of journal. +debugfs recover journal +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 +Block bitmap differences: +(0--1050) +(32768--36880) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 1 diff --git a/tests/j_short_trans_recover/name b/tests/j_short_trans_recover/name new file mode 100644 index 0000000..54e3553 --- /dev/null +++ b/tests/j_short_trans_recover/name @@ -0,0 +1 @@ +transaction nuking the bitmaps (debugfs recovery) diff --git a/tests/j_short_trans_recover/script b/tests/j_short_trans_recover/script new file mode 100644 index 0000000..37e9441 --- /dev/null +++ b/tests/j_short_trans_recover/script @@ -0,0 +1,58 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b 333,$bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r 333" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs recover journal" >> $OUT.new +echo "jr" > $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_trans_recover_mcsum_64bit/expect b/tests/j_short_trans_recover_mcsum_64bit/expect new file mode 100644 index 0000000..8c637f1 --- /dev/null +++ b/tests/j_short_trans_recover_mcsum_64bit/expect @@ -0,0 +1,44 @@ +Creating filesystem with 131072 4k blocks and 32768 inodes +Superblock backups stored on blocks: + 32768, 98304 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_incompat_revoke journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 1, transaction 1 +Found expected sequence 1, type 1 (descriptor block) at block 1 +Found expected sequence 1, type 2 (commit block) at block 11 +Found expected sequence 2, type 5 (revoke table) at block 12 +Found expected sequence 2, type 2 (commit block) at block 13 +No magic number at block 14: end of journal. +debugfs recover journal +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 +Block bitmap differences: +(0--65) +(67--69) +(71--584) +(1097--2126) +(65536--69631) +(98304--98368) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 1 diff --git a/tests/j_short_trans_recover_mcsum_64bit/name b/tests/j_short_trans_recover_mcsum_64bit/name new file mode 100644 index 0000000..01b4acd --- /dev/null +++ b/tests/j_short_trans_recover_mcsum_64bit/name @@ -0,0 +1 @@ +uncommitted trans nuking bmap 64bit,mcsum diff --git a/tests/j_short_trans_recover_mcsum_64bit/script b/tests/j_short_trans_recover_mcsum_64bit/script new file mode 100644 index 0000000..cb2635b --- /dev/null +++ b/tests/j_short_trans_recover_mcsum_64bit/script @@ -0,0 +1,62 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 131072 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b 333,$bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +echo "jo" >> $TMPFILE.cmd +echo "jw -r 333" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +echo "debugfs recover journal" >> $OUT.new +echo "jr" > $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_uncommitted_trans/expect b/tests/j_short_uncommitted_trans/expect new file mode 100644 index 0000000..dedddb5 --- /dev/null +++ b/tests/j_short_uncommitted_trans/expect @@ -0,0 +1,26 @@ +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +debugfs: logdump -c +Journal starts at block 0, transaction 1 +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 diff --git a/tests/j_short_uncommitted_trans/name b/tests/j_short_uncommitted_trans/name new file mode 100644 index 0000000..b617231 --- /dev/null +++ b/tests/j_short_uncommitted_trans/name @@ -0,0 +1 @@ +uncommitted transaction nuking bitmaps diff --git a/tests/j_short_uncommitted_trans/script b/tests/j_short_uncommitted_trans/script new file mode 100644 index 0000000..b7a64b3 --- /dev/null +++ b/tests/j_short_uncommitted_trans/script @@ -0,0 +1,51 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps -c /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/j_short_uncommitted_trans_mcsum_64bit/expect b/tests/j_short_uncommitted_trans_mcsum_64bit/expect new file mode 100644 index 0000000..3effc94 --- /dev/null +++ b/tests/j_short_uncommitted_trans_mcsum_64bit/expect @@ -0,0 +1,28 @@ +Creating filesystem with 131072 4k blocks and 32768 inodes +Superblock backups stored on blocks: + 32768, 98304 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 +Journal features: (none) +debugfs write journal +Journal features: journal_64bit journal_checksum_v3 +debugfs: logdump -c +Journal starts at block 0, transaction 1 +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: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks +Exit status is 0 diff --git a/tests/j_short_uncommitted_trans_mcsum_64bit/name b/tests/j_short_uncommitted_trans_mcsum_64bit/name new file mode 100644 index 0000000..9113950 --- /dev/null +++ b/tests/j_short_uncommitted_trans_mcsum_64bit/name @@ -0,0 +1 @@ +uncommitted trans nuking bmap 64b,mcsum diff --git a/tests/j_short_uncommitted_trans_mcsum_64bit/script b/tests/j_short_uncommitted_trans_mcsum_64bit/script new file mode 100644 index 0000000..fe11af1 --- /dev/null +++ b/tests/j_short_uncommitted_trans_mcsum_64bit/script @@ -0,0 +1,55 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 131072 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +echo "debugfs write journal" >> $OUT.new +echo "jo -c" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero -c" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +$DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT.new + +test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" +echo "logdump -c" > $TMPFILE.cmd +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/m_64bit_flexbg/expect.1 b/tests/m_64bit_flexbg/expect.1 new file mode 100644 index 0000000..0baea1b --- /dev/null +++ b/tests/m_64bit_flexbg/expect.1 @@ -0,0 +1,59 @@ +Creating filesystem with 1024 1k blocks and 128 inodes + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super +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: 11/128 files (0.0% non-contiguous), 58/1024 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 128 +Block count: 1024 +Reserved block count: 51 +Overhead clusters: 44 +Free blocks: 966 +Free inodes: 117 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Reserved GDT blocks: 7 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 128 +Inode blocks per group: 32 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1023) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-9 + Block bitmap at 10 (+9) + Inode bitmap at 26 (+25) + Inode table at 42-73 (+41) + 966 free blocks, 117 free inodes, 2 directories + Free blocks: 24-25, 27-41, 75-1023 + Free inodes: 12-128 diff --git a/tests/m_64bit_flexbg/script b/tests/m_64bit_flexbg/script new file mode 100644 index 0000000..98684e4 --- /dev/null +++ b/tests/m_64bit_flexbg/script @@ -0,0 +1,4 @@ +DESCRIPTION="mkfs with 64bit and flex_bg" +FS_SIZE=1M +MKE2FS_OPTS="-O 64bit,extents,flex_bg" +. $cmd_dir/run_mke2fs diff --git a/tests/m_assume_storage_prezeroed/expect b/tests/m_assume_storage_prezeroed/expect new file mode 100644 index 0000000..b735e24 --- /dev/null +++ b/tests/m_assume_storage_prezeroed/expect @@ -0,0 +1,2 @@ +> 10000 +224 diff --git a/tests/m_assume_storage_prezeroed/script b/tests/m_assume_storage_prezeroed/script new file mode 100644 index 0000000..1a8d846 --- /dev/null +++ b/tests/m_assume_storage_prezeroed/script @@ -0,0 +1,63 @@ +test_description="test prezeroed storage metadata allocation" +FILE_SIZE=16M + +LOG=$test_name.log +OUT=$test_name.out +EXP=$test_dir/expect + +if test "$(id -u)" -ne 0 ; then + echo "$test_name: $test_description: skipped (not root)" +elif ! command -v losetup >/dev/null ; then + echo "$test_name: $test_description: skipped (no losetup)" +else + dd if=/dev/zero of=$TMPFILE.1 bs=1 count=0 seek=$FILE_SIZE >> $LOG 2>&1 + dd if=/dev/zero of=$TMPFILE.2 bs=1 count=0 seek=$FILE_SIZE >> $LOG 2>&1 + + LOOP1=$(losetup --show --sector-size 4096 -f $TMPFILE.1) + if [ ! -b "$LOOP1" ]; then + echo "$test_name: $DESCRIPTION: skipped (no loop devices)" + rm -f $TMPFILE.1 $TMPFILE.2 + exit 0 + fi + LOOP2=$(losetup --show --sector-size 4096 -f $TMPFILE.2) + if [ ! -b "$LOOP2" ]; then + echo "$test_name: $DESCRIPTION: skipped (no loop devices)" + rm -f $TMPFILE.1 $TMPFILE.2 + losetup -d $LOOP1 + exit 0 + fi + + echo $MKE2FS -o Linux -t ext4 $LOOP1 >> $LOG 2>&1 + $MKE2FS -o Linux -t ext4 $LOOP1 >> $LOG 2>&1 + sync + stat $TMPFILE.1 >> $LOG 2>&1 + SZ=$(stat -c "%b" $TMPFILE.1) + if test $SZ -gt 10000 ; then + echo "> 10000" > $OUT + else + echo "$SZ" > $OUT + fi + + echo $MKE2FS -o Linux -t ext4 -E assume_storage_prezeroed=1 $LOOP2 >> $LOG 2>&1 + $MKE2FS -o Linux -t ext4 -E assume_storage_prezeroed=1 $LOOP2 >> $LOG 2>&1 + sync + stat $TMPFILE.2 >> $LOG 2>&1 + stat -c "%b" $TMPFILE.2 >> $OUT + + losetup -d $LOOP1 + losetup -d $LOOP2 + rm -f $TMPFILE.1 $TMPFILE.2 + + cmp -s $OUT $EXP + status=$? + + if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok + else + echo "$test_name: $test_description: failed" + cat $LOG > $test_name.failed + diff $EXP $OUT >> $test_name.failed + fi +fi +unset LOG OUT EXP FILE_SIZE LOOP1 LOOP2 diff --git a/tests/m_bigjournal/expect.1 b/tests/m_bigjournal/expect.1 new file mode 100644 index 0000000..eb0e3bc --- /dev/null +++ b/tests/m_bigjournal/expect.1 @@ -0,0 +1,576 @@ +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize +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: 11/1344 files (0.0% non-contiguous), 1286989/2750000 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 1344 +Block count: 2750000 +Reserved block count: 137500 +Overhead clusters: 1286982 +Free blocks: 1463011 +Free inodes: 1333 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Reserved GDT blocks: 671 +Blocks per group: 32768 +Fragments per group: 32768 +Inodes per group: 16 +Inode blocks per group: 1 +Flex block group size: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 5000M +Total journal blocks: 1280000 +Max transaction length: 1280000 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + + +Group 0: (Blocks 0-32767) + Primary superblock at 0, Group descriptors at 1-1 + Reserved GDT blocks at 2-672 + Block bitmap at 673 (+673), Inode bitmap at 757 (+757) + Inode table at 841-841 (+841) + 31837 free blocks, 5 free inodes, 2 directories, 5 unused inodes + Free blocks: 931-32767 + Free inodes: 12-16 +Group 1: (Blocks 32768-65535) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 32768, Group descriptors at 32769-32769 + Reserved GDT blocks at 32770-33440 + Block bitmap at 674 (bg #0 + 674), Inode bitmap at 758 (bg #0 + 758) + Inode table at 842-842 (bg #0 + 842) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 33441-65535 + Free inodes: 17-32 +Group 2: (Blocks 65536-98303) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 675 (bg #0 + 675), Inode bitmap at 759 (bg #0 + 759) + Inode table at 843-843 (bg #0 + 843) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 65536-98303 + Free inodes: 33-48 +Group 3: (Blocks 98304-131071) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 98304, Group descriptors at 98305-98305 + Reserved GDT blocks at 98306-98976 + Block bitmap at 676 (bg #0 + 676), Inode bitmap at 760 (bg #0 + 760) + Inode table at 844-844 (bg #0 + 844) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 98977-131071 + Free inodes: 49-64 +Group 4: (Blocks 131072-163839) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 677 (bg #0 + 677), Inode bitmap at 761 (bg #0 + 761) + Inode table at 845-845 (bg #0 + 845) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 131072-163839 + Free inodes: 65-80 +Group 5: (Blocks 163840-196607) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 163840, Group descriptors at 163841-163841 + Reserved GDT blocks at 163842-164512 + Block bitmap at 678 (bg #0 + 678), Inode bitmap at 762 (bg #0 + 762) + Inode table at 846-846 (bg #0 + 846) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 164513-196607 + Free inodes: 81-96 +Group 6: (Blocks 196608-229375) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 679 (bg #0 + 679), Inode bitmap at 763 (bg #0 + 763) + Inode table at 847-847 (bg #0 + 847) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 196608-229375 + Free inodes: 97-112 +Group 7: (Blocks 229376-262143) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 229376, Group descriptors at 229377-229377 + Reserved GDT blocks at 229378-230048 + Block bitmap at 680 (bg #0 + 680), Inode bitmap at 764 (bg #0 + 764) + Inode table at 848-848 (bg #0 + 848) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 230049-262143 + Free inodes: 113-128 +Group 8: (Blocks 262144-294911) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 681 (bg #0 + 681), Inode bitmap at 765 (bg #0 + 765) + Inode table at 849-849 (bg #0 + 849) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 262144-294911 + Free inodes: 129-144 +Group 9: (Blocks 294912-327679) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 294912, Group descriptors at 294913-294913 + Reserved GDT blocks at 294914-295584 + Block bitmap at 682 (bg #0 + 682), Inode bitmap at 766 (bg #0 + 766) + Inode table at 850-850 (bg #0 + 850) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 295585-327679 + Free inodes: 145-160 +Group 10: (Blocks 327680-360447) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 683 (bg #0 + 683), Inode bitmap at 767 (bg #0 + 767) + Inode table at 851-851 (bg #0 + 851) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 327680-360447 + Free inodes: 161-176 +Group 11: (Blocks 360448-393215) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 684 (bg #0 + 684), Inode bitmap at 768 (bg #0 + 768) + Inode table at 852-852 (bg #0 + 852) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 360448-393215 + Free inodes: 177-192 +Group 12: (Blocks 393216-425983) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 685 (bg #0 + 685), Inode bitmap at 769 (bg #0 + 769) + Inode table at 853-853 (bg #0 + 853) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 393216-425983 + Free inodes: 193-208 +Group 13: (Blocks 425984-458751) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 686 (bg #0 + 686), Inode bitmap at 770 (bg #0 + 770) + Inode table at 854-854 (bg #0 + 854) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 425984-458751 + Free inodes: 209-224 +Group 14: (Blocks 458752-491519) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 687 (bg #0 + 687), Inode bitmap at 771 (bg #0 + 771) + Inode table at 855-855 (bg #0 + 855) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 458752-491519 + Free inodes: 225-240 +Group 15: (Blocks 491520-524287) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 688 (bg #0 + 688), Inode bitmap at 772 (bg #0 + 772) + Inode table at 856-856 (bg #0 + 856) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 491520-524287 + Free inodes: 241-256 +Group 16: (Blocks 524288-557055) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 689 (bg #0 + 689), Inode bitmap at 773 (bg #0 + 773) + Inode table at 857-857 (bg #0 + 857) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 524288-557055 + Free inodes: 257-272 +Group 17: (Blocks 557056-589823) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 690 (bg #0 + 690), Inode bitmap at 774 (bg #0 + 774) + Inode table at 858-858 (bg #0 + 858) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 557056-589823 + Free inodes: 273-288 +Group 18: (Blocks 589824-622591) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 691 (bg #0 + 691), Inode bitmap at 775 (bg #0 + 775) + Inode table at 859-859 (bg #0 + 859) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 589824-622591 + Free inodes: 289-304 +Group 19: (Blocks 622592-655359) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 692 (bg #0 + 692), Inode bitmap at 776 (bg #0 + 776) + Inode table at 860-860 (bg #0 + 860) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 622592-655359 + Free inodes: 305-320 +Group 20: (Blocks 655360-688127) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 693 (bg #0 + 693), Inode bitmap at 777 (bg #0 + 777) + Inode table at 861-861 (bg #0 + 861) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 655360-688127 + Free inodes: 321-336 +Group 21: (Blocks 688128-720895) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 694 (bg #0 + 694), Inode bitmap at 778 (bg #0 + 778) + Inode table at 862-862 (bg #0 + 862) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 688128-720895 + Free inodes: 337-352 +Group 22: (Blocks 720896-753663) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 695 (bg #0 + 695), Inode bitmap at 779 (bg #0 + 779) + Inode table at 863-863 (bg #0 + 863) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 720896-753663 + Free inodes: 353-368 +Group 23: (Blocks 753664-786431) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 696 (bg #0 + 696), Inode bitmap at 780 (bg #0 + 780) + Inode table at 864-864 (bg #0 + 864) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 753664-786431 + Free inodes: 369-384 +Group 24: (Blocks 786432-819199) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 697 (bg #0 + 697), Inode bitmap at 781 (bg #0 + 781) + Inode table at 865-865 (bg #0 + 865) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 786432-819199 + Free inodes: 385-400 +Group 25: (Blocks 819200-851967) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 819200, Group descriptors at 819201-819201 + Reserved GDT blocks at 819202-819872 + Block bitmap at 698 (bg #0 + 698), Inode bitmap at 782 (bg #0 + 782) + Inode table at 866-866 (bg #0 + 866) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 819873-851967 + Free inodes: 401-416 +Group 26: (Blocks 851968-884735) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 699 (bg #0 + 699), Inode bitmap at 783 (bg #0 + 783) + Inode table at 867-867 (bg #0 + 867) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 851968-884735 + Free inodes: 417-432 +Group 27: (Blocks 884736-917503) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 884736, Group descriptors at 884737-884737 + Reserved GDT blocks at 884738-885408 + Block bitmap at 700 (bg #0 + 700), Inode bitmap at 784 (bg #0 + 784) + Inode table at 868-868 (bg #0 + 868) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 885409-917503 + Free inodes: 433-448 +Group 28: (Blocks 917504-950271) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 701 (bg #0 + 701), Inode bitmap at 785 (bg #0 + 785) + Inode table at 869-869 (bg #0 + 869) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 917504-950271 + Free inodes: 449-464 +Group 29: (Blocks 950272-983039) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 702 (bg #0 + 702), Inode bitmap at 786 (bg #0 + 786) + Inode table at 870-870 (bg #0 + 870) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 950272-983039 + Free inodes: 465-480 +Group 30: (Blocks 983040-1015807) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 703 (bg #0 + 703), Inode bitmap at 787 (bg #0 + 787) + Inode table at 871-871 (bg #0 + 871) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 983040-1015807 + Free inodes: 481-496 +Group 31: (Blocks 1015808-1048575) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 704 (bg #0 + 704), Inode bitmap at 788 (bg #0 + 788) + Inode table at 872-872 (bg #0 + 872) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1015808-1048575 + Free inodes: 497-512 +Group 32: (Blocks 1048576-1081343) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 705 (bg #0 + 705), Inode bitmap at 789 (bg #0 + 789) + Inode table at 873-873 (bg #0 + 873) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1048576-1081343 + Free inodes: 513-528 +Group 33: (Blocks 1081344-1114111) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 706 (bg #0 + 706), Inode bitmap at 790 (bg #0 + 790) + Inode table at 874-874 (bg #0 + 874) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1081344-1114111 + Free inodes: 529-544 +Group 34: (Blocks 1114112-1146879) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 707 (bg #0 + 707), Inode bitmap at 791 (bg #0 + 791) + Inode table at 875-875 (bg #0 + 875) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1114112-1146879 + Free inodes: 545-560 +Group 35: (Blocks 1146880-1179647) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 708 (bg #0 + 708), Inode bitmap at 792 (bg #0 + 792) + Inode table at 876-876 (bg #0 + 876) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1146880-1179647 + Free inodes: 561-576 +Group 36: (Blocks 1179648-1212415) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 709 (bg #0 + 709), Inode bitmap at 793 (bg #0 + 793) + Inode table at 877-877 (bg #0 + 877) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1179648-1212415 + Free inodes: 577-592 +Group 37: (Blocks 1212416-1245183) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 710 (bg #0 + 710), Inode bitmap at 794 (bg #0 + 794) + Inode table at 878-878 (bg #0 + 878) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1212416-1245183 + Free inodes: 593-608 +Group 38: (Blocks 1245184-1277951) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 711 (bg #0 + 711), Inode bitmap at 795 (bg #0 + 795) + Inode table at 879-879 (bg #0 + 879) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1245184-1277951 + Free inodes: 609-624 +Group 39: (Blocks 1277952-1310719) [INODE_UNINIT] + Block bitmap at 712 (bg #0 + 712), Inode bitmap at 796 (bg #0 + 796) + Inode table at 880-880 (bg #0 + 880) + 32767 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 1277952-1310718 + Free inodes: 625-640 +Group 40: (Blocks 1310720-1343487) [INODE_UNINIT] + Block bitmap at 713 (bg #0 + 713), Inode bitmap at 797 (bg #0 + 797) + Inode table at 881-881 (bg #0 + 881) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 641-656 +Group 41: (Blocks 1343488-1376255) [INODE_UNINIT] + Block bitmap at 714 (bg #0 + 714), Inode bitmap at 798 (bg #0 + 798) + Inode table at 882-882 (bg #0 + 882) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 657-672 +Group 42: (Blocks 1376256-1409023) [INODE_UNINIT] + Block bitmap at 715 (bg #0 + 715), Inode bitmap at 799 (bg #0 + 799) + Inode table at 883-883 (bg #0 + 883) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 673-688 +Group 43: (Blocks 1409024-1441791) [INODE_UNINIT] + Block bitmap at 716 (bg #0 + 716), Inode bitmap at 800 (bg #0 + 800) + Inode table at 884-884 (bg #0 + 884) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 689-704 +Group 44: (Blocks 1441792-1474559) [INODE_UNINIT] + Block bitmap at 717 (bg #0 + 717), Inode bitmap at 801 (bg #0 + 801) + Inode table at 885-885 (bg #0 + 885) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 705-720 +Group 45: (Blocks 1474560-1507327) [INODE_UNINIT] + Block bitmap at 718 (bg #0 + 718), Inode bitmap at 802 (bg #0 + 802) + Inode table at 886-886 (bg #0 + 886) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 721-736 +Group 46: (Blocks 1507328-1540095) [INODE_UNINIT] + Block bitmap at 719 (bg #0 + 719), Inode bitmap at 803 (bg #0 + 803) + Inode table at 887-887 (bg #0 + 887) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 737-752 +Group 47: (Blocks 1540096-1572863) [INODE_UNINIT] + Block bitmap at 720 (bg #0 + 720), Inode bitmap at 804 (bg #0 + 804) + Inode table at 888-888 (bg #0 + 888) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 753-768 +Group 48: (Blocks 1572864-1605631) [INODE_UNINIT] + Block bitmap at 721 (bg #0 + 721), Inode bitmap at 805 (bg #0 + 805) + Inode table at 889-889 (bg #0 + 889) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 769-784 +Group 49: (Blocks 1605632-1638399) [INODE_UNINIT] + Backup superblock at 1605632, Group descriptors at 1605633-1605633 + Reserved GDT blocks at 1605634-1606304 + Block bitmap at 722 (bg #0 + 722), Inode bitmap at 806 (bg #0 + 806) + Inode table at 890-890 (bg #0 + 890) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 785-800 +Group 50: (Blocks 1638400-1671167) [INODE_UNINIT] + Block bitmap at 723 (bg #0 + 723), Inode bitmap at 807 (bg #0 + 807) + Inode table at 891-891 (bg #0 + 891) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 801-816 +Group 51: (Blocks 1671168-1703935) [INODE_UNINIT] + Block bitmap at 724 (bg #0 + 724), Inode bitmap at 808 (bg #0 + 808) + Inode table at 892-892 (bg #0 + 892) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 817-832 +Group 52: (Blocks 1703936-1736703) [INODE_UNINIT] + Block bitmap at 725 (bg #0 + 725), Inode bitmap at 809 (bg #0 + 809) + Inode table at 893-893 (bg #0 + 893) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 833-848 +Group 53: (Blocks 1736704-1769471) [INODE_UNINIT] + Block bitmap at 726 (bg #0 + 726), Inode bitmap at 810 (bg #0 + 810) + Inode table at 894-894 (bg #0 + 894) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 849-864 +Group 54: (Blocks 1769472-1802239) [INODE_UNINIT] + Block bitmap at 727 (bg #0 + 727), Inode bitmap at 811 (bg #0 + 811) + Inode table at 895-895 (bg #0 + 895) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 865-880 +Group 55: (Blocks 1802240-1835007) [INODE_UNINIT] + Block bitmap at 728 (bg #0 + 728), Inode bitmap at 812 (bg #0 + 812) + Inode table at 896-896 (bg #0 + 896) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 881-896 +Group 56: (Blocks 1835008-1867775) [INODE_UNINIT] + Block bitmap at 729 (bg #0 + 729), Inode bitmap at 813 (bg #0 + 813) + Inode table at 897-897 (bg #0 + 897) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 897-912 +Group 57: (Blocks 1867776-1900543) [INODE_UNINIT] + Block bitmap at 730 (bg #0 + 730), Inode bitmap at 814 (bg #0 + 814) + Inode table at 898-898 (bg #0 + 898) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 913-928 +Group 58: (Blocks 1900544-1933311) [INODE_UNINIT] + Block bitmap at 731 (bg #0 + 731), Inode bitmap at 815 (bg #0 + 815) + Inode table at 899-899 (bg #0 + 899) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 929-944 +Group 59: (Blocks 1933312-1966079) [INODE_UNINIT] + Block bitmap at 732 (bg #0 + 732), Inode bitmap at 816 (bg #0 + 816) + Inode table at 900-900 (bg #0 + 900) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 945-960 +Group 60: (Blocks 1966080-1998847) [INODE_UNINIT] + Block bitmap at 733 (bg #0 + 733), Inode bitmap at 817 (bg #0 + 817) + Inode table at 901-901 (bg #0 + 901) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 961-976 +Group 61: (Blocks 1998848-2031615) [INODE_UNINIT] + Block bitmap at 734 (bg #0 + 734), Inode bitmap at 818 (bg #0 + 818) + Inode table at 902-902 (bg #0 + 902) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 977-992 +Group 62: (Blocks 2031616-2064383) [INODE_UNINIT] + Block bitmap at 735 (bg #0 + 735), Inode bitmap at 819 (bg #0 + 819) + Inode table at 903-903 (bg #0 + 903) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 993-1008 +Group 63: (Blocks 2064384-2097151) [INODE_UNINIT] + Block bitmap at 736 (bg #0 + 736), Inode bitmap at 820 (bg #0 + 820) + Inode table at 904-904 (bg #0 + 904) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1009-1024 +Group 64: (Blocks 2097152-2129919) [INODE_UNINIT] + Block bitmap at 737 (bg #0 + 737), Inode bitmap at 821 (bg #0 + 821) + Inode table at 905-905 (bg #0 + 905) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1025-1040 +Group 65: (Blocks 2129920-2162687) [INODE_UNINIT] + Block bitmap at 738 (bg #0 + 738), Inode bitmap at 822 (bg #0 + 822) + Inode table at 906-906 (bg #0 + 906) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1041-1056 +Group 66: (Blocks 2162688-2195455) [INODE_UNINIT] + Block bitmap at 739 (bg #0 + 739), Inode bitmap at 823 (bg #0 + 823) + Inode table at 907-907 (bg #0 + 907) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1057-1072 +Group 67: (Blocks 2195456-2228223) [INODE_UNINIT] + Block bitmap at 740 (bg #0 + 740), Inode bitmap at 824 (bg #0 + 824) + Inode table at 908-908 (bg #0 + 908) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1073-1088 +Group 68: (Blocks 2228224-2260991) [INODE_UNINIT] + Block bitmap at 741 (bg #0 + 741), Inode bitmap at 825 (bg #0 + 825) + Inode table at 909-909 (bg #0 + 909) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1089-1104 +Group 69: (Blocks 2260992-2293759) [INODE_UNINIT] + Block bitmap at 742 (bg #0 + 742), Inode bitmap at 826 (bg #0 + 826) + Inode table at 910-910 (bg #0 + 910) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1105-1120 +Group 70: (Blocks 2293760-2326527) [INODE_UNINIT] + Block bitmap at 743 (bg #0 + 743), Inode bitmap at 827 (bg #0 + 827) + Inode table at 911-911 (bg #0 + 911) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1121-1136 +Group 71: (Blocks 2326528-2359295) [INODE_UNINIT] + Block bitmap at 744 (bg #0 + 744), Inode bitmap at 828 (bg #0 + 828) + Inode table at 912-912 (bg #0 + 912) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1137-1152 +Group 72: (Blocks 2359296-2392063) [INODE_UNINIT] + Block bitmap at 745 (bg #0 + 745), Inode bitmap at 829 (bg #0 + 829) + Inode table at 913-913 (bg #0 + 913) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1153-1168 +Group 73: (Blocks 2392064-2424831) [INODE_UNINIT] + Block bitmap at 746 (bg #0 + 746), Inode bitmap at 830 (bg #0 + 830) + Inode table at 914-914 (bg #0 + 914) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1169-1184 +Group 74: (Blocks 2424832-2457599) [INODE_UNINIT] + Block bitmap at 747 (bg #0 + 747), Inode bitmap at 831 (bg #0 + 831) + Inode table at 915-915 (bg #0 + 915) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1185-1200 +Group 75: (Blocks 2457600-2490367) [INODE_UNINIT] + Block bitmap at 748 (bg #0 + 748), Inode bitmap at 832 (bg #0 + 832) + Inode table at 916-916 (bg #0 + 916) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1201-1216 +Group 76: (Blocks 2490368-2523135) [INODE_UNINIT] + Block bitmap at 749 (bg #0 + 749), Inode bitmap at 833 (bg #0 + 833) + Inode table at 917-917 (bg #0 + 917) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1217-1232 +Group 77: (Blocks 2523136-2555903) [INODE_UNINIT] + Block bitmap at 750 (bg #0 + 750), Inode bitmap at 834 (bg #0 + 834) + Inode table at 918-918 (bg #0 + 918) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1233-1248 +Group 78: (Blocks 2555904-2588671) [INODE_UNINIT] + Block bitmap at 751 (bg #0 + 751), Inode bitmap at 835 (bg #0 + 835) + Inode table at 919-919 (bg #0 + 919) + 0 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: + Free inodes: 1249-1264 +Group 79: (Blocks 2588672-2621439) [INODE_UNINIT] + Block bitmap at 752 (bg #0 + 752), Inode bitmap at 836 (bg #0 + 836) + Inode table at 920-920 (bg #0 + 920) + 30047 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 2591393-2621439 + Free inodes: 1265-1280 +Group 80: (Blocks 2621440-2654207) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 753 (bg #0 + 753), Inode bitmap at 837 (bg #0 + 837) + Inode table at 921-921 (bg #0 + 921) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 2621440-2654207 + Free inodes: 1281-1296 +Group 81: (Blocks 2654208-2686975) [INODE_UNINIT, BLOCK_UNINIT] + Backup superblock at 2654208, Group descriptors at 2654209-2654209 + Reserved GDT blocks at 2654210-2654880 + Block bitmap at 754 (bg #0 + 754), Inode bitmap at 838 (bg #0 + 838) + Inode table at 922-922 (bg #0 + 922) + 32095 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 2654881-2686975 + Free inodes: 1297-1312 +Group 82: (Blocks 2686976-2719743) [INODE_UNINIT, BLOCK_UNINIT] + Block bitmap at 755 (bg #0 + 755), Inode bitmap at 839 (bg #0 + 839) + Inode table at 923-923 (bg #0 + 923) + 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 2686976-2719743 + Free inodes: 1313-1328 +Group 83: (Blocks 2719744-2749999) [INODE_UNINIT] + Block bitmap at 756 (bg #0 + 756), Inode bitmap at 840 (bg #0 + 840) + Inode table at 924-924 (bg #0 + 924) + 30256 free blocks, 16 free inodes, 0 directories, 16 unused inodes + Free blocks: 2719744-2749999 + Free inodes: 1329-1344 diff --git a/tests/m_bigjournal/script b/tests/m_bigjournal/script new file mode 100644 index 0000000..8c09bc0 --- /dev/null +++ b/tests/m_bigjournal/script @@ -0,0 +1,13 @@ +DESCRIPTION="journal over 4GB in size" +FS_SIZE=11000000 +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +MKE2FS_OPTS="-t ext4 -G 512 -N 1280 -J size=5000 -q -E lazy_journal_init,lazy_itable_init,nodiscard" +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" ]; then + # creates a 44GB filesystem + echo "$test_name: $DESCRIPTION: skipped for $os" + return 0 +fi +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_dasd_bs/expect.1 b/tests/m_dasd_bs/expect.1 new file mode 100644 index 0000000..32883c4 --- /dev/null +++ b/tests/m_dasd_bs/expect.1 @@ -0,0 +1,68 @@ +Creating filesystem with 32768 2k blocks and 16384 inodes +Superblock backups stored on blocks: + 16384 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +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: 11/16384 files (0.0% non-contiguous), 2128/32768 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 32768 +Reserved block count: 1638 +Overhead clusters: 2118 +Free blocks: 30640 +Free inodes: 16373 +First block: 0 +Block size: 2048 +Fragment size: 2048 +Reserved GDT blocks: 31 +Blocks per group: 16384 +Fragments per group: 16384 +Inodes per group: 8192 +Inode blocks per group: 1024 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 0-16383) + Primary superblock at 0, Group descriptors at 1-1 + Reserved GDT blocks at 2-32 + Block bitmap at 33 (+33) + Inode bitmap at 34 (+34) + Inode table at 35-1058 (+35) + 15315 free blocks, 8181 free inodes, 2 directories + Free blocks: 1069-16383 + Free inodes: 12-8192 +Group 1: (Blocks 16384-32767) + Backup superblock at 16384, Group descriptors at 16385-16385 + Reserved GDT blocks at 16386-16416 + Block bitmap at 16417 (+33) + Inode bitmap at 16418 (+34) + Inode table at 16419-17442 (+35) + 15325 free blocks, 8192 free inodes, 0 directories + Free blocks: 17443-32767 + Free inodes: 8193-16384 diff --git a/tests/m_dasd_bs/script b/tests/m_dasd_bs/script new file mode 100644 index 0000000..e7b9085 --- /dev/null +++ b/tests/m_dasd_bs/script @@ -0,0 +1,6 @@ +DESCRIPTION="2048 byte sector devices" +FS_SIZE=65536 +MKE2FS_DEVICE_SECTSIZE=2048 +export MKE2FS_DEVICE_SECTSIZE +. $cmd_dir/run_mke2fs +unset MKE2FS_DEVICE_SECTSIZE diff --git a/tests/m_desc_size_128/expect.1 b/tests/m_desc_size_128/expect.1 new file mode 100644 index 0000000..54b24e0 --- /dev/null +++ b/tests/m_desc_size_128/expect.1 @@ -0,0 +1,841 @@ +Creating filesystem with 131072 1k blocks and 8192 inodes +Superblock backups stored on blocks: + 1025, 3073, 5121, 7169, 9217, 25601, 27649, 50177, 82945, 128001 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype extent 64bit sparse_super +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: 11/8192 files (0.0% non-contiguous), 5322/131072 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype extent 64bit sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 8192 +Block count: 131072 +Reserved block count: 6553 +Overhead clusters: 5308 +Free blocks: 125750 +Free inodes: 8181 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 128 +Reserved GDT blocks: 256 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 64 +Inode blocks per group: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-17 + Reserved GDT blocks at 18-273 + Block bitmap at 274 (+273), Inode bitmap at 275 (+274) + Inode table at 276-291 (+275) + 719 free blocks, 53 free inodes, 2 directories + Free blocks: 306-1024 + Free inodes: 12-64 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1041 + Reserved GDT blocks at 1042-1297 + Block bitmap at 1298 (+273), Inode bitmap at 1299 (+274) + Inode table at 1300-1315 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 1316-2048 + Free inodes: 65-128 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2066 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 2067-3072 + Free inodes: 129-192 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3089 + Reserved GDT blocks at 3090-3345 + Block bitmap at 3346 (+273), Inode bitmap at 3347 (+274) + Inode table at 3348-3363 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 3364-4096 + Free inodes: 193-256 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4114 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 4115-5120 + Free inodes: 257-320 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5137 + Reserved GDT blocks at 5138-5393 + Block bitmap at 5394 (+273), Inode bitmap at 5395 (+274) + Inode table at 5396-5411 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 5412-6144 + Free inodes: 321-384 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6162 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 6163-7168 + Free inodes: 385-448 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7185 + Reserved GDT blocks at 7186-7441 + Block bitmap at 7442 (+273), Inode bitmap at 7443 (+274) + Inode table at 7444-7459 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 7460-8192 + Free inodes: 449-512 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8210 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 8211-9216 + Free inodes: 513-576 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9233 + Reserved GDT blocks at 9234-9489 + Block bitmap at 9490 (+273), Inode bitmap at 9491 (+274) + Inode table at 9492-9507 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 9508-10240 + Free inodes: 577-640 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10258 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 10259-11264 + Free inodes: 641-704 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11282 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 11283-12288 + Free inodes: 705-768 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12306 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 12307-13312 + Free inodes: 769-832 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13330 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 13331-14336 + Free inodes: 833-896 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14354 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 14355-15360 + Free inodes: 897-960 +Group 15: (Blocks 15361-16384) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15378 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 15379-16384 + Free inodes: 961-1024 +Group 16: (Blocks 16385-17408) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16402 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 16403-17408 + Free inodes: 1025-1088 +Group 17: (Blocks 17409-18432) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17426 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 17427-18432 + Free inodes: 1089-1152 +Group 18: (Blocks 18433-19456) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18450 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 18451-19456 + Free inodes: 1153-1216 +Group 19: (Blocks 19457-20480) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19474 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 19475-20480 + Free inodes: 1217-1280 +Group 20: (Blocks 20481-21504) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20498 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 20499-21504 + Free inodes: 1281-1344 +Group 21: (Blocks 21505-22528) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21522 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 21523-22528 + Free inodes: 1345-1408 +Group 22: (Blocks 22529-23552) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22546 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 22547-23552 + Free inodes: 1409-1472 +Group 23: (Blocks 23553-24576) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23570 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 23571-24576 + Free inodes: 1473-1536 +Group 24: (Blocks 24577-25600) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24594 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 24595-25600 + Free inodes: 1537-1600 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601, Group descriptors at 25602-25617 + Reserved GDT blocks at 25618-25873 + Block bitmap at 25874 (+273), Inode bitmap at 25875 (+274) + Inode table at 25876-25891 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 25892-26624 + Free inodes: 1601-1664 +Group 26: (Blocks 26625-27648) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26642 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 26643-27648 + Free inodes: 1665-1728 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649, Group descriptors at 27650-27665 + Reserved GDT blocks at 27666-27921 + Block bitmap at 27922 (+273), Inode bitmap at 27923 (+274) + Inode table at 27924-27939 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 27940-28672 + Free inodes: 1729-1792 +Group 28: (Blocks 28673-29696) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28690 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 28691-29696 + Free inodes: 1793-1856 +Group 29: (Blocks 29697-30720) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29714 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 29715-30720 + Free inodes: 1857-1920 +Group 30: (Blocks 30721-31744) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30738 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 30739-31744 + Free inodes: 1921-1984 +Group 31: (Blocks 31745-32768) + Block bitmap at 31745 (+0), Inode bitmap at 31746 (+1) + Inode table at 31747-31762 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 31763-32768 + Free inodes: 1985-2048 +Group 32: (Blocks 32769-33792) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-32786 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 32787-33792 + Free inodes: 2049-2112 +Group 33: (Blocks 33793-34816) + Block bitmap at 33793 (+0), Inode bitmap at 33794 (+1) + Inode table at 33795-33810 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 33811-34816 + Free inodes: 2113-2176 +Group 34: (Blocks 34817-35840) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34834 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 34835-35840 + Free inodes: 2177-2240 +Group 35: (Blocks 35841-36864) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35858 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 35859-36864 + Free inodes: 2241-2304 +Group 36: (Blocks 36865-37888) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36882 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 36883-37888 + Free inodes: 2305-2368 +Group 37: (Blocks 37889-38912) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37906 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 37907-38912 + Free inodes: 2369-2432 +Group 38: (Blocks 38913-39936) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38930 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 38931-39936 + Free inodes: 2433-2496 +Group 39: (Blocks 39937-40960) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-39954 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 39955-40960 + Free inodes: 2497-2560 +Group 40: (Blocks 40961-41984) + Block bitmap at 40961 (+0), Inode bitmap at 40962 (+1) + Inode table at 40963-40978 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 40979-41984 + Free inodes: 2561-2624 +Group 41: (Blocks 41985-43008) + Block bitmap at 41985 (+0), Inode bitmap at 41986 (+1) + Inode table at 41987-42002 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 42003-43008 + Free inodes: 2625-2688 +Group 42: (Blocks 43009-44032) + Block bitmap at 43009 (+0), Inode bitmap at 43010 (+1) + Inode table at 43011-43026 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 43027-44032 + Free inodes: 2689-2752 +Group 43: (Blocks 44033-45056) + Block bitmap at 44033 (+0), Inode bitmap at 44034 (+1) + Inode table at 44035-44050 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 44051-45056 + Free inodes: 2753-2816 +Group 44: (Blocks 45057-46080) + Block bitmap at 45057 (+0), Inode bitmap at 45058 (+1) + Inode table at 45059-45074 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 45075-46080 + Free inodes: 2817-2880 +Group 45: (Blocks 46081-47104) + Block bitmap at 46081 (+0), Inode bitmap at 46082 (+1) + Inode table at 46083-46098 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 46099-47104 + Free inodes: 2881-2944 +Group 46: (Blocks 47105-48128) + Block bitmap at 47105 (+0), Inode bitmap at 47106 (+1) + Inode table at 47107-47122 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 47123-48128 + Free inodes: 2945-3008 +Group 47: (Blocks 48129-49152) + Block bitmap at 48129 (+0), Inode bitmap at 48130 (+1) + Inode table at 48131-48146 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 48147-49152 + Free inodes: 3009-3072 +Group 48: (Blocks 49153-50176) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49170 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 49171-50176 + Free inodes: 3073-3136 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177, Group descriptors at 50178-50193 + Reserved GDT blocks at 50194-50449 + Block bitmap at 50450 (+273), Inode bitmap at 50451 (+274) + Inode table at 50452-50467 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 50468-51200 + Free inodes: 3137-3200 +Group 50: (Blocks 51201-52224) + Block bitmap at 51201 (+0), Inode bitmap at 51202 (+1) + Inode table at 51203-51218 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 51219-52224 + Free inodes: 3201-3264 +Group 51: (Blocks 52225-53248) + Block bitmap at 52225 (+0), Inode bitmap at 52226 (+1) + Inode table at 52227-52242 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 52243-53248 + Free inodes: 3265-3328 +Group 52: (Blocks 53249-54272) + Block bitmap at 53249 (+0), Inode bitmap at 53250 (+1) + Inode table at 53251-53266 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 53267-54272 + Free inodes: 3329-3392 +Group 53: (Blocks 54273-55296) + Block bitmap at 54273 (+0), Inode bitmap at 54274 (+1) + Inode table at 54275-54290 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 54291-55296 + Free inodes: 3393-3456 +Group 54: (Blocks 55297-56320) + Block bitmap at 55297 (+0), Inode bitmap at 55298 (+1) + Inode table at 55299-55314 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 55315-56320 + Free inodes: 3457-3520 +Group 55: (Blocks 56321-57344) + Block bitmap at 56321 (+0), Inode bitmap at 56322 (+1) + Inode table at 56323-56338 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 56339-57344 + Free inodes: 3521-3584 +Group 56: (Blocks 57345-58368) + Block bitmap at 57345 (+0), Inode bitmap at 57346 (+1) + Inode table at 57347-57362 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 57363-58368 + Free inodes: 3585-3648 +Group 57: (Blocks 58369-59392) + Block bitmap at 58369 (+0), Inode bitmap at 58370 (+1) + Inode table at 58371-58386 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 58387-59392 + Free inodes: 3649-3712 +Group 58: (Blocks 59393-60416) + Block bitmap at 59393 (+0), Inode bitmap at 59394 (+1) + Inode table at 59395-59410 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 59411-60416 + Free inodes: 3713-3776 +Group 59: (Blocks 60417-61440) + Block bitmap at 60417 (+0), Inode bitmap at 60418 (+1) + Inode table at 60419-60434 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 60435-61440 + Free inodes: 3777-3840 +Group 60: (Blocks 61441-62464) + Block bitmap at 61441 (+0), Inode bitmap at 61442 (+1) + Inode table at 61443-61458 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 61459-62464 + Free inodes: 3841-3904 +Group 61: (Blocks 62465-63488) + Block bitmap at 62465 (+0), Inode bitmap at 62466 (+1) + Inode table at 62467-62482 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 62483-63488 + Free inodes: 3905-3968 +Group 62: (Blocks 63489-64512) + Block bitmap at 63489 (+0), Inode bitmap at 63490 (+1) + Inode table at 63491-63506 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 63507-64512 + Free inodes: 3969-4032 +Group 63: (Blocks 64513-65536) + Block bitmap at 64513 (+0), Inode bitmap at 64514 (+1) + Inode table at 64515-64530 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 64531-65536 + Free inodes: 4033-4096 +Group 64: (Blocks 65537-66560) + Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1) + Inode table at 65539-65554 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 65555-66560 + Free inodes: 4097-4160 +Group 65: (Blocks 66561-67584) + Block bitmap at 66561 (+0), Inode bitmap at 66562 (+1) + Inode table at 66563-66578 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 66579-67584 + Free inodes: 4161-4224 +Group 66: (Blocks 67585-68608) + Block bitmap at 67585 (+0), Inode bitmap at 67586 (+1) + Inode table at 67587-67602 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 67603-68608 + Free inodes: 4225-4288 +Group 67: (Blocks 68609-69632) + Block bitmap at 68609 (+0), Inode bitmap at 68610 (+1) + Inode table at 68611-68626 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 68627-69632 + Free inodes: 4289-4352 +Group 68: (Blocks 69633-70656) + Block bitmap at 69633 (+0), Inode bitmap at 69634 (+1) + Inode table at 69635-69650 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 69651-70656 + Free inodes: 4353-4416 +Group 69: (Blocks 70657-71680) + Block bitmap at 70657 (+0), Inode bitmap at 70658 (+1) + Inode table at 70659-70674 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 70675-71680 + Free inodes: 4417-4480 +Group 70: (Blocks 71681-72704) + Block bitmap at 71681 (+0), Inode bitmap at 71682 (+1) + Inode table at 71683-71698 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 71699-72704 + Free inodes: 4481-4544 +Group 71: (Blocks 72705-73728) + Block bitmap at 72705 (+0), Inode bitmap at 72706 (+1) + Inode table at 72707-72722 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 72723-73728 + Free inodes: 4545-4608 +Group 72: (Blocks 73729-74752) + Block bitmap at 73729 (+0), Inode bitmap at 73730 (+1) + Inode table at 73731-73746 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 73747-74752 + Free inodes: 4609-4672 +Group 73: (Blocks 74753-75776) + Block bitmap at 74753 (+0), Inode bitmap at 74754 (+1) + Inode table at 74755-74770 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 74771-75776 + Free inodes: 4673-4736 +Group 74: (Blocks 75777-76800) + Block bitmap at 75777 (+0), Inode bitmap at 75778 (+1) + Inode table at 75779-75794 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 75795-76800 + Free inodes: 4737-4800 +Group 75: (Blocks 76801-77824) + Block bitmap at 76801 (+0), Inode bitmap at 76802 (+1) + Inode table at 76803-76818 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 76819-77824 + Free inodes: 4801-4864 +Group 76: (Blocks 77825-78848) + Block bitmap at 77825 (+0), Inode bitmap at 77826 (+1) + Inode table at 77827-77842 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 77843-78848 + Free inodes: 4865-4928 +Group 77: (Blocks 78849-79872) + Block bitmap at 78849 (+0), Inode bitmap at 78850 (+1) + Inode table at 78851-78866 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 78867-79872 + Free inodes: 4929-4992 +Group 78: (Blocks 79873-80896) + Block bitmap at 79873 (+0), Inode bitmap at 79874 (+1) + Inode table at 79875-79890 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 79891-80896 + Free inodes: 4993-5056 +Group 79: (Blocks 80897-81920) + Block bitmap at 80897 (+0), Inode bitmap at 80898 (+1) + Inode table at 80899-80914 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 80915-81920 + Free inodes: 5057-5120 +Group 80: (Blocks 81921-82944) + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-81938 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 81939-82944 + Free inodes: 5121-5184 +Group 81: (Blocks 82945-83968) + Backup superblock at 82945, Group descriptors at 82946-82961 + Reserved GDT blocks at 82962-83217 + Block bitmap at 83218 (+273), Inode bitmap at 83219 (+274) + Inode table at 83220-83235 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 83236-83968 + Free inodes: 5185-5248 +Group 82: (Blocks 83969-84992) + Block bitmap at 83969 (+0), Inode bitmap at 83970 (+1) + Inode table at 83971-83986 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 83987-84992 + Free inodes: 5249-5312 +Group 83: (Blocks 84993-86016) + Block bitmap at 84993 (+0), Inode bitmap at 84994 (+1) + Inode table at 84995-85010 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 85011-86016 + Free inodes: 5313-5376 +Group 84: (Blocks 86017-87040) + Block bitmap at 86017 (+0), Inode bitmap at 86018 (+1) + Inode table at 86019-86034 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 86035-87040 + Free inodes: 5377-5440 +Group 85: (Blocks 87041-88064) + Block bitmap at 87041 (+0), Inode bitmap at 87042 (+1) + Inode table at 87043-87058 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 87059-88064 + Free inodes: 5441-5504 +Group 86: (Blocks 88065-89088) + Block bitmap at 88065 (+0), Inode bitmap at 88066 (+1) + Inode table at 88067-88082 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 88083-89088 + Free inodes: 5505-5568 +Group 87: (Blocks 89089-90112) + Block bitmap at 89089 (+0), Inode bitmap at 89090 (+1) + Inode table at 89091-89106 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 89107-90112 + Free inodes: 5569-5632 +Group 88: (Blocks 90113-91136) + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90130 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 90131-91136 + Free inodes: 5633-5696 +Group 89: (Blocks 91137-92160) + Block bitmap at 91137 (+0), Inode bitmap at 91138 (+1) + Inode table at 91139-91154 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 91155-92160 + Free inodes: 5697-5760 +Group 90: (Blocks 92161-93184) + Block bitmap at 92161 (+0), Inode bitmap at 92162 (+1) + Inode table at 92163-92178 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 92179-93184 + Free inodes: 5761-5824 +Group 91: (Blocks 93185-94208) + Block bitmap at 93185 (+0), Inode bitmap at 93186 (+1) + Inode table at 93187-93202 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 93203-94208 + Free inodes: 5825-5888 +Group 92: (Blocks 94209-95232) + Block bitmap at 94209 (+0), Inode bitmap at 94210 (+1) + Inode table at 94211-94226 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 94227-95232 + Free inodes: 5889-5952 +Group 93: (Blocks 95233-96256) + Block bitmap at 95233 (+0), Inode bitmap at 95234 (+1) + Inode table at 95235-95250 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 95251-96256 + Free inodes: 5953-6016 +Group 94: (Blocks 96257-97280) + Block bitmap at 96257 (+0), Inode bitmap at 96258 (+1) + Inode table at 96259-96274 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 96275-97280 + Free inodes: 6017-6080 +Group 95: (Blocks 97281-98304) + Block bitmap at 97281 (+0), Inode bitmap at 97282 (+1) + Inode table at 97283-97298 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 97299-98304 + Free inodes: 6081-6144 +Group 96: (Blocks 98305-99328) + Block bitmap at 98305 (+0), Inode bitmap at 98306 (+1) + Inode table at 98307-98322 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 98323-99328 + Free inodes: 6145-6208 +Group 97: (Blocks 99329-100352) + Block bitmap at 99329 (+0), Inode bitmap at 99330 (+1) + Inode table at 99331-99346 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 99347-100352 + Free inodes: 6209-6272 +Group 98: (Blocks 100353-101376) + Block bitmap at 100353 (+0), Inode bitmap at 100354 (+1) + Inode table at 100355-100370 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 100371-101376 + Free inodes: 6273-6336 +Group 99: (Blocks 101377-102400) + Block bitmap at 101377 (+0), Inode bitmap at 101378 (+1) + Inode table at 101379-101394 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 101395-102400 + Free inodes: 6337-6400 +Group 100: (Blocks 102401-103424) + Block bitmap at 102401 (+0), Inode bitmap at 102402 (+1) + Inode table at 102403-102418 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 102419-103424 + Free inodes: 6401-6464 +Group 101: (Blocks 103425-104448) + Block bitmap at 103425 (+0), Inode bitmap at 103426 (+1) + Inode table at 103427-103442 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 103443-104448 + Free inodes: 6465-6528 +Group 102: (Blocks 104449-105472) + Block bitmap at 104449 (+0), Inode bitmap at 104450 (+1) + Inode table at 104451-104466 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 104467-105472 + Free inodes: 6529-6592 +Group 103: (Blocks 105473-106496) + Block bitmap at 105473 (+0), Inode bitmap at 105474 (+1) + Inode table at 105475-105490 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 105491-106496 + Free inodes: 6593-6656 +Group 104: (Blocks 106497-107520) + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-106514 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 106515-107520 + Free inodes: 6657-6720 +Group 105: (Blocks 107521-108544) + Block bitmap at 107521 (+0), Inode bitmap at 107522 (+1) + Inode table at 107523-107538 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 107539-108544 + Free inodes: 6721-6784 +Group 106: (Blocks 108545-109568) + Block bitmap at 108545 (+0), Inode bitmap at 108546 (+1) + Inode table at 108547-108562 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 108563-109568 + Free inodes: 6785-6848 +Group 107: (Blocks 109569-110592) + Block bitmap at 109569 (+0), Inode bitmap at 109570 (+1) + Inode table at 109571-109586 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 109587-110592 + Free inodes: 6849-6912 +Group 108: (Blocks 110593-111616) + Block bitmap at 110593 (+0), Inode bitmap at 110594 (+1) + Inode table at 110595-110610 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 110611-111616 + Free inodes: 6913-6976 +Group 109: (Blocks 111617-112640) + Block bitmap at 111617 (+0), Inode bitmap at 111618 (+1) + Inode table at 111619-111634 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 111635-112640 + Free inodes: 6977-7040 +Group 110: (Blocks 112641-113664) + Block bitmap at 112641 (+0), Inode bitmap at 112642 (+1) + Inode table at 112643-112658 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 112659-113664 + Free inodes: 7041-7104 +Group 111: (Blocks 113665-114688) + Block bitmap at 113665 (+0), Inode bitmap at 113666 (+1) + Inode table at 113667-113682 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 113683-114688 + Free inodes: 7105-7168 +Group 112: (Blocks 114689-115712) + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-114706 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 114707-115712 + Free inodes: 7169-7232 +Group 113: (Blocks 115713-116736) + Block bitmap at 115713 (+0), Inode bitmap at 115714 (+1) + Inode table at 115715-115730 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 115731-116736 + Free inodes: 7233-7296 +Group 114: (Blocks 116737-117760) + Block bitmap at 116737 (+0), Inode bitmap at 116738 (+1) + Inode table at 116739-116754 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 116755-117760 + Free inodes: 7297-7360 +Group 115: (Blocks 117761-118784) + Block bitmap at 117761 (+0), Inode bitmap at 117762 (+1) + Inode table at 117763-117778 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 117779-118784 + Free inodes: 7361-7424 +Group 116: (Blocks 118785-119808) + Block bitmap at 118785 (+0), Inode bitmap at 118786 (+1) + Inode table at 118787-118802 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 118803-119808 + Free inodes: 7425-7488 +Group 117: (Blocks 119809-120832) + Block bitmap at 119809 (+0), Inode bitmap at 119810 (+1) + Inode table at 119811-119826 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 119827-120832 + Free inodes: 7489-7552 +Group 118: (Blocks 120833-121856) + Block bitmap at 120833 (+0), Inode bitmap at 120834 (+1) + Inode table at 120835-120850 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 120851-121856 + Free inodes: 7553-7616 +Group 119: (Blocks 121857-122880) + Block bitmap at 121857 (+0), Inode bitmap at 121858 (+1) + Inode table at 121859-121874 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 121875-122880 + Free inodes: 7617-7680 +Group 120: (Blocks 122881-123904) + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-122898 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 122899-123904 + Free inodes: 7681-7744 +Group 121: (Blocks 123905-124928) + Block bitmap at 123905 (+0), Inode bitmap at 123906 (+1) + Inode table at 123907-123922 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 123923-124928 + Free inodes: 7745-7808 +Group 122: (Blocks 124929-125952) + Block bitmap at 124929 (+0), Inode bitmap at 124930 (+1) + Inode table at 124931-124946 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 124947-125952 + Free inodes: 7809-7872 +Group 123: (Blocks 125953-126976) + Block bitmap at 125953 (+0), Inode bitmap at 125954 (+1) + Inode table at 125955-125970 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 125971-126976 + Free inodes: 7873-7936 +Group 124: (Blocks 126977-128000) + Block bitmap at 126977 (+0), Inode bitmap at 126978 (+1) + Inode table at 126979-126994 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 126995-128000 + Free inodes: 7937-8000 +Group 125: (Blocks 128001-129024) + Backup superblock at 128001, Group descriptors at 128002-128017 + Reserved GDT blocks at 128018-128273 + Block bitmap at 128274 (+273), Inode bitmap at 128275 (+274) + Inode table at 128276-128291 (+275) + 733 free blocks, 64 free inodes, 0 directories + Free blocks: 128292-129024 + Free inodes: 8001-8064 +Group 126: (Blocks 129025-130048) + Block bitmap at 129025 (+0), Inode bitmap at 129026 (+1) + Inode table at 129027-129042 (+2) + 1006 free blocks, 64 free inodes, 0 directories + Free blocks: 129043-130048 + Free inodes: 8065-8128 +Group 127: (Blocks 130049-131071) + Block bitmap at 130049 (+0), Inode bitmap at 130050 (+1) + Inode table at 130051-130066 (+2) + 1005 free blocks, 64 free inodes, 0 directories + Free blocks: 130067-131071 + Free inodes: 8129-8192 diff --git a/tests/m_desc_size_128/script b/tests/m_desc_size_128/script new file mode 100644 index 0000000..a4def21 --- /dev/null +++ b/tests/m_desc_size_128/script @@ -0,0 +1,7 @@ +DESCRIPTION="enable 128-byte group descriptor on mkfs" +FS_SIZE=131072 +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +MKE2FS_OPTS="-b 1024 -O 64bit,extents -g 1024 -N 8192 -E desc_size=128" +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_devdir/script b/tests/m_devdir/script new file mode 100644 index 0000000..dfc55c7 --- /dev/null +++ b/tests/m_devdir/script @@ -0,0 +1,32 @@ +test_description="create fs image from /dev" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +MKFS_DIR=/dev +OUT=$test_name.log + +$MKE2FS -q -F -o Linux -T ext4 -O metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -d $MKFS_DIR $TMPFILE 16384 > $OUT 2>&1 +mkfs_status=$? + +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +$DEBUGFS -R 'ls /' $TMPFILE >> $OUT 2>&1 + +$FSCK -f -n $TMPFILE >> $OUT 2>&1 +fsck_status=$? + +sed -f $cmd_dir/filter.sed $OUT > $OUT.tmp +mv $OUT.tmp $OUT + +if [ $mkfs_status -ne 0 ]; then + echo "$test_name: $test_description: skipped" +elif [ $mkfs_status -eq 0 ] && [ $fsck_status -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" +fi + +rm -f $TMPFILE.cmd +unset MKFS_DIR OUT EXP diff --git a/tests/m_error_behavior/expect b/tests/m_error_behavior/expect new file mode 100644 index 0000000..78514bd --- /dev/null +++ b/tests/m_error_behavior/expect @@ -0,0 +1,24 @@ +error default +Errors behavior: Continue +error continue +Errors behavior: Continue +error panic +Errors behavior: Panic +error remount-ro +Errors behavior: Remount read-only +error garbage +error default profile continue +Errors behavior: Continue +error default profile panic +Errors behavior: Panic +error default profile remount-ro +Errors behavior: Remount read-only +error default profile broken +error fs_types profile continue +Errors behavior: Continue +error fs_types profile panic +Errors behavior: Panic +error fs_types profile remount-ro +Errors behavior: Remount read-only +error fs_types profile remount-ro +Errors behavior: Panic diff --git a/tests/m_error_behavior/script b/tests/m_error_behavior/script new file mode 100755 index 0000000..5f999f3 --- /dev/null +++ b/tests/m_error_behavior/script @@ -0,0 +1,110 @@ +test_description="mke2fs with error behavior" + +conf=$TMPFILE.conf +write_defaults_conf() +{ + errors="$1" + cat > $conf << ENDL +[defaults] + errors = $errors +ENDL +} + +write_section_conf() +{ + errors="$1" + cat > $conf << ENDL +[defaults] + errors = broken + +[fs_types] + test_suite = { + errors = $errors + } +ENDL +} + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "error default" >> $OUT +$MKE2FS -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error continue" >> $OUT +$MKE2FS -e continue -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error panic" >> $OUT +$MKE2FS -e panic -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error remount-ro" >> $OUT +$MKE2FS -e remount-ro -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error garbage" >> $OUT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +$MKE2FS -e broken -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +# Test errors= in default +echo "error default profile continue" >> $OUT +write_defaults_conf continue +MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error default profile panic" >> $OUT +write_defaults_conf panic +MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error default profile remount-ro" >> $OUT +write_defaults_conf remount-ro +MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error default profile broken" >> $OUT +write_defaults_conf broken +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +# Test errors= in a fs type +echo "error fs_types profile continue" >> $OUT +write_section_conf continue +MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error fs_types profile panic" >> $OUT +write_section_conf panic +MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +echo "error fs_types profile remount-ro" >> $OUT +write_section_conf remount-ro +MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +# Test command line override +echo "error fs_types profile remount-ro" >> $OUT +write_section_conf remount-ro +MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -e panic -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/m_extent_journal/expect.1 b/tests/m_extent_journal/expect.1 new file mode 100644 index 0000000..11124e4 --- /dev/null +++ b/tests/m_extent_journal/expect.1 @@ -0,0 +1,118 @@ +Creating filesystem with 65536 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent sparse_super +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: 11/16384 files (0.0% non-contiguous), 9508/65536 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 9494 +Free blocks: 56028 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 255 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 4096k +Total journal blocks: 4096 +Max transaction length: 4096 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-257 + Block bitmap at 258 (+257), Inode bitmap at 259 (+258) + Inode table at 260-771 (+259) + 7407 free blocks, 2037 free inodes, 2 directories + Free blocks: 786-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8449 + Block bitmap at 8450 (+257), Inode bitmap at 8451 (+258) + Inode table at 8452-8963 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 8964-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16898 (+2) + 3582 free blocks, 2048 free inodes, 0 directories + Free blocks: 20995-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24833 + Block bitmap at 24834 (+257), Inode bitmap at 24835 (+258) + Inode table at 24836-25347 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 25348-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33282 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 33283-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41217 + Block bitmap at 41218 (+257), Inode bitmap at 41219 (+258) + Inode table at 41220-41731 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 41732-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49666 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 49667-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65535) + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57601 + Block bitmap at 57602 (+257), Inode bitmap at 57603 (+258) + Inode table at 57604-58115 (+259) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 58116-65535 + Free inodes: 14337-16384 diff --git a/tests/m_extent_journal/script b/tests/m_extent_journal/script new file mode 100644 index 0000000..efade21 --- /dev/null +++ b/tests/m_extent_journal/script @@ -0,0 +1,7 @@ +DESCRIPTION="extent-mapped journal" +FS_SIZE=65536 +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +MKE2FS_OPTS="-O extents -j" +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_hugefile/expect b/tests/m_hugefile/expect new file mode 100644 index 0000000..ee33fe5 --- /dev/null +++ b/tests/m_hugefile/expect @@ -0,0 +1,19 @@ +mke2fs -F -T hugefile test.img 4T +Creating filesystem with 1073741824 4k blocks and 1048576 inodes +Superblock backups stored on blocks: + +Allocating group tables: done +Writing inode tables: done +Creating 1 huge file(s) : done +Writing superblocks and filesystem accounting information: done + +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: 13/1048576 files (0.0% non-contiguous), 1073709417/1073741824 blocks +Exit status is 0 +debugfs -R "extents /store/big-data" test.img +Last logical block: 1073610751 +Last physical block: 1073741823 diff --git a/tests/m_hugefile/name b/tests/m_hugefile/name new file mode 100644 index 0000000..0a28399 --- /dev/null +++ b/tests/m_hugefile/name @@ -0,0 +1 @@ +create a hugefile fs with a single huge file diff --git a/tests/m_hugefile/script b/tests/m_hugefile/script new file mode 100644 index 0000000..fc1d115 --- /dev/null +++ b/tests/m_hugefile/script @@ -0,0 +1,114 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 44GB filesystem + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +cat > $CONF << ENDL +[fs_types] + hugefile = { + features = extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,^resize_inode,sparse_super2 + hash_alg = half_md4 + num_backup_sb = 0 + packed_meta_blocks = 1 + make_hugefiles = 1 + inode_ratio = 4194304 + hugefiles_dir = /store + hugefiles_name = big-data + hugefiles_digits = 0 + hugefiles_size = 0 + hugefiles_align = 256M + num_hugefiles = 1 + zero_hugefiles = false + flex_bg_size = 262144 + } +ENDL + +echo "mke2fs -F -T hugefile test.img 4T" > $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -F -T hugefile $TMPFILE 4T >> $OUT 2>&1 +rm -f $CONF + +# check the file system if we get this far, we succeeded... +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +echo 'debugfs -R "extents /store/big-data" test.img' >> $OUT + +$DEBUGFS -R "extents /store/big-data" $TMPFILE 2>&1 | tr / " " | tr -d - | awk ' +BEGIN { + expected_logical_start = 0; + expected_physical_start = 0; +} +{ + if (NR != 1) { + level = $1; + total_levels = $2; + + if (level == total_levels) { + logical_start=$5; + logical_end=$6; + physical_start=$7; + physical_end=$8; + len = $9; + + if (logical_end + 1 - logical_start != len) { + print logical_end + 1 - logical_start, len; + print "UNEXPECTED LENGTH for extent", $0; + } + if (physical_end + 1 - physical_start != len) { + print physical_end + 1 - physical_start, len; + print "UNEXPECTED LENGTH for extent", $0; + } + + if (logical_start != expected_logical_start) { + print "UNEXPECTED LOGICAL DISCONTINUITY between extents:"; + print "\t", prev; + print "\t", $0; + } + if (physical_start != expected_physical_start && + expected_logical_start != 0) { + print "PHYSICAL DISCONTINUITY between extents:"; + print "\t", prev; + print "\t", $0; + } + + expected_logical_start = logical_end + 1; + expected_physical_start = physical_end + 1; + } + } + prev=$0; +} +END { + print "Last logical block:", expected_logical_start-1; + print "Last physical block:", expected_physical_start-1; +} +' >> $OUT 2>&1 + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/m_hugefile_slack/expect b/tests/m_hugefile_slack/expect new file mode 100644 index 0000000..e2e2fd6 --- /dev/null +++ b/tests/m_hugefile_slack/expect @@ -0,0 +1,19 @@ +mke2fs -F -T ext4h -I 128 test.img 786432 +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 6368 huge file(s) with 117 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 diff --git a/tests/m_hugefile_slack/name b/tests/m_hugefile_slack/name new file mode 100644 index 0000000..fd4e4d0 --- /dev/null +++ b/tests/m_hugefile_slack/name @@ -0,0 +1 @@ +mke2fs create hugefile fs with slack diff --git a/tests/m_hugefile_slack/script b/tests/m_hugefile_slack/script new file mode 100644 index 0000000..da7098a --- /dev/null +++ b/tests/m_hugefile_slack/script @@ -0,0 +1,53 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +#gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 12000K + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 117K + zero_hugefiles = false + } +ENDL + +echo "mke2fs -F -T ext4h -I 128 test.img 786432" > $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -I 128 $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# dump and check. if we get this far, we succeeded... +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/m_image_mmp/expect.1 b/tests/m_image_mmp/expect.1 new file mode 100644 index 0000000..3bca182 --- /dev/null +++ b/tests/m_image_mmp/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: 11/64 files (0.0% non-contiguous), 15/100 blocks +Exit status is 0 diff --git a/tests/m_image_mmp/name b/tests/m_image_mmp/name new file mode 100644 index 0000000..1015c34 --- /dev/null +++ b/tests/m_image_mmp/name @@ -0,0 +1 @@ +create image for partition with enabled mmp and execute fsck on image diff --git a/tests/m_image_mmp/script b/tests/m_image_mmp/script new file mode 100644 index 0000000..5af6f55 --- /dev/null +++ b/tests/m_image_mmp/script @@ -0,0 +1,22 @@ +$MKE2FS -q -F -o Linux -b 4096 -O mmp -E mmp_update_interval=1 $TMPFILE 100 >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +if test -x $E2IMAGE_EXE; then + +ONE_PASS_ONLY=true +FSCK_OPT="-n -f" +IMAGE=$TMPFILE +SKIP_GUNZIP=true +PREP_CMD="$E2IMAGE_EXE -r $TMPFILE $TMPFILE.raw 2>/dev/null; \ + mv $TMPFILE.raw $TMPFILE" + +. $cmd_dir/run_e2fsck + +else + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/m_large_file/expect.1 b/tests/m_large_file/expect.1 new file mode 100644 index 0000000..955ba77 --- /dev/null +++ b/tests/m_large_file/expect.1 @@ -0,0 +1,57 @@ +Creating filesystem with 16384 4k blocks and 64 inodes + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super large_file +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: 11/64 files (0.0% non-contiguous), 17/16384 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super large_file +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 64 +Block count: 16384 +Reserved block count: 819 +Overhead clusters: 11 +Free blocks: 16367 +Free inodes: 53 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Reserved GDT blocks: 3 +Blocks per group: 32768 +Fragments per group: 32768 +Inodes per group: 64 +Inode blocks per group: 4 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 0-16383) + Primary superblock at 0, Group descriptors at 1-1 + Reserved GDT blocks at 2-4 + Block bitmap at 5 (+5) + Inode bitmap at 6 (+6) + Inode table at 7-10 (+7) + 16367 free blocks, 53 free inodes, 2 directories + Free blocks: 17-16383 + Free inodes: 12-64 diff --git a/tests/m_large_file/script b/tests/m_large_file/script new file mode 100644 index 0000000..bd5b2ba --- /dev/null +++ b/tests/m_large_file/script @@ -0,0 +1,7 @@ +DESCRIPTION="largefile fs type" +FS_SIZE=65536 +MKE2FS_DEVICE_SECTSIZE=2048 +export MKE2FS_DEVICE_SECTSIZE +MKE2FS_OPTS="-T largefile" +. $cmd_dir/run_mke2fs +unset MKE2FS_DEVICE_SECTSIZE diff --git a/tests/m_mcsum_extjournal/expect b/tests/m_mcsum_extjournal/expect new file mode 100644 index 0000000..ef895f8 --- /dev/null +++ b/tests/m_mcsum_extjournal/expect @@ -0,0 +1,5 @@ +Creating filesystem with 4096 1k blocks and 0 inodes +Superblock backups stored on blocks: + +Zeroing journal device: +Filesystem features: journal_dev metadata_csum diff --git a/tests/m_mcsum_extjournal/name b/tests/m_mcsum_extjournal/name new file mode 100644 index 0000000..7df8389 --- /dev/null +++ b/tests/m_mcsum_extjournal/name @@ -0,0 +1 @@ +create external journal with sb checksum (metadata_csum) diff --git a/tests/m_mcsum_extjournal/script b/tests/m_mcsum_extjournal/script new file mode 100644 index 0000000..bbf1f9b --- /dev/null +++ b/tests/m_mcsum_extjournal/script @@ -0,0 +1,27 @@ +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O journal_dev,metadata_csum -T ext4 $TMPFILE 4096 2>&1 | sed -f $cmd_dir/filter.sed > $OUT +$DUMPE2FS -h $TMPFILE 2>&1 | grep 'Filesystem features:' >> $OUT + +rm -f $TMPFILE + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/m_meta_bg/expect.1 b/tests/m_meta_bg/expect.1 new file mode 100644 index 0000000..28fd5b1 --- /dev/null +++ b/tests/m_meta_bg/expect.1 @@ -0,0 +1,838 @@ +Creating filesystem with 131072 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 1025, 3073, 5121, 7169, 9217, 25601, 27649, 50177, 82945, 128001 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr dir_index filetype meta_bg sparse_super +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: 11/32768 files (0.0% non-contiguous), 8485/131072 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype meta_bg sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 131072 +Reserved block count: 6553 +Overhead clusters: 8472 +Free blocks: 122587 +Free inodes: 32757 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptor at 2 + Block bitmap at 3 (+2), Inode bitmap at 4 (+3) + Inode table at 5-68 (+4) + 943 free blocks, 245 free inodes, 2 directories + Free blocks: 82-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptor at 1026 + Block bitmap at 1027 (+2), Inode bitmap at 1028 (+3) + Inode table at 1029-1092 (+4) + 956 free blocks, 256 free inodes, 0 directories + Free blocks: 1093-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073 + Block bitmap at 3074 (+1), Inode bitmap at 3075 (+2) + Inode table at 3076-3139 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 3140-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121 + Block bitmap at 5122 (+1), Inode bitmap at 5123 (+2) + Inode table at 5124-5187 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 5188-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169 + Block bitmap at 7170 (+1), Inode bitmap at 7171 (+2) + Inode table at 7172-7235 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 7236-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217 + Block bitmap at 9218 (+1), Inode bitmap at 9219 (+2) + Inode table at 9220-9283 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 9284-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16384) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16384 + Free inodes: 3841-4096 +Group 16: (Blocks 16385-17408) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16450 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 16451-17408 + Free inodes: 4097-4352 +Group 17: (Blocks 17409-18432) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17474 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 17475-18432 + Free inodes: 4353-4608 +Group 18: (Blocks 18433-19456) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18498 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 18499-19456 + Free inodes: 4609-4864 +Group 19: (Blocks 19457-20480) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19522 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 19523-20480 + Free inodes: 4865-5120 +Group 20: (Blocks 20481-21504) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20546 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 20547-21504 + Free inodes: 5121-5376 +Group 21: (Blocks 21505-22528) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21570 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 21571-22528 + Free inodes: 5377-5632 +Group 22: (Blocks 22529-23552) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22594 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 22595-23552 + Free inodes: 5633-5888 +Group 23: (Blocks 23553-24576) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23618 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 23619-24576 + Free inodes: 5889-6144 +Group 24: (Blocks 24577-25600) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24642 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 24643-25600 + Free inodes: 6145-6400 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601 + Block bitmap at 25602 (+1), Inode bitmap at 25603 (+2) + Inode table at 25604-25667 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 25668-26624 + Free inodes: 6401-6656 +Group 26: (Blocks 26625-27648) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26690 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 26691-27648 + Free inodes: 6657-6912 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649 + Block bitmap at 27650 (+1), Inode bitmap at 27651 (+2) + Inode table at 27652-27715 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 27716-28672 + Free inodes: 6913-7168 +Group 28: (Blocks 28673-29696) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28738 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 28739-29696 + Free inodes: 7169-7424 +Group 29: (Blocks 29697-30720) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29762 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 29763-30720 + Free inodes: 7425-7680 +Group 30: (Blocks 30721-31744) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30786 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 30787-31744 + Free inodes: 7681-7936 +Group 31: (Blocks 31745-32768) + Group descriptor at 31745 + Block bitmap at 31746 (+1), Inode bitmap at 31747 (+2) + Inode table at 31748-31811 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 31812-32768 + Free inodes: 7937-8192 +Group 32: (Blocks 32769-33792) + Group descriptor at 32769 + Block bitmap at 32770 (+1), Inode bitmap at 32771 (+2) + Inode table at 32772-32835 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 32836-33792 + Free inodes: 8193-8448 +Group 33: (Blocks 33793-34816) + Group descriptor at 33793 + Block bitmap at 33794 (+1), Inode bitmap at 33795 (+2) + Inode table at 33796-33859 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 33860-34816 + Free inodes: 8449-8704 +Group 34: (Blocks 34817-35840) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34882 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 34883-35840 + Free inodes: 8705-8960 +Group 35: (Blocks 35841-36864) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35906 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 35907-36864 + Free inodes: 8961-9216 +Group 36: (Blocks 36865-37888) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36930 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 36931-37888 + Free inodes: 9217-9472 +Group 37: (Blocks 37889-38912) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37954 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 37955-38912 + Free inodes: 9473-9728 +Group 38: (Blocks 38913-39936) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38978 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 38979-39936 + Free inodes: 9729-9984 +Group 39: (Blocks 39937-40960) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-40002 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 40003-40960 + Free inodes: 9985-10240 +Group 40: (Blocks 40961-41984) + Block bitmap at 40961 (+0), Inode bitmap at 40962 (+1) + Inode table at 40963-41026 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 41027-41984 + Free inodes: 10241-10496 +Group 41: (Blocks 41985-43008) + Block bitmap at 41985 (+0), Inode bitmap at 41986 (+1) + Inode table at 41987-42050 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 42051-43008 + Free inodes: 10497-10752 +Group 42: (Blocks 43009-44032) + Block bitmap at 43009 (+0), Inode bitmap at 43010 (+1) + Inode table at 43011-43074 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 43075-44032 + Free inodes: 10753-11008 +Group 43: (Blocks 44033-45056) + Block bitmap at 44033 (+0), Inode bitmap at 44034 (+1) + Inode table at 44035-44098 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 44099-45056 + Free inodes: 11009-11264 +Group 44: (Blocks 45057-46080) + Block bitmap at 45057 (+0), Inode bitmap at 45058 (+1) + Inode table at 45059-45122 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 45123-46080 + Free inodes: 11265-11520 +Group 45: (Blocks 46081-47104) + Block bitmap at 46081 (+0), Inode bitmap at 46082 (+1) + Inode table at 46083-46146 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 46147-47104 + Free inodes: 11521-11776 +Group 46: (Blocks 47105-48128) + Block bitmap at 47105 (+0), Inode bitmap at 47106 (+1) + Inode table at 47107-47170 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 47171-48128 + Free inodes: 11777-12032 +Group 47: (Blocks 48129-49152) + Block bitmap at 48129 (+0), Inode bitmap at 48130 (+1) + Inode table at 48131-48194 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 48195-49152 + Free inodes: 12033-12288 +Group 48: (Blocks 49153-50176) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49218 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 49219-50176 + Free inodes: 12289-12544 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177 + Block bitmap at 50178 (+1), Inode bitmap at 50179 (+2) + Inode table at 50180-50243 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 50244-51200 + Free inodes: 12545-12800 +Group 50: (Blocks 51201-52224) + Block bitmap at 51201 (+0), Inode bitmap at 51202 (+1) + Inode table at 51203-51266 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 51267-52224 + Free inodes: 12801-13056 +Group 51: (Blocks 52225-53248) + Block bitmap at 52225 (+0), Inode bitmap at 52226 (+1) + Inode table at 52227-52290 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 52291-53248 + Free inodes: 13057-13312 +Group 52: (Blocks 53249-54272) + Block bitmap at 53249 (+0), Inode bitmap at 53250 (+1) + Inode table at 53251-53314 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 53315-54272 + Free inodes: 13313-13568 +Group 53: (Blocks 54273-55296) + Block bitmap at 54273 (+0), Inode bitmap at 54274 (+1) + Inode table at 54275-54338 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 54339-55296 + Free inodes: 13569-13824 +Group 54: (Blocks 55297-56320) + Block bitmap at 55297 (+0), Inode bitmap at 55298 (+1) + Inode table at 55299-55362 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 55363-56320 + Free inodes: 13825-14080 +Group 55: (Blocks 56321-57344) + Block bitmap at 56321 (+0), Inode bitmap at 56322 (+1) + Inode table at 56323-56386 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 56387-57344 + Free inodes: 14081-14336 +Group 56: (Blocks 57345-58368) + Block bitmap at 57345 (+0), Inode bitmap at 57346 (+1) + Inode table at 57347-57410 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 57411-58368 + Free inodes: 14337-14592 +Group 57: (Blocks 58369-59392) + Block bitmap at 58369 (+0), Inode bitmap at 58370 (+1) + Inode table at 58371-58434 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 58435-59392 + Free inodes: 14593-14848 +Group 58: (Blocks 59393-60416) + Block bitmap at 59393 (+0), Inode bitmap at 59394 (+1) + Inode table at 59395-59458 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 59459-60416 + Free inodes: 14849-15104 +Group 59: (Blocks 60417-61440) + Block bitmap at 60417 (+0), Inode bitmap at 60418 (+1) + Inode table at 60419-60482 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 60483-61440 + Free inodes: 15105-15360 +Group 60: (Blocks 61441-62464) + Block bitmap at 61441 (+0), Inode bitmap at 61442 (+1) + Inode table at 61443-61506 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 61507-62464 + Free inodes: 15361-15616 +Group 61: (Blocks 62465-63488) + Block bitmap at 62465 (+0), Inode bitmap at 62466 (+1) + Inode table at 62467-62530 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 62531-63488 + Free inodes: 15617-15872 +Group 62: (Blocks 63489-64512) + Block bitmap at 63489 (+0), Inode bitmap at 63490 (+1) + Inode table at 63491-63554 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 63555-64512 + Free inodes: 15873-16128 +Group 63: (Blocks 64513-65536) + Group descriptor at 64513 + Block bitmap at 64514 (+1), Inode bitmap at 64515 (+2) + Inode table at 64516-64579 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 64580-65536 + Free inodes: 16129-16384 +Group 64: (Blocks 65537-66560) + Group descriptor at 65537 + Block bitmap at 65538 (+1), Inode bitmap at 65539 (+2) + Inode table at 65540-65603 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 65604-66560 + Free inodes: 16385-16640 +Group 65: (Blocks 66561-67584) + Group descriptor at 66561 + Block bitmap at 66562 (+1), Inode bitmap at 66563 (+2) + Inode table at 66564-66627 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 66628-67584 + Free inodes: 16641-16896 +Group 66: (Blocks 67585-68608) + Block bitmap at 67585 (+0), Inode bitmap at 67586 (+1) + Inode table at 67587-67650 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 67651-68608 + Free inodes: 16897-17152 +Group 67: (Blocks 68609-69632) + Block bitmap at 68609 (+0), Inode bitmap at 68610 (+1) + Inode table at 68611-68674 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 68675-69632 + Free inodes: 17153-17408 +Group 68: (Blocks 69633-70656) + Block bitmap at 69633 (+0), Inode bitmap at 69634 (+1) + Inode table at 69635-69698 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 69699-70656 + Free inodes: 17409-17664 +Group 69: (Blocks 70657-71680) + Block bitmap at 70657 (+0), Inode bitmap at 70658 (+1) + Inode table at 70659-70722 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 70723-71680 + Free inodes: 17665-17920 +Group 70: (Blocks 71681-72704) + Block bitmap at 71681 (+0), Inode bitmap at 71682 (+1) + Inode table at 71683-71746 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 71747-72704 + Free inodes: 17921-18176 +Group 71: (Blocks 72705-73728) + Block bitmap at 72705 (+0), Inode bitmap at 72706 (+1) + Inode table at 72707-72770 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 72771-73728 + Free inodes: 18177-18432 +Group 72: (Blocks 73729-74752) + Block bitmap at 73729 (+0), Inode bitmap at 73730 (+1) + Inode table at 73731-73794 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 73795-74752 + Free inodes: 18433-18688 +Group 73: (Blocks 74753-75776) + Block bitmap at 74753 (+0), Inode bitmap at 74754 (+1) + Inode table at 74755-74818 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 74819-75776 + Free inodes: 18689-18944 +Group 74: (Blocks 75777-76800) + Block bitmap at 75777 (+0), Inode bitmap at 75778 (+1) + Inode table at 75779-75842 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 75843-76800 + Free inodes: 18945-19200 +Group 75: (Blocks 76801-77824) + Block bitmap at 76801 (+0), Inode bitmap at 76802 (+1) + Inode table at 76803-76866 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 76867-77824 + Free inodes: 19201-19456 +Group 76: (Blocks 77825-78848) + Block bitmap at 77825 (+0), Inode bitmap at 77826 (+1) + Inode table at 77827-77890 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 77891-78848 + Free inodes: 19457-19712 +Group 77: (Blocks 78849-79872) + Block bitmap at 78849 (+0), Inode bitmap at 78850 (+1) + Inode table at 78851-78914 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 78915-79872 + Free inodes: 19713-19968 +Group 78: (Blocks 79873-80896) + Block bitmap at 79873 (+0), Inode bitmap at 79874 (+1) + Inode table at 79875-79938 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 79939-80896 + Free inodes: 19969-20224 +Group 79: (Blocks 80897-81920) + Block bitmap at 80897 (+0), Inode bitmap at 80898 (+1) + Inode table at 80899-80962 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 80963-81920 + Free inodes: 20225-20480 +Group 80: (Blocks 81921-82944) + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-81986 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 81987-82944 + Free inodes: 20481-20736 +Group 81: (Blocks 82945-83968) + Backup superblock at 82945 + Block bitmap at 82946 (+1), Inode bitmap at 82947 (+2) + Inode table at 82948-83011 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 83012-83968 + Free inodes: 20737-20992 +Group 82: (Blocks 83969-84992) + Block bitmap at 83969 (+0), Inode bitmap at 83970 (+1) + Inode table at 83971-84034 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 84035-84992 + Free inodes: 20993-21248 +Group 83: (Blocks 84993-86016) + Block bitmap at 84993 (+0), Inode bitmap at 84994 (+1) + Inode table at 84995-85058 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 85059-86016 + Free inodes: 21249-21504 +Group 84: (Blocks 86017-87040) + Block bitmap at 86017 (+0), Inode bitmap at 86018 (+1) + Inode table at 86019-86082 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 86083-87040 + Free inodes: 21505-21760 +Group 85: (Blocks 87041-88064) + Block bitmap at 87041 (+0), Inode bitmap at 87042 (+1) + Inode table at 87043-87106 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 87107-88064 + Free inodes: 21761-22016 +Group 86: (Blocks 88065-89088) + Block bitmap at 88065 (+0), Inode bitmap at 88066 (+1) + Inode table at 88067-88130 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 88131-89088 + Free inodes: 22017-22272 +Group 87: (Blocks 89089-90112) + Block bitmap at 89089 (+0), Inode bitmap at 89090 (+1) + Inode table at 89091-89154 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 89155-90112 + Free inodes: 22273-22528 +Group 88: (Blocks 90113-91136) + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90178 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 90179-91136 + Free inodes: 22529-22784 +Group 89: (Blocks 91137-92160) + Block bitmap at 91137 (+0), Inode bitmap at 91138 (+1) + Inode table at 91139-91202 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 91203-92160 + Free inodes: 22785-23040 +Group 90: (Blocks 92161-93184) + Block bitmap at 92161 (+0), Inode bitmap at 92162 (+1) + Inode table at 92163-92226 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 92227-93184 + Free inodes: 23041-23296 +Group 91: (Blocks 93185-94208) + Block bitmap at 93185 (+0), Inode bitmap at 93186 (+1) + Inode table at 93187-93250 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 93251-94208 + Free inodes: 23297-23552 +Group 92: (Blocks 94209-95232) + Block bitmap at 94209 (+0), Inode bitmap at 94210 (+1) + Inode table at 94211-94274 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 94275-95232 + Free inodes: 23553-23808 +Group 93: (Blocks 95233-96256) + Block bitmap at 95233 (+0), Inode bitmap at 95234 (+1) + Inode table at 95235-95298 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 95299-96256 + Free inodes: 23809-24064 +Group 94: (Blocks 96257-97280) + Block bitmap at 96257 (+0), Inode bitmap at 96258 (+1) + Inode table at 96259-96322 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 96323-97280 + Free inodes: 24065-24320 +Group 95: (Blocks 97281-98304) + Group descriptor at 97281 + Block bitmap at 97282 (+1), Inode bitmap at 97283 (+2) + Inode table at 97284-97347 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 97348-98304 + Free inodes: 24321-24576 +Group 96: (Blocks 98305-99328) + Group descriptor at 98305 + Block bitmap at 98306 (+1), Inode bitmap at 98307 (+2) + Inode table at 98308-98371 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 98372-99328 + Free inodes: 24577-24832 +Group 97: (Blocks 99329-100352) + Group descriptor at 99329 + Block bitmap at 99330 (+1), Inode bitmap at 99331 (+2) + Inode table at 99332-99395 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 99396-100352 + Free inodes: 24833-25088 +Group 98: (Blocks 100353-101376) + Block bitmap at 100353 (+0), Inode bitmap at 100354 (+1) + Inode table at 100355-100418 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 100419-101376 + Free inodes: 25089-25344 +Group 99: (Blocks 101377-102400) + Block bitmap at 101377 (+0), Inode bitmap at 101378 (+1) + Inode table at 101379-101442 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 101443-102400 + Free inodes: 25345-25600 +Group 100: (Blocks 102401-103424) + Block bitmap at 102401 (+0), Inode bitmap at 102402 (+1) + Inode table at 102403-102466 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 102467-103424 + Free inodes: 25601-25856 +Group 101: (Blocks 103425-104448) + Block bitmap at 103425 (+0), Inode bitmap at 103426 (+1) + Inode table at 103427-103490 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 103491-104448 + Free inodes: 25857-26112 +Group 102: (Blocks 104449-105472) + Block bitmap at 104449 (+0), Inode bitmap at 104450 (+1) + Inode table at 104451-104514 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 104515-105472 + Free inodes: 26113-26368 +Group 103: (Blocks 105473-106496) + Block bitmap at 105473 (+0), Inode bitmap at 105474 (+1) + Inode table at 105475-105538 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 105539-106496 + Free inodes: 26369-26624 +Group 104: (Blocks 106497-107520) + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-106562 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 106563-107520 + Free inodes: 26625-26880 +Group 105: (Blocks 107521-108544) + Block bitmap at 107521 (+0), Inode bitmap at 107522 (+1) + Inode table at 107523-107586 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 107587-108544 + Free inodes: 26881-27136 +Group 106: (Blocks 108545-109568) + Block bitmap at 108545 (+0), Inode bitmap at 108546 (+1) + Inode table at 108547-108610 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 108611-109568 + Free inodes: 27137-27392 +Group 107: (Blocks 109569-110592) + Block bitmap at 109569 (+0), Inode bitmap at 109570 (+1) + Inode table at 109571-109634 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 109635-110592 + Free inodes: 27393-27648 +Group 108: (Blocks 110593-111616) + Block bitmap at 110593 (+0), Inode bitmap at 110594 (+1) + Inode table at 110595-110658 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 110659-111616 + Free inodes: 27649-27904 +Group 109: (Blocks 111617-112640) + Block bitmap at 111617 (+0), Inode bitmap at 111618 (+1) + Inode table at 111619-111682 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 111683-112640 + Free inodes: 27905-28160 +Group 110: (Blocks 112641-113664) + Block bitmap at 112641 (+0), Inode bitmap at 112642 (+1) + Inode table at 112643-112706 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 112707-113664 + Free inodes: 28161-28416 +Group 111: (Blocks 113665-114688) + Block bitmap at 113665 (+0), Inode bitmap at 113666 (+1) + Inode table at 113667-113730 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 113731-114688 + Free inodes: 28417-28672 +Group 112: (Blocks 114689-115712) + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-114754 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 114755-115712 + Free inodes: 28673-28928 +Group 113: (Blocks 115713-116736) + Block bitmap at 115713 (+0), Inode bitmap at 115714 (+1) + Inode table at 115715-115778 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 115779-116736 + Free inodes: 28929-29184 +Group 114: (Blocks 116737-117760) + Block bitmap at 116737 (+0), Inode bitmap at 116738 (+1) + Inode table at 116739-116802 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 116803-117760 + Free inodes: 29185-29440 +Group 115: (Blocks 117761-118784) + Block bitmap at 117761 (+0), Inode bitmap at 117762 (+1) + Inode table at 117763-117826 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 117827-118784 + Free inodes: 29441-29696 +Group 116: (Blocks 118785-119808) + Block bitmap at 118785 (+0), Inode bitmap at 118786 (+1) + Inode table at 118787-118850 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 118851-119808 + Free inodes: 29697-29952 +Group 117: (Blocks 119809-120832) + Block bitmap at 119809 (+0), Inode bitmap at 119810 (+1) + Inode table at 119811-119874 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 119875-120832 + Free inodes: 29953-30208 +Group 118: (Blocks 120833-121856) + Block bitmap at 120833 (+0), Inode bitmap at 120834 (+1) + Inode table at 120835-120898 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 120899-121856 + Free inodes: 30209-30464 +Group 119: (Blocks 121857-122880) + Block bitmap at 121857 (+0), Inode bitmap at 121858 (+1) + Inode table at 121859-121922 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 121923-122880 + Free inodes: 30465-30720 +Group 120: (Blocks 122881-123904) + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-122946 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 122947-123904 + Free inodes: 30721-30976 +Group 121: (Blocks 123905-124928) + Block bitmap at 123905 (+0), Inode bitmap at 123906 (+1) + Inode table at 123907-123970 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 123971-124928 + Free inodes: 30977-31232 +Group 122: (Blocks 124929-125952) + Block bitmap at 124929 (+0), Inode bitmap at 124930 (+1) + Inode table at 124931-124994 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 124995-125952 + Free inodes: 31233-31488 +Group 123: (Blocks 125953-126976) + Block bitmap at 125953 (+0), Inode bitmap at 125954 (+1) + Inode table at 125955-126018 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 126019-126976 + Free inodes: 31489-31744 +Group 124: (Blocks 126977-128000) + Block bitmap at 126977 (+0), Inode bitmap at 126978 (+1) + Inode table at 126979-127042 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 127043-128000 + Free inodes: 31745-32000 +Group 125: (Blocks 128001-129024) + Backup superblock at 128001 + Block bitmap at 128002 (+1), Inode bitmap at 128003 (+2) + Inode table at 128004-128067 (+3) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 128068-129024 + Free inodes: 32001-32256 +Group 126: (Blocks 129025-130048) + Block bitmap at 129025 (+0), Inode bitmap at 129026 (+1) + Inode table at 129027-129090 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 129091-130048 + Free inodes: 32257-32512 +Group 127: (Blocks 130049-131071) + Group descriptor at 130049 + Block bitmap at 130050 (+1), Inode bitmap at 130051 (+2) + Inode table at 130052-130115 (+3) + 956 free blocks, 256 free inodes, 0 directories + Free blocks: 130116-131071 + Free inodes: 32513-32768 diff --git a/tests/m_meta_bg/script b/tests/m_meta_bg/script new file mode 100644 index 0000000..5e285b4 --- /dev/null +++ b/tests/m_meta_bg/script @@ -0,0 +1,7 @@ +DESCRIPTION="meta blockgroup feature" +FS_SIZE=131072 +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +MKE2FS_OPTS="-O meta_bg,sparse_super,^resize_inode -g 1024" +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_minrootdir/expect b/tests/m_minrootdir/expect new file mode 100644 index 0000000..d2e9a9e --- /dev/null +++ b/tests/m_minrootdir/expect @@ -0,0 +1,217 @@ +create fs +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype extent 64bit flex_bg sparse_super huge_file dir_nlink extra_isize metadata_csum +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 1024 +Block count: 16384 +Reserved block count: 819 +Overhead clusters: 265 +Free blocks: 16065 +Free inodes: 1006 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 512 +Inode blocks per group: 128 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 +Checksum type: crc32c + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Block bitmap at 3 (+2) + Inode bitmap at 5 (+4) + Inode table at 7-134 (+6) + 7876 free blocks, 494 free inodes, 4 directories, 494 unused inodes + Free blocks: 317-8192 + Free inodes: 19-512 +Group 1: (Blocks 8193-16383) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8194 + Block bitmap at 4 (bg #0 + 3) + Inode bitmap at 6 (bg #0 + 5) + Inode table at 135-262 (bg #0 + 134) + 8189 free blocks, 512 free inodes, 0 directories, 512 unused inodes + Free blocks: 8195-16383 + Free inodes: 513-1024 +debugfs: stat /emptyfile +Inode: III Type: regular +Size: 0 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigfile +Inode: III Type: regular +Size: 32768 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /sparsefile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigzerofile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /fifo +debugfs: stat /emptydir +Inode: III Type: directory +Size: 1024 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir +Inode: III Type: directory +Size: 1024 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir/file +Inode: III Type: regular +Size: 8 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: ex /emptyfile +Level Entries Logical Physical Length Flags +debugfs: ex /bigfile +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-31 AAA-BBB 32 +debugfs: ex /sparsefile +Level Entries Logical Physical Length Flags +Y 0/1 1/1 1-1048576 AAA 1048576 +X 1/1 1/5 1-1 AAA-BBB 1 +X 1/1 2/5 512-512 AAA-BBB 1 +X 1/1 3/5 1024-1024 AAA-BBB 1 +X 1/1 4/5 524288-524288 AAA-BBB 1 +X 1/1 5/5 1048576-1048576 AAA-BBB 1 +debugfs: ex /bigzerofile +Level Entries Logical Physical Length Flags +debugfs: ex /dir +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-0 AAA-BBB 1 +debugfs: ex /dir/file +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-0 AAA-BBB 1 +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.img: 18/1024 files (0.0% non-contiguous), 319/16384 blocks +minify fs +Setting reserved blocks percentage to 0% (0 blocks) +Resizing the filesystem on test.img to 338 (1k) blocks. +The filesystem on test.img is now 338 (1k) blocks long. + +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype extent 64bit flex_bg sparse_super huge_file dir_nlink extra_isize metadata_csum +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 512 +Block count: 338 +Reserved block count: 0 +Free blocks: 151 +Free inodes: 494 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 512 +Inode blocks per group: 128 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 +Checksum type: crc32c + + +Group 0: (Blocks 1-337) + Primary superblock at 1, Group descriptors at 2-2 + Block bitmap at 3 (+2) + Inode bitmap at 5 (+4) + Inode table at 7-134 (+6) + 151 free blocks, 494 free inodes, 4 directories, 494 unused inodes + Free blocks: 4, 6, 135-262, 317-337 + Free inodes: 19-512 +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.img: 18/512 files (0.0% non-contiguous), 187/338 blocks +minify fs (2) +Setting reserved blocks percentage to 0% (0 blocks) +Resizing the filesystem on test.img to 188 (1k) blocks. +The filesystem on test.img is now 188 (1k) blocks long. + +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype extent 64bit flex_bg sparse_super huge_file dir_nlink extra_isize metadata_csum +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 512 +Block count: 188 +Reserved block count: 0 +Free blocks: 1 +Free inodes: 494 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 512 +Inode blocks per group: 128 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 +Checksum type: crc32c + + +Group 0: (Blocks 1-187) + Primary superblock at 1, Group descriptors at 2-2 + Block bitmap at 3 (+2) + Inode bitmap at 5 (+4) + Inode table at 7-134 (+6) + 1 free blocks, 494 free inodes, 4 directories, 494 unused inodes + Free blocks: 187 + Free inodes: 19-512 +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.img: 18/512 files (5.6% non-contiguous), 187/188 blocks diff --git a/tests/m_minrootdir/output.sed b/tests/m_minrootdir/output.sed new file mode 100644 index 0000000..2e76967 --- /dev/null +++ b/tests/m_minrootdir/output.sed @@ -0,0 +1,5 @@ +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*-[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/X \1\/\2 \3\/\4 \5-\6 AAA-BBB \7/g +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/Y \1\/\2 \3\/\4 \5-\6 AAA \7/g +s/Mode:.*$//g +s/User:.*Size:/Size:/g +s/^Inode: [0-9]*/Inode: III/g diff --git a/tests/m_minrootdir/script b/tests/m_minrootdir/script new file mode 100644 index 0000000..4e2314c --- /dev/null +++ b/tests/m_minrootdir/script @@ -0,0 +1,80 @@ +test_description="create fs image from dir, then minimize it" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +MKFS_DIR=$TMPFILE.dir +OUT=$test_name.log +EXP=$test_dir/expect + +rm -rf $MKFS_DIR +mkdir -p $MKFS_DIR +mkdir $MKFS_DIR/dir +mkdir $MKFS_DIR/emptydir +dd if=/dev/zero of=$MKFS_DIR/bigzerofile bs=1 count=1 seek=1073741824 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1024 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=524288 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1048576 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=536870912 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1073741824 conv=notrunc 2> /dev/null +dd if=/dev/zero bs=1024 count=32 2> /dev/null | tr '\0' 'a' > $MKFS_DIR/bigfile +touch $MKFS_DIR/emptyfile +echo "Test me" > $MKFS_DIR/dir/file + +echo "create fs" > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^has_journal,metadata_csum,64bit,^resize_inode -E lazy_itable_init=1 -b 1024 -d $MKFS_DIR $TMPFILE 16384 >> $OUT 2>&1 + +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +cat > $TMPFILE.cmd << ENDL +stat /emptyfile +stat /bigfile +stat /sparsefile +stat /bigzerofile +stat /fifo +stat /emptydir +stat /dir +stat /dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT + +cat > $TMPFILE.cmd << ENDL +ex /emptyfile +ex /bigfile +ex /sparsefile +ex /bigzerofile +ex /dir +ex /dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT 2>&1 +$FSCK -f -n $TMPFILE >> $OUT 2>&1 + +echo "minify fs" >> $OUT +$TUNE2FS -m 0 $TMPFILE >> $OUT 2>&1 +$RESIZE2FS -M $TMPFILE >> $OUT 2>&1 +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +$FSCK -f -n $TMPFILE >> $OUT 2>&1 + +echo "minify fs (2)" >> $OUT +$TUNE2FS -m 0 $TMPFILE >> $OUT 2>&1 +$RESIZE2FS -M $TMPFILE >> $OUT 2>&1 +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +$FSCK -f -n $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -f $test_dir/output.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp +mv $OUT.tmp $OUT + +# Do the verification +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm -rf $TMPFILE.cmd $MKFS_DIR +unset MKFS_DIR OUT EXP diff --git a/tests/m_mkfs_overhead/expect b/tests/m_mkfs_overhead/expect new file mode 100644 index 0000000..adb8fd2 --- /dev/null +++ b/tests/m_mkfs_overhead/expect @@ -0,0 +1 @@ +test.img: Cannot create filesystem with requested number of inodes while setting up superblock diff --git a/tests/m_mkfs_overhead/script b/tests/m_mkfs_overhead/script new file mode 100644 index 0000000..3606fa2 --- /dev/null +++ b/tests/m_mkfs_overhead/script @@ -0,0 +1,29 @@ +test_description="test bg overhead calculation" + +OUT=$test_name.log +EXP=$test_dir/expect +FS_SIZE=1024 +MKE2FS_OPTS="-o hurd -b 1024 -m 0 -g 256 -N 3745" + +MKE2FS_SKIP_PROGRESS=true +MKE2FS_SKIP_CHECK_MSG=true +export MKE2FS_SKIP_PROGRESS MKE2FS_SKIP_CHECK_MSG +> $TMPFILE + +$MKE2FS -F -o Linux $MKE2FS_OPTS $TMPFILE $FS_SIZE 2>&1 | + sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" > $OUT + +rm -f $TMPFILE + +cmp -s $OUT $EXP +status1=$? + +if [ "$status1" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset OUT EXP DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS diff --git a/tests/m_mmp/expect.1 b/tests/m_mmp/expect.1 new file mode 100644 index 0000000..0edb97d --- /dev/null +++ b/tests/m_mmp/expect.1 @@ -0,0 +1,79 @@ +Creating filesystem with 65536 4k blocks and 65536 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Multiple mount protection is enabled with update interval 5 seconds. +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype mmp sparse_super large_file +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: 11/65536 files (0.0% non-contiguous), 4141/65536 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype mmp sparse_super large_file +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 65536 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 4134 +Free blocks: 61395 +Free inodes: 65525 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Reserved GDT blocks: 15 +Blocks per group: 32768 +Fragments per group: 32768 +Inodes per group: 32768 +Inode blocks per group: 2048 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 +MMP block number: 2073 +MMP update interval: 5 +MMP_block: + mmp_magic: 0x4d4d50 + mmp_check_interval: 5 + mmp_sequence: 0xff4d4d50 + mmp_update_date: test date + mmp_update_time: test_time + mmp_node_name: test_node + mmp_device_name: test.img + + +Group 0: (Blocks 0-32767) + Primary superblock at 0, Group descriptors at 1-1 + Reserved GDT blocks at 2-16 + Block bitmap at 17 (+17) + Inode bitmap at 18 (+18) + Inode table at 19-2066 (+19) + 30694 free blocks, 32757 free inodes, 2 directories + Free blocks: 2074-32767 + Free inodes: 12-32768 +Group 1: (Blocks 32768-65535) + Backup superblock at 32768, Group descriptors at 32769-32769 + Reserved GDT blocks at 32770-32784 + Block bitmap at 32785 (+17) + Inode bitmap at 32786 (+18) + Inode table at 32787-34834 (+19) + 30701 free blocks, 32768 free inodes, 0 directories + Free blocks: 34835-65535 + Free inodes: 32769-65536 diff --git a/tests/m_mmp/script b/tests/m_mmp/script new file mode 100644 index 0000000..e456183 --- /dev/null +++ b/tests/m_mmp/script @@ -0,0 +1,8 @@ +DESCRIPTION="enable MMP during mke2fs" +FS_SIZE=65536 +MKE2FS_DEVICE_SECTSIZE=2048 +export MKE2FS_DEVICE_SECTSIZE + +MKE2FS_OPTS="-b 4096 -O mmp" +. $cmd_dir/run_mke2fs +unset MKE2FS_DEVICE_SECTSIZE diff --git a/tests/m_mmp_bad_csum/expect b/tests/m_mmp_bad_csum/expect new file mode 100644 index 0000000..a0678ac --- /dev/null +++ b/tests/m_mmp_bad_csum/expect @@ -0,0 +1,23 @@ +dumpe2fs: MMP block checksum does not match while trying to open test.img +dumpe2fs: MMP last updated by 'test_node' on test date +Exit status is 1 +Superblock MMP block checksum does not match. Fix? yes + +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: 11/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 +dumpe2fs: it is safe to mount 'test.img', MMP is clean +Exit status is 0 +MMP_block: + mmp_magic: 0x4d4d50 + mmp_check_interval: 5 + mmp_sequence: 0xff4d4d50 + mmp_update_date: test date + mmp_update_time: test_time + mmp_node_name: test_node + mmp_device_name: test.img + mmp_block_number: 8 diff --git a/tests/m_mmp_bad_csum/image.gz b/tests/m_mmp_bad_csum/image.gz Binary files differnew file mode 100644 index 0000000..c896ff6 --- /dev/null +++ b/tests/m_mmp_bad_csum/image.gz diff --git a/tests/m_mmp_bad_csum/name b/tests/m_mmp_bad_csum/name new file mode 100644 index 0000000..61c31d4 --- /dev/null +++ b/tests/m_mmp_bad_csum/name @@ -0,0 +1 @@ +mmp with bad csum (metadata_csum) diff --git a/tests/m_mmp_bad_csum/script b/tests/m_mmp_bad_csum/script new file mode 100644 index 0000000..a5e222e --- /dev/null +++ b/tests/m_mmp_bad_csum/script @@ -0,0 +1,27 @@ +gzip -dc < $test_dir/image.gz > $TMPFILE + +OUT=$test_name.log +EXP=$test_dir/expect +$E2MMPSTATUS $TMPFILE > $OUT 2>&1 +echo Exit status is $? >> $OUT +$FSCK -fy $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1 +sed -f $cmd_dir/filter.sed $OUT > $OUT.new +mv $OUT.new $OUT + +rm -f $TMPFILE +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi +unset OUT EXP diff --git a/tests/m_mmp_bad_magic/.log b/tests/m_mmp_bad_magic/.log new file mode 100644 index 0000000..b5dfb89 --- /dev/null +++ b/tests/m_mmp_bad_magic/.log @@ -0,0 +1,9 @@ +Superblock has invalid MMP magic. Fix? yes + +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: 11/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 diff --git a/tests/m_mmp_bad_magic/expect b/tests/m_mmp_bad_magic/expect new file mode 100644 index 0000000..d5fa98c --- /dev/null +++ b/tests/m_mmp_bad_magic/expect @@ -0,0 +1,22 @@ +dumpe2fs: MMP: invalid magic number while trying to open test.img +Exit status is 2 +Superblock has invalid MMP magic. Fix? yes + +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: 11/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 +dumpe2fs: it is safe to mount 'test.img', MMP is clean +Exit status is 0 +MMP_block: + mmp_magic: 0x4d4d50 + mmp_check_interval: 5 + mmp_sequence: 0xff4d4d50 + mmp_update_date: test date + mmp_update_time: test_time + mmp_node_name: test_node + mmp_device_name: test.img + mmp_block_number: 8 diff --git a/tests/m_mmp_bad_magic/image.gz b/tests/m_mmp_bad_magic/image.gz Binary files differnew file mode 100644 index 0000000..2d57fbf --- /dev/null +++ b/tests/m_mmp_bad_magic/image.gz diff --git a/tests/m_mmp_bad_magic/name b/tests/m_mmp_bad_magic/name new file mode 100644 index 0000000..15a2d4d --- /dev/null +++ b/tests/m_mmp_bad_magic/name @@ -0,0 +1 @@ +mmp with bad magic (metadata_csum) diff --git a/tests/m_mmp_bad_magic/script b/tests/m_mmp_bad_magic/script new file mode 100644 index 0000000..a5e222e --- /dev/null +++ b/tests/m_mmp_bad_magic/script @@ -0,0 +1,27 @@ +gzip -dc < $test_dir/image.gz > $TMPFILE + +OUT=$test_name.log +EXP=$test_dir/expect +$E2MMPSTATUS $TMPFILE > $OUT 2>&1 +echo Exit status is $? >> $OUT +$FSCK -fy $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1 +sed -f $cmd_dir/filter.sed $OUT > $OUT.new +mv $OUT.new $OUT + +rm -f $TMPFILE +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi +unset OUT EXP diff --git a/tests/m_no_opt/expect.1 b/tests/m_no_opt/expect.1 new file mode 100644 index 0000000..806d293 --- /dev/null +++ b/tests/m_no_opt/expect.1 @@ -0,0 +1,105 @@ +Creating filesystem with 65536 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 16385, 24577, 32769, 40961, 49153, 57345 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features:(none) +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: 11/16384 files (0.0% non-contiguous), 4142/65536 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: (none) +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 4129 +Free blocks: 61394 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Block bitmap at 3 (+2), Inode bitmap at 4 (+3) + Inode table at 5-516 (+4) + 7663 free blocks, 2037 free inodes, 2 directories + Free blocks: 530-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Block bitmap at 8195 (+2), Inode bitmap at 8196 (+3) + Inode table at 8197-8708 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 8709-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Backup superblock at 16385, Group descriptors at 16386-16386 + Block bitmap at 16387 (+2), Inode bitmap at 16388 (+3) + Inode table at 16389-16900 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 16901-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Block bitmap at 24579 (+2), Inode bitmap at 24580 (+3) + Inode table at 24581-25092 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 25093-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Backup superblock at 32769, Group descriptors at 32770-32770 + Block bitmap at 32771 (+2), Inode bitmap at 32772 (+3) + Inode table at 32773-33284 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 33285-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Block bitmap at 40963 (+2), Inode bitmap at 40964 (+3) + Inode table at 40965-41476 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 41477-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Backup superblock at 49153, Group descriptors at 49154-49154 + Block bitmap at 49155 (+2), Inode bitmap at 49156 (+3) + Inode table at 49157-49668 (+4) + 7676 free blocks, 2048 free inodes, 0 directories + Free blocks: 49669-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65535) + Backup superblock at 57345, Group descriptors at 57346-57346 + Block bitmap at 57347 (+2), Inode bitmap at 57348 (+3) + Inode table at 57349-57860 (+4) + 7675 free blocks, 2048 free inodes, 0 directories + Free blocks: 57861-65535 + Free inodes: 14337-16384 diff --git a/tests/m_no_opt/script b/tests/m_no_opt/script new file mode 100644 index 0000000..223f117 --- /dev/null +++ b/tests/m_no_opt/script @@ -0,0 +1,7 @@ +DESCRIPTION="no filesystem extensions" +FS_SIZE=65536 +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +MKE2FS_OPTS="-O ^sparse_super,^filetype,^resize_inode,^dir_index,^ext_attr" +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_offset/script b/tests/m_offset/script new file mode 100755 index 0000000..d49e555 --- /dev/null +++ b/tests/m_offset/script @@ -0,0 +1,34 @@ +test_description="mke2fs with offset option (-E offset=N)" +OUT="$test_name.log" + +echo "testing mke2fs with -E offset=524288 option (no fssize)" > "$OUT" +yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT" +$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" >> "$OUT" 2>&1 +# compute crc of the first 512 1k blocks +crc_first1=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM` + +echo "testing mke2fs with -E offset=524288 option (explicit fssize)" >> "$OUT" +yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT" +$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" 1024 >> "$OUT" 2>&1 +# compute crc of the first and last 512 1k blocks +crc_first2=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM` +crc_last2=`$DD if="$TMPFILE" bs=1k count=512 skip=1536 2>/dev/null | $CRCSUM` +crc_exp=`yes a | $DD bs=1k count=512 2>/dev/null | $CRCSUM` +# a warning should be only emitted by the first mke2fs call +warning=`grep -c "offset specified without an explicit file system size." \ + "$OUT"` + +if [ "$warning" -eq 1 -a \ + "$crc_first1" = "$crc_first2" -a \ + "$crc_first2" = "$crc_last2" -a \ + "$crc_first2" = "$crc_exp" ]; then + echo "$test_name: $test_description: ok" + touch "$test_name.ok" +else + echo "$test_name: $test_description: failed" + echo "warning: $warning" > "$test_name.failed" + echo "crc_first1: $crc_first1" >> "$test_name.failed" + echo "crc_first2: $crc_first2" >> "$test_name.failed" + echo "crc_last2: $crc_last2" >> "$test_name.failed" + echo "crc_exp: $crc_exp" >> "$test_name.failed" +fi diff --git a/tests/m_quota/expect.1 b/tests/m_quota/expect.1 new file mode 100644 index 0000000..74e38ca --- /dev/null +++ b/tests/m_quota/expect.1 @@ -0,0 +1,161 @@ +Creating filesystem with 131072 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super quota project +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/32768 files (25.0% non-contiguous), 9805/131072 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super quota project +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 131072 +Reserved block count: 6553 +Overhead clusters: 9773 +Free blocks: 121267 +Free inodes: 32756 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 +User quota inode: 3 +Group quota inode: 4 +Project quota inode: 12 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-258 + Block bitmap at 259 (+258), Inode bitmap at 260 (+259) + Inode table at 261-772 (+260) + 7388 free blocks, 2036 free inodes, 2 directories + Free blocks: 805-8192 + Free inodes: 13-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8450 + Block bitmap at 8451 (+258), Inode bitmap at 8452 (+259) + Inode table at 8453-8964 (+260) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 8965-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16898 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 16899-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24834 + Block bitmap at 24835 (+258), Inode bitmap at 24836 (+259) + Inode table at 24837-25348 (+260) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 25349-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33282 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 33283-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41218 + Block bitmap at 41219 (+258), Inode bitmap at 41220 (+259) + Inode table at 41221-41732 (+260) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 41733-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49666 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 49667-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65536) + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57602 + Block bitmap at 57603 (+258), Inode bitmap at 57604 (+259) + Inode table at 57605-58116 (+260) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 58117-65536 + Free inodes: 14337-16384 +Group 8: (Blocks 65537-73728) + Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1) + Inode table at 65539-66050 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 66051-73728 + Free inodes: 16385-18432 +Group 9: (Blocks 73729-81920) + Backup superblock at 73729, Group descriptors at 73730-73730 + Reserved GDT blocks at 73731-73986 + Block bitmap at 73987 (+258), Inode bitmap at 73988 (+259) + Inode table at 73989-74500 (+260) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 74501-81920 + Free inodes: 18433-20480 +Group 10: (Blocks 81921-90112) + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-82434 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 82435-90112 + Free inodes: 20481-22528 +Group 11: (Blocks 90113-98304) + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90626 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 90627-98304 + Free inodes: 22529-24576 +Group 12: (Blocks 98305-106496) + Block bitmap at 98305 (+0), Inode bitmap at 98306 (+1) + Inode table at 98307-98818 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 98819-106496 + Free inodes: 24577-26624 +Group 13: (Blocks 106497-114688) + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-107010 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 107011-114688 + Free inodes: 26625-28672 +Group 14: (Blocks 114689-122880) + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-115202 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 115203-122880 + Free inodes: 28673-30720 +Group 15: (Blocks 122881-131071) + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-123394 (+2) + 7677 free blocks, 2048 free inodes, 0 directories + Free blocks: 123395-131071 + Free inodes: 30721-32768 diff --git a/tests/m_quota/script b/tests/m_quota/script new file mode 100644 index 0000000..32a12b9 --- /dev/null +++ b/tests/m_quota/script @@ -0,0 +1,11 @@ +DESCRIPTION="enable quota feature on mkfs" +FS_SIZE=131072 +MKE2FS_OPTS="-O quota,project -I 256" +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $DESCRIPTION: skipped" + return 0 +fi +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_raid_opt/expect.1 b/tests/m_raid_opt/expect.1 new file mode 100644 index 0000000..c1dc61b --- /dev/null +++ b/tests/m_raid_opt/expect.1 @@ -0,0 +1,841 @@ +Creating filesystem with 131072 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 1025, 3073, 5121, 7169, 9217, 25601, 27649, 50177, 82945, 128001 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +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: 11/32768 files (0.0% non-contiguous), 11334/131072 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 131072 +Reserved block count: 6553 +Overhead clusters: 11320 +Free blocks: 119738 +Free inodes: 32757 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +RAID stride: 13 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-5 + Reserved GDT blocks at 6-261 + Block bitmap at 326 (+325), Inode bitmap at 327 (+326) + Inode table at 262-325 (+261) + 683 free blocks, 245 free inodes, 2 directories + Free blocks: 342-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1029 + Reserved GDT blocks at 1030-1285 + Block bitmap at 1363 (+338), Inode bitmap at 1364 (+339) + Inode table at 1286-1349 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 1350-1362, 1365-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2139 (+90), Inode bitmap at 2140 (+91) + Inode table at 2049-2112 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2113-2138, 2141-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3077 + Reserved GDT blocks at 3078-3333 + Block bitmap at 3437 (+364), Inode bitmap at 3438 (+365) + Inode table at 3334-3397 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 3398-3436, 3439-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4213 (+116), Inode bitmap at 4214 (+117) + Inode table at 4097-4160 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4161-4212, 4215-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5125 + Reserved GDT blocks at 5126-5381 + Block bitmap at 5511 (+390), Inode bitmap at 5512 (+391) + Inode table at 5382-5445 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 5446-5510, 5513-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6287 (+142), Inode bitmap at 6288 (+143) + Inode table at 6145-6208 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6209-6286, 6289-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7173 + Reserved GDT blocks at 7174-7429 + Block bitmap at 7585 (+416), Inode bitmap at 7586 (+417) + Inode table at 7430-7493 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 7494-7584, 7587-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8361 (+168), Inode bitmap at 8362 (+169) + Inode table at 8193-8256 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8257-8360, 8363-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9221 + Reserved GDT blocks at 9222-9477 + Block bitmap at 9659 (+442), Inode bitmap at 9660 (+443) + Inode table at 9478-9541 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 9542-9658, 9661-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10435 (+194), Inode bitmap at 10436 (+195) + Inode table at 10241-10304 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10305-10434, 10437-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11472 (+207), Inode bitmap at 11473 (+208) + Inode table at 11265-11328 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11329-11471, 11474-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12509 (+220), Inode bitmap at 12510 (+221) + Inode table at 12289-12352 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12353-12508, 12511-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13546 (+233), Inode bitmap at 13547 (+234) + Inode table at 13313-13376 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13377-13545, 13548-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14583 (+246), Inode bitmap at 14584 (+247) + Inode table at 14337-14400 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14401-14582, 14585-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16384) + Block bitmap at 15620 (+259), Inode bitmap at 15621 (+260) + Inode table at 15361-15424 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 15425-15619, 15622-16384 + Free inodes: 3841-4096 +Group 16: (Blocks 16385-17408) + Block bitmap at 16657 (+272), Inode bitmap at 16658 (+273) + Inode table at 16385-16448 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 16449-16656, 16659-17408 + Free inodes: 4097-4352 +Group 17: (Blocks 17409-18432) + Block bitmap at 17694 (+285), Inode bitmap at 17695 (+286) + Inode table at 17409-17472 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 17473-17693, 17696-18432 + Free inodes: 4353-4608 +Group 18: (Blocks 18433-19456) + Block bitmap at 18731 (+298), Inode bitmap at 18732 (+299) + Inode table at 18433-18496 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 18497-18730, 18733-19456 + Free inodes: 4609-4864 +Group 19: (Blocks 19457-20480) + Block bitmap at 19768 (+311), Inode bitmap at 19769 (+312) + Inode table at 19457-19520 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 19521-19767, 19770-20480 + Free inodes: 4865-5120 +Group 20: (Blocks 20481-21504) + Block bitmap at 20805 (+324), Inode bitmap at 20806 (+325) + Inode table at 20481-20544 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 20545-20804, 20807-21504 + Free inodes: 5121-5376 +Group 21: (Blocks 21505-22528) + Block bitmap at 21842 (+337), Inode bitmap at 21843 (+338) + Inode table at 21505-21568 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 21569-21841, 21844-22528 + Free inodes: 5377-5632 +Group 22: (Blocks 22529-23552) + Block bitmap at 22879 (+350), Inode bitmap at 22880 (+351) + Inode table at 22529-22592 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 22593-22878, 22881-23552 + Free inodes: 5633-5888 +Group 23: (Blocks 23553-24576) + Block bitmap at 23916 (+363), Inode bitmap at 23917 (+364) + Inode table at 23553-23616 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 23617-23915, 23918-24576 + Free inodes: 5889-6144 +Group 24: (Blocks 24577-25600) + Block bitmap at 24953 (+376), Inode bitmap at 24954 (+377) + Inode table at 24577-24640 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 24641-24952, 24955-25600 + Free inodes: 6145-6400 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601, Group descriptors at 25602-25605 + Reserved GDT blocks at 25606-25861 + Block bitmap at 26251 (+650), Inode bitmap at 26252 (+651) + Inode table at 25862-25925 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 25926-26250, 26253-26624 + Free inodes: 6401-6656 +Group 26: (Blocks 26625-27648) + Block bitmap at 27027 (+402), Inode bitmap at 27028 (+403) + Inode table at 26625-26688 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 26689-27026, 27029-27648 + Free inodes: 6657-6912 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649, Group descriptors at 27650-27653 + Reserved GDT blocks at 27654-27909 + Block bitmap at 28325 (+676), Inode bitmap at 28326 (+677) + Inode table at 27910-27973 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 27974-28324, 28327-28672 + Free inodes: 6913-7168 +Group 28: (Blocks 28673-29696) + Block bitmap at 29101 (+428), Inode bitmap at 29102 (+429) + Inode table at 28673-28736 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 28737-29100, 29103-29696 + Free inodes: 7169-7424 +Group 29: (Blocks 29697-30720) + Block bitmap at 30138 (+441), Inode bitmap at 30139 (+442) + Inode table at 29697-29760 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 29761-30137, 30140-30720 + Free inodes: 7425-7680 +Group 30: (Blocks 30721-31744) + Block bitmap at 31175 (+454), Inode bitmap at 31176 (+455) + Inode table at 30721-30784 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 30785-31174, 31177-31744 + Free inodes: 7681-7936 +Group 31: (Blocks 31745-32768) + Block bitmap at 32212 (+467), Inode bitmap at 32213 (+468) + Inode table at 31745-31808 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 31809-32211, 32214-32768 + Free inodes: 7937-8192 +Group 32: (Blocks 32769-33792) + Block bitmap at 33249 (+480), Inode bitmap at 33250 (+481) + Inode table at 32769-32832 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 32833-33248, 33251-33792 + Free inodes: 8193-8448 +Group 33: (Blocks 33793-34816) + Block bitmap at 34286 (+493), Inode bitmap at 34287 (+494) + Inode table at 33793-33856 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 33857-34285, 34288-34816 + Free inodes: 8449-8704 +Group 34: (Blocks 34817-35840) + Block bitmap at 35323 (+506), Inode bitmap at 35324 (+507) + Inode table at 34817-34880 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 34881-35322, 35325-35840 + Free inodes: 8705-8960 +Group 35: (Blocks 35841-36864) + Block bitmap at 36360 (+519), Inode bitmap at 36361 (+520) + Inode table at 35841-35904 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 35905-36359, 36362-36864 + Free inodes: 8961-9216 +Group 36: (Blocks 36865-37888) + Block bitmap at 37397 (+532), Inode bitmap at 37398 (+533) + Inode table at 36865-36928 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 36929-37396, 37399-37888 + Free inodes: 9217-9472 +Group 37: (Blocks 37889-38912) + Block bitmap at 38434 (+545), Inode bitmap at 38435 (+546) + Inode table at 37889-37952 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 37953-38433, 38436-38912 + Free inodes: 9473-9728 +Group 38: (Blocks 38913-39936) + Block bitmap at 39471 (+558), Inode bitmap at 39472 (+559) + Inode table at 38913-38976 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 38977-39470, 39473-39936 + Free inodes: 9729-9984 +Group 39: (Blocks 39937-40960) + Block bitmap at 40508 (+571), Inode bitmap at 40509 (+572) + Inode table at 39937-40000 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 40001-40507, 40510-40960 + Free inodes: 9985-10240 +Group 40: (Blocks 40961-41984) + Block bitmap at 41545 (+584), Inode bitmap at 41546 (+585) + Inode table at 40961-41024 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 41025-41544, 41547-41984 + Free inodes: 10241-10496 +Group 41: (Blocks 41985-43008) + Block bitmap at 42582 (+597), Inode bitmap at 42583 (+598) + Inode table at 41985-42048 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 42049-42581, 42584-43008 + Free inodes: 10497-10752 +Group 42: (Blocks 43009-44032) + Block bitmap at 43619 (+610), Inode bitmap at 43620 (+611) + Inode table at 43009-43072 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 43073-43618, 43621-44032 + Free inodes: 10753-11008 +Group 43: (Blocks 44033-45056) + Block bitmap at 44656 (+623), Inode bitmap at 44657 (+624) + Inode table at 44033-44096 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 44097-44655, 44658-45056 + Free inodes: 11009-11264 +Group 44: (Blocks 45057-46080) + Block bitmap at 45693 (+636), Inode bitmap at 45694 (+637) + Inode table at 45057-45120 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 45121-45692, 45695-46080 + Free inodes: 11265-11520 +Group 45: (Blocks 46081-47104) + Block bitmap at 46730 (+649), Inode bitmap at 46731 (+650) + Inode table at 46081-46144 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 46145-46729, 46732-47104 + Free inodes: 11521-11776 +Group 46: (Blocks 47105-48128) + Block bitmap at 47767 (+662), Inode bitmap at 47768 (+663) + Inode table at 47105-47168 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 47169-47766, 47769-48128 + Free inodes: 11777-12032 +Group 47: (Blocks 48129-49152) + Block bitmap at 48804 (+675), Inode bitmap at 48805 (+676) + Inode table at 48129-48192 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 48193-48803, 48806-49152 + Free inodes: 12033-12288 +Group 48: (Blocks 49153-50176) + Block bitmap at 49841 (+688), Inode bitmap at 49842 (+689) + Inode table at 49153-49216 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 49217-49840, 49843-50176 + Free inodes: 12289-12544 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177, Group descriptors at 50178-50181 + Reserved GDT blocks at 50182-50437 + Block bitmap at 51139 (+962), Inode bitmap at 51140 (+963) + Inode table at 50438-50501 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 50502-51138, 51141-51200 + Free inodes: 12545-12800 +Group 50: (Blocks 51201-52224) + Block bitmap at 51915 (+714), Inode bitmap at 51916 (+715) + Inode table at 51201-51264 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 51265-51914, 51917-52224 + Free inodes: 12801-13056 +Group 51: (Blocks 52225-53248) + Block bitmap at 52952 (+727), Inode bitmap at 52953 (+728) + Inode table at 52225-52288 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 52289-52951, 52954-53248 + Free inodes: 13057-13312 +Group 52: (Blocks 53249-54272) + Block bitmap at 53989 (+740), Inode bitmap at 53990 (+741) + Inode table at 53249-53312 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 53313-53988, 53991-54272 + Free inodes: 13313-13568 +Group 53: (Blocks 54273-55296) + Block bitmap at 55026 (+753), Inode bitmap at 55027 (+754) + Inode table at 54273-54336 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 54337-55025, 55028-55296 + Free inodes: 13569-13824 +Group 54: (Blocks 55297-56320) + Block bitmap at 56063 (+766), Inode bitmap at 56064 (+767) + Inode table at 55297-55360 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 55361-56062, 56065-56320 + Free inodes: 13825-14080 +Group 55: (Blocks 56321-57344) + Block bitmap at 57100 (+779), Inode bitmap at 57101 (+780) + Inode table at 56321-56384 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 56385-57099, 57102-57344 + Free inodes: 14081-14336 +Group 56: (Blocks 57345-58368) + Block bitmap at 58137 (+792), Inode bitmap at 58138 (+793) + Inode table at 57345-57408 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 57409-58136, 58139-58368 + Free inodes: 14337-14592 +Group 57: (Blocks 58369-59392) + Block bitmap at 59174 (+805), Inode bitmap at 59175 (+806) + Inode table at 58369-58432 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 58433-59173, 59176-59392 + Free inodes: 14593-14848 +Group 58: (Blocks 59393-60416) + Block bitmap at 60211 (+818), Inode bitmap at 60212 (+819) + Inode table at 59393-59456 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 59457-60210, 60213-60416 + Free inodes: 14849-15104 +Group 59: (Blocks 60417-61440) + Block bitmap at 61248 (+831), Inode bitmap at 61249 (+832) + Inode table at 60417-60480 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 60481-61247, 61250-61440 + Free inodes: 15105-15360 +Group 60: (Blocks 61441-62464) + Block bitmap at 62285 (+844), Inode bitmap at 62286 (+845) + Inode table at 61441-61504 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 61505-62284, 62287-62464 + Free inodes: 15361-15616 +Group 61: (Blocks 62465-63488) + Block bitmap at 63322 (+857), Inode bitmap at 63323 (+858) + Inode table at 62465-62528 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 62529-63321, 63324-63488 + Free inodes: 15617-15872 +Group 62: (Blocks 63489-64512) + Block bitmap at 64359 (+870), Inode bitmap at 64360 (+871) + Inode table at 63489-63552 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 63553-64358, 64361-64512 + Free inodes: 15873-16128 +Group 63: (Blocks 64513-65536) + Block bitmap at 65396 (+883), Inode bitmap at 65397 (+884) + Inode table at 64513-64576 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 64577-65395, 65398-65536 + Free inodes: 16129-16384 +Group 64: (Blocks 65537-66560) + Block bitmap at 66433 (+896), Inode bitmap at 66434 (+897) + Inode table at 65537-65600 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 65601-66432, 66435-66560 + Free inodes: 16385-16640 +Group 65: (Blocks 66561-67584) + Block bitmap at 67470 (+909), Inode bitmap at 67471 (+910) + Inode table at 66561-66624 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 66625-67469, 67472-67584 + Free inodes: 16641-16896 +Group 66: (Blocks 67585-68608) + Block bitmap at 68507 (+922), Inode bitmap at 68508 (+923) + Inode table at 67585-67648 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 67649-68506, 68509-68608 + Free inodes: 16897-17152 +Group 67: (Blocks 68609-69632) + Block bitmap at 69544 (+935), Inode bitmap at 69545 (+936) + Inode table at 68609-68672 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 68673-69543, 69546-69632 + Free inodes: 17153-17408 +Group 68: (Blocks 69633-70656) + Block bitmap at 70581 (+948), Inode bitmap at 70582 (+949) + Inode table at 69633-69696 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 69697-70580, 70583-70656 + Free inodes: 17409-17664 +Group 69: (Blocks 70657-71680) + Block bitmap at 71618 (+961), Inode bitmap at 71619 (+962) + Inode table at 70657-70720 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 70721-71617, 71620-71680 + Free inodes: 17665-17920 +Group 70: (Blocks 71681-72704) + Block bitmap at 72655 (+974), Inode bitmap at 72656 (+975) + Inode table at 71681-71744 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 71745-72654, 72657-72704 + Free inodes: 17921-18176 +Group 71: (Blocks 72705-73728) + Block bitmap at 73692 (+987), Inode bitmap at 73693 (+988) + Inode table at 72705-72768 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 72769-73691, 73694-73728 + Free inodes: 18177-18432 +Group 72: (Blocks 73729-74752) + Block bitmap at 74729 (+1000), Inode bitmap at 74730 (+1001) + Inode table at 73729-73792 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 73793-74728, 74731-74752 + Free inodes: 18433-18688 +Group 73: (Blocks 74753-75776) + Block bitmap at 75766 (+1013), Inode bitmap at 75767 (+1014) + Inode table at 74753-74816 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 74817-75765, 75768-75776 + Free inodes: 18689-18944 +Group 74: (Blocks 75777-76800) + Block bitmap at 75843 (+66), Inode bitmap at 75844 (+67) + Inode table at 75777-75840 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 75841-75842, 75845-76800 + Free inodes: 18945-19200 +Group 75: (Blocks 76801-77824) + Block bitmap at 76880 (+79), Inode bitmap at 76881 (+80) + Inode table at 76801-76864 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 76865-76879, 76882-77824 + Free inodes: 19201-19456 +Group 76: (Blocks 77825-78848) + Block bitmap at 77917 (+92), Inode bitmap at 77918 (+93) + Inode table at 77825-77888 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 77889-77916, 77919-78848 + Free inodes: 19457-19712 +Group 77: (Blocks 78849-79872) + Block bitmap at 78954 (+105), Inode bitmap at 78955 (+106) + Inode table at 78849-78912 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 78913-78953, 78956-79872 + Free inodes: 19713-19968 +Group 78: (Blocks 79873-80896) + Block bitmap at 79991 (+118), Inode bitmap at 79992 (+119) + Inode table at 79873-79936 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 79937-79990, 79993-80896 + Free inodes: 19969-20224 +Group 79: (Blocks 80897-81920) + Block bitmap at 81028 (+131), Inode bitmap at 81029 (+132) + Inode table at 80897-80960 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 80961-81027, 81030-81920 + Free inodes: 20225-20480 +Group 80: (Blocks 81921-82944) + Block bitmap at 82065 (+144), Inode bitmap at 82066 (+145) + Inode table at 81921-81984 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 81985-82064, 82067-82944 + Free inodes: 20481-20736 +Group 81: (Blocks 82945-83968) + Backup superblock at 82945, Group descriptors at 82946-82949 + Reserved GDT blocks at 82950-83205 + Block bitmap at 83624 (+679), Inode bitmap at 83625 (+680) + Inode table at 83206-83269 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 83270-83623, 83626-83968 + Free inodes: 20737-20992 +Group 82: (Blocks 83969-84992) + Block bitmap at 84139 (+170), Inode bitmap at 84140 (+171) + Inode table at 83969-84032 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 84033-84138, 84141-84992 + Free inodes: 20993-21248 +Group 83: (Blocks 84993-86016) + Block bitmap at 85176 (+183), Inode bitmap at 85177 (+184) + Inode table at 84993-85056 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 85057-85175, 85178-86016 + Free inodes: 21249-21504 +Group 84: (Blocks 86017-87040) + Block bitmap at 86213 (+196), Inode bitmap at 86214 (+197) + Inode table at 86017-86080 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 86081-86212, 86215-87040 + Free inodes: 21505-21760 +Group 85: (Blocks 87041-88064) + Block bitmap at 87250 (+209), Inode bitmap at 87251 (+210) + Inode table at 87041-87104 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 87105-87249, 87252-88064 + Free inodes: 21761-22016 +Group 86: (Blocks 88065-89088) + Block bitmap at 88287 (+222), Inode bitmap at 88288 (+223) + Inode table at 88065-88128 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 88129-88286, 88289-89088 + Free inodes: 22017-22272 +Group 87: (Blocks 89089-90112) + Block bitmap at 89324 (+235), Inode bitmap at 89325 (+236) + Inode table at 89089-89152 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 89153-89323, 89326-90112 + Free inodes: 22273-22528 +Group 88: (Blocks 90113-91136) + Block bitmap at 90361 (+248), Inode bitmap at 90362 (+249) + Inode table at 90113-90176 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 90177-90360, 90363-91136 + Free inodes: 22529-22784 +Group 89: (Blocks 91137-92160) + Block bitmap at 91398 (+261), Inode bitmap at 91399 (+262) + Inode table at 91137-91200 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 91201-91397, 91400-92160 + Free inodes: 22785-23040 +Group 90: (Blocks 92161-93184) + Block bitmap at 92435 (+274), Inode bitmap at 92436 (+275) + Inode table at 92161-92224 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 92225-92434, 92437-93184 + Free inodes: 23041-23296 +Group 91: (Blocks 93185-94208) + Block bitmap at 93472 (+287), Inode bitmap at 93473 (+288) + Inode table at 93185-93248 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 93249-93471, 93474-94208 + Free inodes: 23297-23552 +Group 92: (Blocks 94209-95232) + Block bitmap at 94509 (+300), Inode bitmap at 94510 (+301) + Inode table at 94209-94272 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 94273-94508, 94511-95232 + Free inodes: 23553-23808 +Group 93: (Blocks 95233-96256) + Block bitmap at 95546 (+313), Inode bitmap at 95547 (+314) + Inode table at 95233-95296 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 95297-95545, 95548-96256 + Free inodes: 23809-24064 +Group 94: (Blocks 96257-97280) + Block bitmap at 96583 (+326), Inode bitmap at 96584 (+327) + Inode table at 96257-96320 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 96321-96582, 96585-97280 + Free inodes: 24065-24320 +Group 95: (Blocks 97281-98304) + Block bitmap at 97620 (+339), Inode bitmap at 97621 (+340) + Inode table at 97281-97344 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 97345-97619, 97622-98304 + Free inodes: 24321-24576 +Group 96: (Blocks 98305-99328) + Block bitmap at 98657 (+352), Inode bitmap at 98658 (+353) + Inode table at 98305-98368 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 98369-98656, 98659-99328 + Free inodes: 24577-24832 +Group 97: (Blocks 99329-100352) + Block bitmap at 99694 (+365), Inode bitmap at 99695 (+366) + Inode table at 99329-99392 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 99393-99693, 99696-100352 + Free inodes: 24833-25088 +Group 98: (Blocks 100353-101376) + Block bitmap at 100731 (+378), Inode bitmap at 100732 (+379) + Inode table at 100353-100416 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 100417-100730, 100733-101376 + Free inodes: 25089-25344 +Group 99: (Blocks 101377-102400) + Block bitmap at 101768 (+391), Inode bitmap at 101769 (+392) + Inode table at 101377-101440 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 101441-101767, 101770-102400 + Free inodes: 25345-25600 +Group 100: (Blocks 102401-103424) + Block bitmap at 102805 (+404), Inode bitmap at 102806 (+405) + Inode table at 102401-102464 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 102465-102804, 102807-103424 + Free inodes: 25601-25856 +Group 101: (Blocks 103425-104448) + Block bitmap at 103842 (+417), Inode bitmap at 103843 (+418) + Inode table at 103425-103488 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 103489-103841, 103844-104448 + Free inodes: 25857-26112 +Group 102: (Blocks 104449-105472) + Block bitmap at 104879 (+430), Inode bitmap at 104880 (+431) + Inode table at 104449-104512 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 104513-104878, 104881-105472 + Free inodes: 26113-26368 +Group 103: (Blocks 105473-106496) + Block bitmap at 105916 (+443), Inode bitmap at 105917 (+444) + Inode table at 105473-105536 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 105537-105915, 105918-106496 + Free inodes: 26369-26624 +Group 104: (Blocks 106497-107520) + Block bitmap at 106953 (+456), Inode bitmap at 106954 (+457) + Inode table at 106497-106560 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 106561-106952, 106955-107520 + Free inodes: 26625-26880 +Group 105: (Blocks 107521-108544) + Block bitmap at 107990 (+469), Inode bitmap at 107991 (+470) + Inode table at 107521-107584 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 107585-107989, 107992-108544 + Free inodes: 26881-27136 +Group 106: (Blocks 108545-109568) + Block bitmap at 109027 (+482), Inode bitmap at 109028 (+483) + Inode table at 108545-108608 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 108609-109026, 109029-109568 + Free inodes: 27137-27392 +Group 107: (Blocks 109569-110592) + Block bitmap at 110064 (+495), Inode bitmap at 110065 (+496) + Inode table at 109569-109632 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 109633-110063, 110066-110592 + Free inodes: 27393-27648 +Group 108: (Blocks 110593-111616) + Block bitmap at 111101 (+508), Inode bitmap at 111102 (+509) + Inode table at 110593-110656 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 110657-111100, 111103-111616 + Free inodes: 27649-27904 +Group 109: (Blocks 111617-112640) + Block bitmap at 112138 (+521), Inode bitmap at 112139 (+522) + Inode table at 111617-111680 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 111681-112137, 112140-112640 + Free inodes: 27905-28160 +Group 110: (Blocks 112641-113664) + Block bitmap at 113175 (+534), Inode bitmap at 113176 (+535) + Inode table at 112641-112704 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 112705-113174, 113177-113664 + Free inodes: 28161-28416 +Group 111: (Blocks 113665-114688) + Block bitmap at 114212 (+547), Inode bitmap at 114213 (+548) + Inode table at 113665-113728 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 113729-114211, 114214-114688 + Free inodes: 28417-28672 +Group 112: (Blocks 114689-115712) + Block bitmap at 115249 (+560), Inode bitmap at 115250 (+561) + Inode table at 114689-114752 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 114753-115248, 115251-115712 + Free inodes: 28673-28928 +Group 113: (Blocks 115713-116736) + Block bitmap at 116286 (+573), Inode bitmap at 116287 (+574) + Inode table at 115713-115776 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 115777-116285, 116288-116736 + Free inodes: 28929-29184 +Group 114: (Blocks 116737-117760) + Block bitmap at 117323 (+586), Inode bitmap at 117324 (+587) + Inode table at 116737-116800 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 116801-117322, 117325-117760 + Free inodes: 29185-29440 +Group 115: (Blocks 117761-118784) + Block bitmap at 118360 (+599), Inode bitmap at 118361 (+600) + Inode table at 117761-117824 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 117825-118359, 118362-118784 + Free inodes: 29441-29696 +Group 116: (Blocks 118785-119808) + Block bitmap at 119397 (+612), Inode bitmap at 119398 (+613) + Inode table at 118785-118848 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 118849-119396, 119399-119808 + Free inodes: 29697-29952 +Group 117: (Blocks 119809-120832) + Block bitmap at 120434 (+625), Inode bitmap at 120435 (+626) + Inode table at 119809-119872 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 119873-120433, 120436-120832 + Free inodes: 29953-30208 +Group 118: (Blocks 120833-121856) + Block bitmap at 121471 (+638), Inode bitmap at 121472 (+639) + Inode table at 120833-120896 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 120897-121470, 121473-121856 + Free inodes: 30209-30464 +Group 119: (Blocks 121857-122880) + Block bitmap at 122508 (+651), Inode bitmap at 122509 (+652) + Inode table at 121857-121920 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 121921-122507, 122510-122880 + Free inodes: 30465-30720 +Group 120: (Blocks 122881-123904) + Block bitmap at 123545 (+664), Inode bitmap at 123546 (+665) + Inode table at 122881-122944 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 122945-123544, 123547-123904 + Free inodes: 30721-30976 +Group 121: (Blocks 123905-124928) + Block bitmap at 124582 (+677), Inode bitmap at 124583 (+678) + Inode table at 123905-123968 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 123969-124581, 124584-124928 + Free inodes: 30977-31232 +Group 122: (Blocks 124929-125952) + Block bitmap at 125619 (+690), Inode bitmap at 125620 (+691) + Inode table at 124929-124992 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 124993-125618, 125621-125952 + Free inodes: 31233-31488 +Group 123: (Blocks 125953-126976) + Block bitmap at 126656 (+703), Inode bitmap at 126657 (+704) + Inode table at 125953-126016 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 126017-126655, 126658-126976 + Free inodes: 31489-31744 +Group 124: (Blocks 126977-128000) + Block bitmap at 127693 (+716), Inode bitmap at 127694 (+717) + Inode table at 126977-127040 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 127041-127692, 127695-128000 + Free inodes: 31745-32000 +Group 125: (Blocks 128001-129024) + Backup superblock at 128001, Group descriptors at 128002-128005 + Reserved GDT blocks at 128006-128261 + Block bitmap at 128553 (+552), Inode bitmap at 128554 (+553) + Inode table at 128262-128325 (+261) + 697 free blocks, 256 free inodes, 0 directories + Free blocks: 128326-128552, 128555-129024 + Free inodes: 32001-32256 +Group 126: (Blocks 129025-130048) + Block bitmap at 129767 (+742), Inode bitmap at 129768 (+743) + Inode table at 129025-129088 + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 129089-129766, 129769-130048 + Free inodes: 32257-32512 +Group 127: (Blocks 130049-131071) + Block bitmap at 130805 (+756), Inode bitmap at 130806 (+757) + Inode table at 130049-130112 + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 130113-130804, 130807-131071 + Free inodes: 32513-32768 diff --git a/tests/m_raid_opt/script b/tests/m_raid_opt/script new file mode 100644 index 0000000..8c859e0 --- /dev/null +++ b/tests/m_raid_opt/script @@ -0,0 +1,7 @@ +DESCRIPTION="raid options" +FS_SIZE=131072 +MKE2FS_OPTS="-E stride=13 -O sparse_super -g 1024" +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_resize_inode_meta_bg/expect.1 b/tests/m_resize_inode_meta_bg/expect.1 new file mode 100644 index 0000000..7feaed9 --- /dev/null +++ b/tests/m_resize_inode_meta_bg/expect.1 @@ -0,0 +1,172 @@ +Creating filesystem with 3840 4k blocks and 960 inodes +Superblock backups stored on blocks: + 256, 768, 1280, 1792, 2304 + +Allocating group tables: done +Writing inode tables: done +Creating journal (1024 blocks): done +Writing superblocks and filesystem accounting information: done + +Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +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: 11/960 files (0.0% non-contiguous), 1127/3840 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 960 +Block count: 3840 +Reserved block count: 192 +Overhead clusters: 1122 +Free blocks: 2713 +Free inodes: 949 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Group descriptor size: 64 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 64 +Inode blocks per group: 4 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 4096k +Total journal blocks: 1024 +Max transaction length: 1024 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + + +Group 0: (Blocks 0-255) [ITABLE_ZEROED] + Primary superblock at 0, Group descriptor at 1 + Block bitmap at 2 (+2) + Inode bitmap at 17 (+17) + Inode table at 32-35 (+32) + 159 free blocks, 53 free inodes, 2 directories, 53 unused inodes + Free blocks: 97-255 + Free inodes: 12-64 +Group 1: (Blocks 256-511) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 256, Group descriptor at 257 + Block bitmap at 3 (bg #0 + 3) + Inode bitmap at 18 (bg #0 + 18) + Inode table at 36-39 (bg #0 + 36) + 254 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 258-511 + Free inodes: 65-128 +Group 2: (Blocks 512-767) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 4 (bg #0 + 4) + Inode bitmap at 19 (bg #0 + 19) + Inode table at 40-43 (bg #0 + 40) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 512-767 + Free inodes: 129-192 +Group 3: (Blocks 768-1023) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 768 + Block bitmap at 5 (bg #0 + 5) + Inode bitmap at 20 (bg #0 + 20) + Inode table at 44-47 (bg #0 + 44) + 255 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 769-1023 + Free inodes: 193-256 +Group 4: (Blocks 1024-1279) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 6 (bg #0 + 6) + Inode bitmap at 21 (bg #0 + 21) + Inode table at 48-51 (bg #0 + 48) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 1024-1279 + Free inodes: 257-320 +Group 5: (Blocks 1280-1535) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 1280 + Block bitmap at 7 (bg #0 + 7) + Inode bitmap at 22 (bg #0 + 22) + Inode table at 52-55 (bg #0 + 52) + 255 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 1281-1535 + Free inodes: 321-384 +Group 6: (Blocks 1536-1791) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 8 (bg #0 + 8) + Inode bitmap at 23 (bg #0 + 23) + Inode table at 56-59 (bg #0 + 56) + 0 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: + Free inodes: 385-448 +Group 7: (Blocks 1792-2047) [INODE_UNINIT, ITABLE_ZEROED] + Backup superblock at 1792 + Block bitmap at 9 (bg #0 + 9) + Inode bitmap at 24 (bg #0 + 24) + Inode table at 60-63 (bg #0 + 60) + 0 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: + Free inodes: 449-512 +Group 8: (Blocks 2048-2303) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 10 (bg #0 + 10) + Inode bitmap at 25 (bg #0 + 25) + Inode table at 64-67 (bg #0 + 64) + 0 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: + Free inodes: 513-576 +Group 9: (Blocks 2304-2559) [INODE_UNINIT, ITABLE_ZEROED] + Backup superblock at 2304 + Block bitmap at 11 (bg #0 + 11) + Inode bitmap at 26 (bg #0 + 26) + Inode table at 68-71 (bg #0 + 68) + 0 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: + Free inodes: 577-640 +Group 10: (Blocks 2560-2815) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 12 (bg #0 + 12) + Inode bitmap at 27 (bg #0 + 27) + Inode table at 72-75 (bg #0 + 72) + 254 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 2562-2815 + Free inodes: 641-704 +Group 11: (Blocks 2816-3071) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 13 (bg #0 + 13) + Inode bitmap at 28 (bg #0 + 28) + Inode table at 76-79 (bg #0 + 76) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 2816-3071 + Free inodes: 705-768 +Group 12: (Blocks 3072-3327) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 14 (bg #0 + 14) + Inode bitmap at 29 (bg #0 + 29) + Inode table at 80-83 (bg #0 + 80) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 3072-3327 + Free inodes: 769-832 +Group 13: (Blocks 3328-3583) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 15 (bg #0 + 15) + Inode bitmap at 30 (bg #0 + 30) + Inode table at 84-87 (bg #0 + 84) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 3328-3583 + Free inodes: 833-896 +Group 14: (Blocks 3584-3839) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 16 (bg #0 + 16) + Inode bitmap at 31 (bg #0 + 31) + Inode table at 88-91 (bg #0 + 88) + 256 free blocks, 64 free inodes, 0 directories, 64 unused inodes + Free blocks: 3584-3839 + Free inodes: 897-960 diff --git a/tests/m_resize_inode_meta_bg/script b/tests/m_resize_inode_meta_bg/script new file mode 100644 index 0000000..41ffb32 --- /dev/null +++ b/tests/m_resize_inode_meta_bg/script @@ -0,0 +1,7 @@ +DESCRIPTION="resize_inode and meta_bg enabled" +FS_SIZE=15360 +MKE2FS_DEVICE_SECTSIZE=4096 +export MKE2FS_DEVICE_SECTSIZE +MKE2FS_OPTS="-T ext4 -g256 -O 64bit" +. $cmd_dir/run_mke2fs +unset MKE2FS_DEVICE_SECTSIZE diff --git a/tests/m_root_owner/expect.1 b/tests/m_root_owner/expect.1 new file mode 100644 index 0000000..3b9e3ee --- /dev/null +++ b/tests/m_root_owner/expect.1 @@ -0,0 +1,57 @@ +Creating filesystem with 1024 1k blocks and 128 inodes + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +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: 11/128 files (0.0% non-contiguous), 54/1024 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 128 +Block count: 1024 +Reserved block count: 51 +Overhead clusters: 40 +Free blocks: 970 +Free inodes: 117 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 3 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 128 +Inode blocks per group: 32 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1023) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-5 + Block bitmap at 6 (+5) + Inode bitmap at 7 (+6) + Inode table at 8-39 (+7) + 970 free blocks, 117 free inodes, 2 directories + Free blocks: 54-1023 + Free inodes: 12-128 diff --git a/tests/m_root_owner/script b/tests/m_root_owner/script new file mode 100644 index 0000000..02c5ef6 --- /dev/null +++ b/tests/m_root_owner/script @@ -0,0 +1,4 @@ +DESCRIPTION="root directory owner" +FS_SIZE=1024 +MKE2FS_OPTS="-E root_owner=1234:1234" +. $cmd_dir/run_mke2fs diff --git a/tests/m_rootdir/expect b/tests/m_rootdir/expect new file mode 100644 index 0000000..dbc7977 --- /dev/null +++ b/tests/m_rootdir/expect @@ -0,0 +1,120 @@ +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super huge_file dir_nlink extra_isize metadata_csum +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 1024 +Block count: 16384 +Reserved block count: 819 +Overhead clusters: 1543 +Free blocks: 14786 +Free inodes: 1005 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Reserved GDT blocks: 127 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 512 +Inode blocks per group: 128 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Checksum type: crc32c +Journal features: (none) +Total journal size: 1024k +Total journal blocks: 1024 +Max transaction length: 1024 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-129 + Block bitmap at 130 (+129) + Inode bitmap at 132 (+131) + Inode table at 134-261 (+133) + 7748 free blocks, 493 free inodes, 4 directories, 493 unused inodes + Free blocks: 445-8192 + Free inodes: 20-512 +Group 1: (Blocks 8193-16383) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8321 + Block bitmap at 131 (bg #0 + 130) + Inode bitmap at 133 (bg #0 + 132) + Inode table at 262-389 (bg #0 + 261) + 7038 free blocks, 512 free inodes, 0 directories, 512 unused inodes + Free blocks: 9346-16383 + Free inodes: 513-1024 +debugfs: stat /emptyfile +Inode: III Type: regular +Size: 0 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigfile +Inode: III Type: regular +Size: 32768 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /sparsefile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigzerofile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /fifo +debugfs: stat /emptydir +Inode: III Type: directory +Size: 1024 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir +Inode: III Type: directory +Size: 1024 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir/file +Inode: III Type: regular +Size: 8 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: ex /emptyfile +Level Entries Logical Physical Length Flags +debugfs: ex /bigfile +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-31 AAA-BBB 32 +debugfs: ex /sparsefile +Level Entries Logical Physical Length Flags +Y 0/1 1/1 1-1048576 AAA 1048576 +X 1/1 1/5 1-1 AAA-BBB 1 +X 1/1 2/5 512-512 AAA-BBB 1 +X 1/1 3/5 1024-1024 AAA-BBB 1 +X 1/1 4/5 524288-524288 AAA-BBB 1 +X 1/1 5/5 1048576-1048576 AAA-BBB 1 +debugfs: ex /bigzerofile +Level Entries Logical Physical Length Flags +debugfs: ex /dir +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-0 AAA-BBB 1 +debugfs: ex /dir/file +Level Entries Logical Physical Length Flags +X 0/0 1/1 0-0 AAA-BBB 1 +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.img: 19/1024 files (0.0% non-contiguous), 1598/16384 blocks diff --git a/tests/m_rootdir/output.sed b/tests/m_rootdir/output.sed new file mode 100644 index 0000000..2e76967 --- /dev/null +++ b/tests/m_rootdir/output.sed @@ -0,0 +1,5 @@ +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*-[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/X \1\/\2 \3\/\4 \5-\6 AAA-BBB \7/g +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/Y \1\/\2 \3\/\4 \5-\6 AAA \7/g +s/Mode:.*$//g +s/User:.*Size:/Size:/g +s/^Inode: [0-9]*/Inode: III/g diff --git a/tests/m_rootdir/script b/tests/m_rootdir/script new file mode 100644 index 0000000..2e54ae1 --- /dev/null +++ b/tests/m_rootdir/script @@ -0,0 +1,70 @@ +test_description="create fs image from dir" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +MKFS_DIR=$TMPFILE.dir +OUT=$test_name.log +EXP=$test_dir/expect + +rm -rf $MKFS_DIR +mkdir -p $MKFS_DIR +touch $MKFS_DIR/emptyfile +dd if=/dev/zero bs=1024 count=32 2> /dev/null | tr '\0' 'a' > $MKFS_DIR/bigfile +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1024 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=524288 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1048576 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=536870912 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1073741824 conv=notrunc 2> /dev/null +dd if=/dev/zero of=$MKFS_DIR/bigzerofile bs=1 count=1 seek=1073741824 2> /dev/null +ln $MKFS_DIR/bigzerofile $MKFS_DIR/bigzerofile_hardlink +ln -s /silly_bs_link $MKFS_DIR/silly_bs_link +mkdir $MKFS_DIR/emptydir +mkdir $MKFS_DIR/dir +echo "Test me" > $MKFS_DIR/dir/file + +$MKE2FS -q -F -o Linux -T ext4 -O metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -d $MKFS_DIR $TMPFILE 16384 > $OUT 2>&1 + +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +cat > $TMPFILE.cmd << ENDL +stat /emptyfile +stat /bigfile +stat /sparsefile +stat /bigzerofile +stat /fifo +stat /emptydir +stat /dir +stat /dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT + +cat > $TMPFILE.cmd << ENDL +ex /emptyfile +ex /bigfile +ex /sparsefile +ex /bigzerofile +ex /dir +ex /dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT 2>&1 + +$FSCK -f -n $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -f $test_dir/output.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp +mv $OUT.tmp $OUT + +# Do the verification +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm -rf $TMPFILE.cmd $MKFS_DIR +unset MKFS_DIR OUT EXP diff --git a/tests/m_rootdir_acl/expect b/tests/m_rootdir_acl/expect new file mode 100644 index 0000000..57f03e5 --- /dev/null +++ b/tests/m_rootdir_acl/expect @@ -0,0 +1,119 @@ +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg inline_data sparse_super huge_file dir_nlink extra_isize metadata_csum +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 1024 +Block count: 16384 +Reserved block count: 819 +Overhead clusters: 1799 +Free blocks: 14533 +Free inodes: 1003 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Group descriptor size: 64 +Reserved GDT blocks: 127 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 512 +Inode blocks per group: 256 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 512 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Checksum type: crc32c +Journal features: (none) +Total journal size: 1024k +Total journal blocks: 1024 +Max transaction length: 1024 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-129 + Block bitmap at 130 (+129) + Inode bitmap at 132 (+131) + Inode table at 134-389 (+133) + 7495 free blocks, 491 free inodes, 5 directories, 491 unused inodes + Free blocks: 698-8192 + Free inodes: 22-512 +Group 1: (Blocks 8193-16383) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8321 + Block bitmap at 131 (bg #0 + 130) + Inode bitmap at 133 (bg #0 + 132) + Inode table at 390-645 (bg #0 + 389) + 7038 free blocks, 512 free inodes, 0 directories, 512 unused inodes + Free blocks: 9346-16383 + Free inodes: 513-1024 +debugfs: stat /emptyfile +Inode: III Type: regular +Size: 0 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigfile +Inode: III Type: regular +Size: 32768 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /sparsefile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /bigzerofile +Inode: III Type: regular +Size: 1073741825 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /fifo +debugfs: stat /emptydir +Inode: III Type: directory +Size: 60 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir +Inode: III Type: directory +Size: 60 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /dir/file +Inode: III Type: regular +Size: 8 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /acl_dir +Inode: III Type: directory +Size: 60 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: stat /acl_dir/file +Inode: III Type: regular +Size: 10 +Fragment: Address: 0 Number: 0 Size: 0 +debugfs: ea_list dir/file +Extended attributes: + system.data (0) +debugfs: ea_list acl_dir +Extended attributes: + system.data (0) + system.posix_acl_access (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 2a 00 00 00 10 00 05 00 20 00 05 00 + system.posix_acl_default (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 04 00 00 00 10 00 05 00 20 00 05 00 +debugfs: ea_list acl_dir/file +Extended attributes: + system.data (0) + system.posix_acl_access (28) = 01 00 00 00 01 00 07 00 04 00 05 00 08 00 05 00 2a 00 00 00 10 00 05 00 20 00 05 00 +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.img: 21/1024 files (0.0% non-contiguous), 1851/16384 blocks diff --git a/tests/m_rootdir_acl/output.sed b/tests/m_rootdir_acl/output.sed new file mode 100644 index 0000000..2e76967 --- /dev/null +++ b/tests/m_rootdir_acl/output.sed @@ -0,0 +1,5 @@ +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*-[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/X \1\/\2 \3\/\4 \5-\6 AAA-BBB \7/g +s/^[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)\/[[:space:]]*\([0-9]*\)[[:space:]]*\([0-9]*\)[[:space:]]*-[[:space:]]*\([0-9]*\)[[:space:]]*[0-9]*[[:space:]]*\([0-9]*\)/Y \1\/\2 \3\/\4 \5-\6 AAA \7/g +s/Mode:.*$//g +s/User:.*Size:/Size:/g +s/^Inode: [0-9]*/Inode: III/g diff --git a/tests/m_rootdir_acl/script b/tests/m_rootdir_acl/script new file mode 100644 index 0000000..a00e4c4 --- /dev/null +++ b/tests/m_rootdir_acl/script @@ -0,0 +1,110 @@ +test_description="create fs image from dir using inline_data and acls" +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +if ! setfacl --help > /dev/null 2>&1 ; then + echo "$test_name: $test_description: skipped (no setfacl)" + return 0 +fi + +os=$(uname -s) +if [ "$os" = "GNU" ]; then + # requires Posix ACL support + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +MKFS_DIR=$(mktemp -d ./$test_name-XXXXXX.tmp) +OUT=$test_name.log +EXP=$test_dir/expect + +touch $MKFS_DIR/emptyfile +dd if=/dev/zero bs=1024 count=32 2> /dev/null | tr '\0' 'a' > $MKFS_DIR/bigfile +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1024 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=524288 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1048576 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=536870912 conv=notrunc 2> /dev/null +echo "M" | dd of=$MKFS_DIR/sparsefile bs=1 count=1 seek=1073741824 conv=notrunc 2> /dev/null +dd if=/dev/zero of=$MKFS_DIR/bigzerofile bs=1 count=1 seek=1073741824 2> /dev/null +ln $MKFS_DIR/bigzerofile $MKFS_DIR/bigzerofile_hardlink +ln -s /silly_bs_link $MKFS_DIR/silly_bs_link +mkdir $MKFS_DIR/emptydir +mkdir $MKFS_DIR/dir +echo "Test me" > $MKFS_DIR/dir/file +mkdir $MKFS_DIR/acl_dir +echo "Test me 2" > $MKFS_DIR/acl_dir/file + +setfacl --restore=- <<EOF +# file: $MKFS_DIR/acl_dir +user::rwx +group::r-x +group:42:r-x +mask::r-x +other::r-x +default:user::rwx +default:group::r-x +default:group:4:r-x +default:mask::r-x +default:other::r-x +EOF +setfacl --restore=- <<EOF +# file: $MKFS_DIR/acl_dir/file +user::rwx +group::r-x +group:42:r-x +mask::r-x +other::r-x +EOF + +if ! getfattr -d -m - $MKFS_DIR/acl_dir | grep -q posix_acl; then + echo "$test_name: $test_description: skipped (no posix_acl xattrs)" + rm -rf $MKFS_DIR + return 0 +fi + +# use 512-byte inodes so with/out security.selinux xattr doesn't fail +$MKE2FS -q -F -o Linux -T ext4 -I 512 -O metadata_csum,inline_data,64bit -E lazy_itable_init=1 -b 1024 -d $MKFS_DIR $TMPFILE 16384 > $OUT 2>&1 + +$DUMPE2FS $TMPFILE >> $OUT 2>&1 +cat > $TMPFILE.cmd << ENDL +stat /emptyfile +stat /bigfile +stat /sparsefile +stat /bigzerofile +stat /fifo +stat /emptydir +stat /dir +stat /dir/file +stat /acl_dir +stat /acl_dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep "(stat|Size:|Type:)" >> $OUT + +cat > $TMPFILE.cmd << ENDL +ea_list dir/file +ea_list acl_dir +ea_list acl_dir/file +ENDL +$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT 2>&1 + +$FSCK -f -n $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -f $test_dir/output.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp +mv $OUT.tmp $OUT + +# Do the verification +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm -rf $TMPFILE.cmd $MKFS_DIR +unset MKFS_DIR OUT EXP diff --git a/tests/m_std/expect.1 b/tests/m_std/expect.1 new file mode 100644 index 0000000..e1d1845 --- /dev/null +++ b/tests/m_std/expect.1 @@ -0,0 +1,108 @@ +Creating filesystem with 65536 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +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: 11/16384 files (0.0% non-contiguous), 5412/65536 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 5398 +Free blocks: 60124 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 255 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-257 + Block bitmap at 258 (+257), Inode bitmap at 259 (+258) + Inode table at 260-771 (+259) + 7407 free blocks, 2037 free inodes, 2 directories + Free blocks: 786-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8449 + Block bitmap at 8450 (+257), Inode bitmap at 8451 (+258) + Inode table at 8452-8963 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 8964-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16898 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 16899-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24833 + Block bitmap at 24834 (+257), Inode bitmap at 24835 (+258) + Inode table at 24836-25347 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 25348-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33282 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 33283-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41217 + Block bitmap at 41218 (+257), Inode bitmap at 41219 (+258) + Inode table at 41220-41731 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 41732-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49666 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 49667-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65535) + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57601 + Block bitmap at 57602 (+257), Inode bitmap at 57603 (+258) + Inode table at 57604-58115 (+259) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 58116-65535 + Free inodes: 14337-16384 diff --git a/tests/m_std/script b/tests/m_std/script new file mode 100644 index 0000000..61c50c7 --- /dev/null +++ b/tests/m_std/script @@ -0,0 +1,6 @@ +DESCRIPTION="standard filesystem options" +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +FS_SIZE=65536 +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/m_uninit/expect.1 b/tests/m_uninit/expect.1 new file mode 100644 index 0000000..3c28755 --- /dev/null +++ b/tests/m_uninit/expect.1 @@ -0,0 +1,158 @@ +Creating filesystem with 131072 1k blocks and 32768 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super uninit_bg +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: 11/32768 files (0.0% non-contiguous), 9787/131072 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super uninit_bg +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 131072 +Reserved block count: 6553 +Overhead clusters: 9773 +Free blocks: 121285 +Free inodes: 32757 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-8192) [ITABLE_ZEROED] + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-258 + Block bitmap at 259 (+258), Inode bitmap at 260 (+259) + Inode table at 261-772 (+260) + 7406 free blocks, 2037 free inodes, 2 directories, 2037 unused inodes + Free blocks: 787-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8450 + Block bitmap at 8451 (+258), Inode bitmap at 8452 (+259) + Inode table at 8453-8964 (+260) + 7420 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 8965-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16898 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 16899-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24834 + Block bitmap at 24835 (+258), Inode bitmap at 24836 (+259) + Inode table at 24837-25348 (+260) + 7420 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 25349-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33282 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 33283-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41218 + Block bitmap at 41219 (+258), Inode bitmap at 41220 (+259) + Inode table at 41221-41732 (+260) + 7420 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 41733-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49666 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 49667-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65536) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57602 + Block bitmap at 57603 (+258), Inode bitmap at 57604 (+259) + Inode table at 57605-58116 (+260) + 7420 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 58117-65536 + Free inodes: 14337-16384 +Group 8: (Blocks 65537-73728) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1) + Inode table at 65539-66050 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 66051-73728 + Free inodes: 16385-18432 +Group 9: (Blocks 73729-81920) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Backup superblock at 73729, Group descriptors at 73730-73730 + Reserved GDT blocks at 73731-73986 + Block bitmap at 73987 (+258), Inode bitmap at 73988 (+259) + Inode table at 73989-74500 (+260) + 7420 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 74501-81920 + Free inodes: 18433-20480 +Group 10: (Blocks 81921-90112) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-82434 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 82435-90112 + Free inodes: 20481-22528 +Group 11: (Blocks 90113-98304) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90626 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 90627-98304 + Free inodes: 22529-24576 +Group 12: (Blocks 98305-106496) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 98305 (+0), Inode bitmap at 98306 (+1) + Inode table at 98307-98818 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 98819-106496 + Free inodes: 24577-26624 +Group 13: (Blocks 106497-114688) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-107010 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 107011-114688 + Free inodes: 26625-28672 +Group 14: (Blocks 114689-122880) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-115202 (+2) + 7678 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 115203-122880 + Free inodes: 28673-30720 +Group 15: (Blocks 122881-131071) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-123394 (+2) + 7677 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes + Free blocks: 123395-131071 + Free inodes: 30721-32768 diff --git a/tests/m_uninit/script b/tests/m_uninit/script new file mode 100644 index 0000000..d4d373a --- /dev/null +++ b/tests/m_uninit/script @@ -0,0 +1,7 @@ +DESCRIPTION="uninitialized group feature" +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +FS_SIZE=131072 +MKE2FS_OPTS="-O uninit_bg" +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL diff --git a/tests/mke2fs.conf.in b/tests/mke2fs.conf.in new file mode 100644 index 0000000..9075c6c --- /dev/null +++ b/tests/mke2fs.conf.in @@ -0,0 +1,43 @@ +[defaults] + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr + blocksize = 4096 + inode_size = 256 + inode_ratio = 16384 + reserved_ratio = 5.0 + enable_periodic_fsck = true + lazy_itable_init = false + no_discard = true + default_mntopts = ^acl + creator_os = Linux + +[fs_types] + ext3 = { + features = has_journal + } + ext4 = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize + } + small = { + blocksize = 1024 + inode_ratio = 4096 + } + floppy = { + blocksize = 1024 + inode_ratio = 8192 + } + news = { + inode_ratio = 4096 + } + largefile = { + inode_ratio = 1048576 + blocksize = 4096 + } + largefile4 = { + inode_ratio = 4194304 + blocksize = 4096 + } + hurd = { + blocksize = 4096 + inode_size = 128 + warn_y2038_dates = 0 + } diff --git a/tests/progs/Makefile.in b/tests/progs/Makefile.in new file mode 100644 index 0000000..e1325c6 --- /dev/null +++ b/tests/progs/Makefile.in @@ -0,0 +1,83 @@ +# +# Standard e2fsprogs prologue.... +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +my_dir = tests/progs +INSTALL = @INSTALL@ +MKDIR_P = @MKDIR_P@ + +@MCONFIG@ + +MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir)/../../lib/ss ../../lib/ss/mk_cmds + +PROGS= test_icount crcsum + +TEST_REL_OBJS= test_rel.o test_rel_cmds.o + +TEST_ICOUNT_OBJS= test_icount.o test_icount_cmds.o + +SRCS= $(srcdir)/test_rel.c + +LIBS= $(LIBEXT2FS) $(LIBSS) $(LIBCOM_ERR) $(SYSLIBS) +DEPLIBS= $(LIBEXT2FS) $(DEPLIBSS) $(DEPLIBCOM_ERR) + +.c.o: + $(E) " CC $<" + $(Q) $(CC) -c $(ALL_CFLAGS) $< -o $@ + $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $< + $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $< + +all:: $(PROGS) + +test_rel: $(TEST_REL_OBJS) $(DEPLIBS) + $(E) " LD $@" + $(Q) $(LD) $(ALL_LDFLAGS) -o test_rel $(TEST_REL_OBJS) $(LIBS) + +crcsum: crcsum.o $(DEPLIBS) + $(E) " LD $@" + $(Q) $(LD) $(ALL_LDFLAGS) -o crcsum crcsum.o $(LIBS) + +test_rel_cmds.c: test_rel_cmds.ct + $(E) " MK_CMDS $@" + $(Q) $(MK_CMDS) $(srcdir)/test_rel_cmds.ct + +test_icount: $(TEST_ICOUNT_OBJS) $(DEPLIBS) + $(E) " LD $@" + $(Q) $(LD) $(ALL_LDFLAGS) -o test_icount $(TEST_ICOUNT_OBJS) $(LIBS) + +test_icount_cmds.c: test_icount_cmds.ct + $(E) " MK_CMDS $@" + $(Q) $(MK_CMDS) $(srcdir)/test_icount_cmds.ct + +clean:: + $(RM) -f $(PROGS) test_rel_cmds.c test_icount_cmds.c \ + \#* *.s *.o *.a *~ core + +install: + +install-strip: + +uninstall: + +mostlyclean: clean +distclean: clean + $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +test_rel.o: $(srcdir)/test_rel.c $(top_builddir)/lib/config.h \ + $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \ + $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \ + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \ + $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ + $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/irel.h \ + $(top_srcdir)/lib/ext2fs/brel.h $(srcdir)/test_rel.h diff --git a/tests/progs/crcsum.c b/tests/progs/crcsum.c new file mode 100644 index 0000000..193bf0a --- /dev/null +++ b/tests/progs/crcsum.c @@ -0,0 +1,67 @@ +/* + * crcsum.c + * + * Copyright (C) 2013 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_GETOPT_H +#include <getopt.h> +#endif +#include <fcntl.h> + +#include "et/com_err.h" +#include "ss/ss.h" +#include "ext2fs/ext2fs.h" + + +int main(int argc, char **argv) +{ + int c; + uint32_t crc = ~0; + uint32_t (*csum_func)(uint32_t crc, unsigned char const *p, + size_t len); + FILE *f; + + csum_func = ext2fs_crc32c_le; + + while ((c = getopt (argc, argv, "h")) != EOF) { + switch (c) { + case 'h': + default: + com_err(argv[0], 0, "Usage: crcsum [file]\n"); + return 1; + } + } + + if (optind == argc) + f = stdin; + else { + f = fopen(argv[optind], "r"); + if (!f) { + com_err(argv[0], errno, "while trying to open %s\n", + argv[optind]); + exit(1); + } + } + + while (!feof(f)) { + unsigned char buf[4096]; + int cnt = fread(buf, 1, sizeof(buf), f); + + if (cnt) + crc = csum_func(crc, buf, cnt); + } + printf("%u\n", crc); + return 0; +} diff --git a/tests/progs/hold_inode.c b/tests/progs/hold_inode.c new file mode 100644 index 0000000..792aa71 --- /dev/null +++ b/tests/progs/hold_inode.c @@ -0,0 +1,48 @@ +/* + * hold_inode.c --- test program which holds an inode or directory + * open. + * + * Copyright (C) 2000 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include "config.h" +#include <unistd.h> +#include <stdio.h> +#include <dirent.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + + +main(int argc, char **argv) +{ + struct stat statbuf; + char *filename; + + if (argc != 2) { + fprintf(stderr, "Usage: %s dir\n", argv[0]); + exit(1); + } + filename = argv[1]; + if (stat(filename, &statbuf) < 0) { + perror(filename); + exit(1); + } + if (S_ISDIR(statbuf.st_mode)) { + if (!opendir(filename)) { + perror(filename); + exit(1); + } + } else { + if (open(filename, O_RDONLY) < 0) { + perror(filename); + exit(1); + } + } + sleep(30); +} diff --git a/tests/progs/random_exercise.c b/tests/progs/random_exercise.c new file mode 100644 index 0000000..38217ab --- /dev/null +++ b/tests/progs/random_exercise.c @@ -0,0 +1,171 @@ +/* + * random_exercise.c --- Test program which exercises an ext2 + * filesystem. It creates a lot of random files in the current + * directory, while holding some files open while they are being + * deleted. This exercises the orphan list code, as well as + * creating lots of fodder for the ext3 journal. + * + * Copyright (C) 2000 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include "config.h" +#include <unistd.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#define MAXFDS 128 + +struct state { + char name[16]; + int state; + int isdir; +}; + +#define STATE_CLEAR 0 +#define STATE_CREATED 1 +#define STATE_DELETED 2 + +struct state state_array[MAXFDS]; + +#define DATA_SIZE 65536 + +char data_buffer[DATA_SIZE]; + +void clear_state_array() +{ + int i; + + for (i = 0; i < MAXFDS; i++) + state_array[i].state = STATE_CLEAR; +} + +int get_random_fd() +{ + int fd; + + while (1) { + fd = ((int) random()) % MAXFDS; + if (fd > 2) + return fd; + } +} + +unsigned int get_inode_num(int fd) +{ + struct stat st; + + if (fstat(fd, &st) < 0) { + perror("fstat"); + return 0; + } + return st.st_ino; +} + + +void create_random_file() +{ + char template[16] = "EX.XXXXXX"; + int fd; + int isdir = 0; + int size; + + mktemp(template); + isdir = random() & 1; + if (isdir) { + if (mkdir(template, 0700) < 0) + return; + fd = open(template, O_RDONLY, 0600); + printf("Created temp directory %s, fd = %d\n", + template, fd); + } else { + size = random() & (DATA_SIZE-1); + fd = open(template, O_CREAT|O_RDWR, 0600); + write(fd, data_buffer, size); + printf("Created temp file %s, fd = %d, size=%d\n", + template, fd, size); + } + state_array[fd].isdir = isdir; + if (fd < 0) + return; + state_array[fd].isdir = isdir; + state_array[fd].state = STATE_CREATED; + strcpy(state_array[fd].name, template); +} + +void truncate_file(int fd) +{ + int size; + + size = random() & (DATA_SIZE-1); + + if (state_array[fd].isdir) + return; + + ftruncate(fd, size); + printf("Truncating temp file %s, fd = %d, ino=%u, size=%d\n", + state_array[fd].name, fd, get_inode_num(fd), size); +} + + +void unlink_file(int fd) +{ + char *filename = state_array[fd].name; + + printf("Deleting %s, fd = %d, ino = %u\n", filename, fd, + get_inode_num(fd)); + + if (state_array[fd].isdir) + rmdir(filename); + else + unlink(filename); + state_array[fd].state = STATE_DELETED; +} + +void close_file(int fd) +{ + char *filename = state_array[fd].name; + + printf("Closing %s, fd = %d, ino = %u\n", filename, fd, + get_inode_num(fd)); + + close(fd); + state_array[fd].state = STATE_CLEAR; +} + + +main(int argc, char **argv) +{ + int i, fd; + + memset(data_buffer, 0, sizeof(data_buffer)); + sprintf(data_buffer, "This is a test file created by the " + "random_exerciser program\n"); + + for (i=0; i < 100000; i++) { + fd = get_random_fd(); + switch (state_array[fd].state) { + case STATE_CLEAR: + create_random_file(); + break; + case STATE_CREATED: + if ((state_array[fd].isdir == 0) && + (random() & 2)) + truncate_file(fd); + else + unlink_file(fd); + break; + case STATE_DELETED: + close_file(fd); + break; + } + } +} + + diff --git a/tests/progs/test_data/bma.setup b/tests/progs/test_data/bma.setup new file mode 100644 index 0000000..f47e511 --- /dev/null +++ b/tests/progs/test_data/bma.setup @@ -0,0 +1 @@ +-bma_create test 23 diff --git a/tests/progs/test_data/expect.brel b/tests/progs/test_data/expect.brel new file mode 100644 index 0000000..0858659 --- /dev/null +++ b/tests/progs/test_data/expect.brel @@ -0,0 +1,41 @@ +test_rel: brel_dump +test_rel: brel_put 2 11 +test_rel: brel_put 1 10 +test_rel: brel_put 3 9 +test_rel: brel_put 1 10 4 128 +test_rel: brel_put 23 12 +test_rel: brel_put 24 13 +brel_put: Invalid argument while calling ext2fs_brel_put +test_rel: brel_get 24 +brel_get: Invalid argument while calling ext2fs_brel_get +test_rel: brel_delete 24 +brel_delete: Invalid argument while calling ext2fs_brel_delete +test_rel: brel_get 5 +brel_get: No such file or directory while calling ext2fs_brel_get +test_rel: brel_get 3 +Old= 3, New= 9, Owner= 0:0 +test_rel: brel_get 1 +Old= 1, New= 10, Owner= 4:128 +test_rel: brel_start_iter +test_rel: brel_next +Old= 1, New= 10, Owner= 4:128 +test_rel: brel_next +Old= 2, New= 11, Owner= 0:0 +test_rel: brel_next +Old= 3, New= 9, Owner= 0:0 +test_rel: brel_next +No more entries! +test_rel: brel_delete 2 +test_rel: brel_delete 2 +brel_delete: No such file or directory while calling ext2fs_brel_delete +test_rel: brel_delete 5 +brel_delete: No such file or directory while calling ext2fs_brel_delete +test_rel: brel_move 1 2 +test_rel: brel_delete 1 +brel_delete: No such file or directory while calling ext2fs_brel_delete +test_rel: brel_move 1 4 +brel_move: No such file or directory while calling ext2fs_brel_move +test_rel: brel_move 2 5 +test_rel: brel_dump +Old= 3, New= 9, Owner= 0:0 +Old= 5, New= 10, Owner= 4:128 diff --git a/tests/progs/test_data/expect.icount b/tests/progs/test_data/expect.icount new file mode 100644 index 0000000..b58a373 --- /dev/null +++ b/tests/progs/test_data/expect.icount @@ -0,0 +1,193 @@ +test_icount: validate +Icount structure successfully validated +test_icount: store 0 0 +store: Invalid argument passed to ext2 library while calling ext2fs_icount_store +test_icount: fetch 0 +fetch: Invalid argument passed to ext2 library while calling ext2fs_icount_fetch +test_icount: increment 0 +increment: Invalid argument passed to ext2 library while calling ext2fs_icount_increment +test_icount: decrement 0 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: store 20001 0 +store: Invalid argument passed to ext2 library while calling ext2fs_icount_store +test_icount: fetch 20001 +fetch: Invalid argument passed to ext2 library while calling ext2fs_icount_fetch +test_icount: increment 20001 +increment: Invalid argument passed to ext2 library while calling ext2fs_icount_increment +test_icount: decrement 20001 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: validate +Icount structure successfully validated +test_icount: fetch 1 +Count is 0 +test_icount: store 1 1 +test_icount: fetch 1 +Count is 1 +test_icount: store 1 2 +test_icount: fetch 1 +Count is 2 +test_icount: store 1 3 +test_icount: fetch 1 +Count is 3 +test_icount: store 1 1 +test_icount: fetch 1 +Count is 1 +test_icount: store 1 0 +test_icount: fetch 1 +Count is 0 +test_icount: fetch 20000 +Count is 0 +test_icount: store 20000 0 +test_icount: fetch 20000 +Count is 0 +test_icount: store 20000 3 +test_icount: fetch 20000 +Count is 3 +test_icount: store 20000 0 +test_icount: fetch 20000 +Count is 0 +test_icount: store 20000 42 +test_icount: fetch 20000 +Count is 42 +test_icount: store 20000 1 +test_icount: fetch 20000 +Count is 1 +test_icount: store 20000 0 +test_icount: fetch 20000 +Count is 0 +test_icount: get_size +Size of icount is: 5 +test_icount: decrement 2 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: increment 2 +Count is now 1 +test_icount: fetch 2 +Count is 1 +test_icount: increment 2 +Count is now 2 +test_icount: fetch 2 +Count is 2 +test_icount: increment 2 +Count is now 3 +test_icount: fetch 2 +Count is 3 +test_icount: increment 2 +Count is now 4 +test_icount: fetch 2 +Count is 4 +test_icount: decrement 2 +Count is now 3 +test_icount: fetch 2 +Count is 3 +test_icount: decrement 2 +Count is now 2 +test_icount: fetch 2 +Count is 2 +test_icount: decrement 2 +Count is now 1 +test_icount: fetch 2 +Count is 1 +test_icount: decrement 2 +Count is now 0 +test_icount: decrement 2 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: store 3 1 +test_icount: increment 3 +Count is now 2 +test_icount: fetch 3 +Count is 2 +test_icount: decrement 3 +Count is now 1 +test_icount: fetch 3 +Count is 1 +test_icount: decrement 3 +Count is now 0 +test_icount: store 4 0 +test_icount: fetch 4 +Count is 0 +test_icount: increment 4 +Count is now 1 +test_icount: increment 4 +Count is now 2 +test_icount: fetch 4 +Count is 2 +test_icount: decrement 4 +Count is now 1 +test_icount: decrement 4 +Count is now 0 +test_icount: store 4 42 +test_icount: store 4 0 +test_icount: increment 4 +Count is now 1 +test_icount: increment 4 +Count is now 2 +test_icount: increment 4 +Count is now 3 +test_icount: decrement 4 +Count is now 2 +test_icount: decrement 4 +Count is now 1 +test_icount: decrement 4 +Count is now 0 +test_icount: decrement 4 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: decrement 4 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: store 5 4 +test_icount: decrement 5 +Count is now 3 +test_icount: decrement 5 +Count is now 2 +test_icount: decrement 5 +Count is now 1 +test_icount: decrement 5 +Count is now 0 +test_icount: decrement 5 +decrement: Invalid argument passed to ext2 library while calling ext2fs_icount_decrement +test_icount: get_size +Size of icount is: 105 +test_icount: validate +Icount structure successfully validated +test_icount: store 10 10 +test_icount: store 20 20 +test_icount: store 30 30 +test_icount: store 40 40 +test_icount: store 50 50 +test_icount: store 60 60 +test_icount: store 70 70 +test_icount: store 80 80 +test_icount: store 90 90 +test_icount: store 100 100 +test_icount: store 15 15 +test_icount: store 25 25 +test_icount: store 35 35 +test_icount: store 45 45 +test_icount: store 55 55 +test_icount: store 65 65 +test_icount: store 75 75 +test_icount: store 85 85 +test_icount: store 95 95 +test_icount: dump +10: 10 +15: 15 +20: 20 +25: 25 +30: 30 +35: 35 +40: 40 +45: 45 +50: 50 +55: 55 +60: 60 +65: 65 +70: 70 +75: 75 +80: 80 +85: 85 +90: 90 +95: 95 +100: 100 +test_icount: get_size +Size of icount is: 105 +test_icount: validate +Icount structure successfully validated diff --git a/tests/progs/test_data/expect.irel b/tests/progs/test_data/expect.irel new file mode 100644 index 0000000..8e47938 --- /dev/null +++ b/tests/progs/test_data/expect.irel @@ -0,0 +1,62 @@ +test_rel: irel_dump +test_rel: irel_put 2 11 3 +test_rel: irel_put 1 10 2 +test_rel: irel_put 3 9 1 +test_rel: irel_add_ref 1 4 128 +test_rel: irel_add_ref 1 5 64 +test_rel: irel_add_ref 1 6 512 +irel_add_ref: No space left on device while calling ext2fs_irel_add_ref +test_rel: irel_put 1 8 3 +test_rel: irel_add_ref 1 6 512 +test_rel: irel_add_ref 2 4 64 +test_rel: irel_put 23 12 1 +test_rel: irel_put 24 13 1 +irel_put: Invalid argument while calling ext2fs_irel_put +test_rel: irel_get 24 +irel_get: Invalid argument while calling ext2fs_irel_get +test_rel: irel_delete 24 +irel_delete: Invalid argument while calling ext2fs_irel_delete +test_rel: irel_get 3 +Old= 3, New= 9, Original=3, Max_refs=1 +test_rel: irel_get 1 +Old= 1, New= 8, Original=1, Max_refs=3 + 4:128, 5:64, 6:512 +test_rel: irel_start_iter +test_rel: irel_next +Old= 1, New= 8, Original=1, Max_refs=3 + 4:128, 5:64, 6:512 +test_rel: irel_next +Old= 2, New= 11, Original=2, Max_refs=3 + 4:64 +test_rel: irel_next +Old= 3, New= 9, Original=3, Max_refs=1 +test_rel: irel_next +No more entries! +test_rel: irel_delete 2 +test_rel: irel_delete 2 +irel_delete: No such file or directory while calling ext2fs_irel_delete +test_rel: irel_delete 4 +irel_delete: No such file or directory while calling ext2fs_irel_delete +test_rel: irel_move 1 2 +test_rel: irel_dump +Old= 2, New= 8, Original=1, Max_refs=3 + 4:128, 5:64, 6:512 +Old= 3, New= 9, Original=3, Max_refs=1 +test_rel: irel_delete 4 +irel_delete: No such file or directory while calling ext2fs_irel_delete +test_rel: irel_move 1 4 +irel_move: No such file or directory while calling ext2fs_irel_move +test_rel: irel_move 2 4 +test_rel: irel_dump +Old= 3, New= 9, Original=3, Max_refs=1 +Old= 4, New= 8, Original=1, Max_refs=3 + 4:128, 5:64, 6:512 +test_rel: irel_get_by_orig 3 +Old= 3, New= 9, Original=3, Max_refs=1 +test_rel: irel_get_by_orig 1 +Old= 4, New= 8, Original=1, Max_refs=3 + 4:128, 5:64, 6:512 +test_rel: irel_get_by_orig 5 +irel_get_by_orig: No such file or directory while calling ext2fs_irel_get_by_orig +test_rel: irel_get_by_orig 2 +irel_get_by_orig: No such file or directory while calling ext2fs_irel_get_by_orig diff --git a/tests/progs/test_data/ima.setup b/tests/progs/test_data/ima.setup new file mode 100644 index 0000000..f411606 --- /dev/null +++ b/tests/progs/test_data/ima.setup @@ -0,0 +1 @@ +-ima_create test 23 diff --git a/tests/progs/test_data/normal.setup b/tests/progs/test_data/normal.setup new file mode 100644 index 0000000..dfc6c41 --- /dev/null +++ b/tests/progs/test_data/normal.setup @@ -0,0 +1 @@ +-create diff --git a/tests/progs/test_data/opt.setup b/tests/progs/test_data/opt.setup new file mode 100644 index 0000000..79458b0 --- /dev/null +++ b/tests/progs/test_data/opt.setup @@ -0,0 +1 @@ +-create -i diff --git a/tests/progs/test_data/test.brel b/tests/progs/test_data/test.brel new file mode 100644 index 0000000..6605452 --- /dev/null +++ b/tests/progs/test_data/test.brel @@ -0,0 +1,47 @@ +# +# This is the test script for the block relocation table. +# +# Copyright 1997 by Theodore Ts'o. This file may be redistributed +# under the terms of the GNU Public License. +# +# +brel_dump +brel_put 2 11 +brel_put 1 10 +brel_put 3 9 +brel_put 1 10 4 128 +# +# Test boundary cases for brel_put +# +brel_put 23 12 +brel_put 24 13 +# +# Test other boundary cases +# +brel_get 24 +brel_delete 24 +# +# Test getting existing and non-existent entries +# +brel_get 5 +brel_get 3 +brel_get 1 +# +# Test the iterator functions +# +brel_start_iter +brel_next +brel_next +brel_next +brel_next +# +# Test delete and move +# +brel_delete 2 +brel_delete 2 +brel_delete 5 +brel_move 1 2 +brel_delete 1 +brel_move 1 4 +brel_move 2 5 +brel_dump diff --git a/tests/progs/test_data/test.icount b/tests/progs/test_data/test.icount new file mode 100644 index 0000000..8cb1955 --- /dev/null +++ b/tests/progs/test_data/test.icount @@ -0,0 +1,136 @@ +# +# This is the test script for the icount abstraction +# +# Copyright 1997 by Theodore Ts'o. This file may be redistributed +# under the terms of the GNU Public License. +# +# +# First let's test the boundary cases for illegal arguments +# +validate +store 0 0 +fetch 0 +increment 0 +decrement 0 +store 20001 0 +fetch 20001 +increment 20001 +decrement 20001 +validate +# +# OK, now let's test fetch and store. We also test the boundary cases +# for legal inodes here. +# +fetch 1 +store 1 1 +fetch 1 +store 1 2 +fetch 1 +store 1 3 +fetch 1 +store 1 1 +fetch 1 +store 1 0 +fetch 1 +fetch 20000 +store 20000 0 +fetch 20000 +store 20000 3 +fetch 20000 +store 20000 0 +fetch 20000 +store 20000 42 +fetch 20000 +store 20000 1 +fetch 20000 +store 20000 0 +fetch 20000 +get_size +# +# Time to test increment. First increment from 0 (previously unreferenced) +# +decrement 2 +increment 2 +fetch 2 +increment 2 +fetch 2 +increment 2 +fetch 2 +increment 2 +fetch 2 +decrement 2 +fetch 2 +decrement 2 +fetch 2 +decrement 2 +fetch 2 +decrement 2 +decrement 2 +# +# Store 1 then test... +# +store 3 1 +increment 3 +fetch 3 +decrement 3 +fetch 3 +decrement 3 +# +# Store 0 then test +# +store 4 0 +fetch 4 +increment 4 +increment 4 +fetch 4 +decrement 4 +decrement 4 +# +# Store something, then store 0, then test... +# +store 4 42 +store 4 0 +increment 4 +increment 4 +increment 4 +decrement 4 +decrement 4 +decrement 4 +decrement 4 +decrement 4 +# +# store something, then decrement to zero +# +store 5 4 +decrement 5 +decrement 5 +decrement 5 +decrement 5 +decrement 5 +# +# Test insert +# +get_size +validate +store 10 10 +store 20 20 +store 30 30 +store 40 40 +store 50 50 +store 60 60 +store 70 70 +store 80 80 +store 90 90 +store 100 100 +store 15 15 +store 25 25 +store 35 35 +store 45 45 +store 55 55 +store 65 65 +store 75 75 +store 85 85 +store 95 95 +dump +get_size +validate diff --git a/tests/progs/test_data/test.irel b/tests/progs/test_data/test.irel new file mode 100644 index 0000000..6c338bc --- /dev/null +++ b/tests/progs/test_data/test.irel @@ -0,0 +1,69 @@ +# +# This is the test script for the inode relocation table. +# +# Copyright 1997 by Theodore Ts'o. This file may be redistributed +# under the terms of the GNU Public License. +# +# +irel_dump +irel_put 2 11 3 +irel_put 1 10 2 +irel_put 3 9 1 +irel_add_ref 1 4 128 +irel_add_ref 1 5 64 +# +# Check to see what happens if we add too many references +# +irel_add_ref 1 6 512 +# +# Try resizing the number of references and retry the add +# +irel_put 1 8 3 +irel_add_ref 1 6 512 +# +irel_add_ref 2 4 64 +# +# Test boundary cases of irel_put +# +irel_put 23 12 1 +irel_put 24 13 1 +# +# Test other boundary cases.... +# +irel_get 24 +irel_delete 24 +# +# Test retrivals +# +irel_get 3 +irel_get 1 +# +# Test the iterator functions +# +irel_start_iter +irel_next +irel_next +irel_next +irel_next +# +# Now try the delete function, on existing and non-existent entries +# +irel_delete 2 +irel_delete 2 +irel_delete 4 +# +# Move tests... +# +irel_move 1 2 +irel_dump +irel_delete 4 +irel_move 1 4 +irel_move 2 4 +# +# Get by orig tests +# +irel_dump +irel_get_by_orig 3 +irel_get_by_orig 1 +irel_get_by_orig 5 +irel_get_by_orig 2 diff --git a/tests/progs/test_icount.c b/tests/progs/test_icount.c new file mode 100644 index 0000000..6ebb100 --- /dev/null +++ b/tests/progs/test_icount.c @@ -0,0 +1,384 @@ +/* + * test_icount.c + * + * Copyright (C) 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_GETOPT_H +#include <getopt.h> +#endif +#include <fcntl.h> + +#include <ext2fs/ext2_fs.h> + +#include <et/com_err.h> +#include <ss/ss.h> +#include <ext2fs/ext2fs.h> +#include <ext2fs/irel.h> +#include <ext2fs/brel.h> + +extern ss_request_table test_cmds; + +#include "test_icount.h" + +ext2_filsys test_fs; +ext2_icount_t test_icount; + +/* + * Helper function which assures that the icount structure is valid + */ +static int check_icount(char *request) +{ + if (test_icount) + return 0; + com_err(request, 0, "The icount structure must be allocated."); + return 1; +} + +/* + * Helper function which parses an inode number. + */ +static int parse_inode(const char *request, const char *desc, + const char *str, ext2_ino_t *ino) +{ + char *tmp; + + *ino = strtoul(str, &tmp, 0); + if (*tmp) { + com_err(request, 0, "Bad %s - %s", desc, str); + return 1; + } + return 0; +} + +void do_create_icount(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + char *progname; + int flags = 0; + ext2_ino_t size = 5; + + progname = *argv; + argv++; argc --; + + if (argc && !strcmp("-i", *argv)) { + flags |= EXT2_ICOUNT_OPT_INCREMENT; + argv++; argc--; + } + if (argc) { + if (parse_inode(progname, "icount size", argv[0], &size)) + return; + argv++; argc--; + } +#if 0 + printf("Creating icount... flags=%d, size=%d\n", flags, (int) size); +#endif + retval = ext2fs_create_icount(test_fs, flags, (int) size, + &test_icount); + if (retval) { + com_err(progname, retval, "while creating icount"); + return; + } +} + +void do_free_icount(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + if (argc != 1) { + printf("Usage: free_icount\n"); + return; + } + if (check_icount(argv[0])) + return; + + ext2fs_free_icount(test_icount); + test_icount = 0; +} + +void do_fetch(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + ext2_ino_t ino; + __u16 count; + + if (argc < 2) { + printf("usage: %s inode\n", argv[0]); + return; + } + if (check_icount(argv[0])) + return; + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + retval = ext2fs_icount_fetch(test_icount, ino, &count); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_icount_fetch"); + return; + } + printf("Count is %u\n", count); +} + +void do_increment(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + ext2_ino_t ino; + __u16 count; + + if (argc < 2) { + printf("usage: %s inode\n", argv[0]); + return; + } + if (check_icount(argv[0])) + return; + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + retval = ext2fs_icount_increment(test_icount, ino, &count); + if (retval) { + com_err(argv[0], retval, + "while calling ext2fs_icount_increment"); + return; + } + printf("Count is now %u\n", count); +} + +void do_decrement(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + ext2_ino_t ino; + __u16 count; + + if (argc < 2) { + printf("usage: %s inode\n", argv[0]); + return; + } + if (check_icount(argv[0])) + return; + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + retval = ext2fs_icount_decrement(test_icount, ino, &count); + if (retval) { + com_err(argv[0], retval, + "while calling ext2fs_icount_decrement"); + return; + } + printf("Count is now %u\n", count); +} + +void do_store(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + ext2_ino_t ino; + ext2_ino_t count; + + if (argc < 3) { + printf("usage: %s inode count\n", argv[0]); + return; + } + if (check_icount(argv[0])) + return; + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + if (parse_inode(argv[0], "count", argv[2], &count)) + return; + if (count > 65535) { + printf("Count too large.\n"); + return; + } + retval = ext2fs_icount_store(test_icount, ino, (__u16) count); + if (retval) { + com_err(argv[0], retval, + "while calling ext2fs_icount_store"); + return; + } +} + +void do_dump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + ext2_ino_t i; + __u16 count; + + if (argc != 1) { + printf("Usage: dump\n"); + return; + } + if (check_icount(argv[0])) + return; + for (i=1; i <= test_fs->super->s_inodes_count; i++) { + retval = ext2fs_icount_fetch(test_icount, i, &count); + if (retval) { + com_err(argv[0], retval, + "while fetching icount for %lu", (unsigned long)i); + return; + } + if (count) + printf("%lu: %u\n", (unsigned long)i, count); + } +} + +void do_validate(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + errcode_t retval; + + if (argc != 1) { + printf("Usage: validate\n"); + return; + } + if (check_icount(argv[0])) + return; + retval = ext2fs_icount_validate(test_icount, stdout); + if (retval) { + com_err(argv[0], retval, "while validating icount structure"); + return; + } + printf("Icount structure successfully validated\n"); +} + +void do_get_size(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)), + void *infop EXT2FS_ATTR((unused))) +{ + ext2_ino_t size; + + if (argc != 1) { + printf("Usage: get_size\n"); + return; + } + if (check_icount(argv[0])) + return; + size = ext2fs_get_icount_size(test_icount); + printf("Size of icount is: %lu\n", (unsigned long)size); +} + +static int source_file(const char *cmd_file, int sci_idx) +{ + FILE *f; + char buf[256]; + char *cp; + int exit_status = 0; + int retval; + int noecho; + + if (strcmp(cmd_file, "-") == 0) + f = stdin; + else { + f = fopen(cmd_file, "r"); + if (!f) { + perror(cmd_file); + exit(1); + } + } + fflush(stdout); + fflush(stderr); + setbuf(stdout, NULL); + setbuf(stderr, NULL); + while (!feof(f)) { + if (fgets(buf, sizeof(buf), f) == NULL) + break; + if (buf[0] == '#') + continue; + noecho = 0; + if (buf[0] == '-') { + noecho = 1; + buf[0] = ' '; + } + cp = strchr(buf, '\n'); + if (cp) + *cp = 0; + cp = strchr(buf, '\r'); + if (cp) + *cp = 0; + if (!noecho) + printf("test_icount: %s\n", buf); + retval = ss_execute_line(sci_idx, buf); + if (retval) { + ss_perror(sci_idx, retval, buf); + exit_status++; + } + } + if (f != stdin) + fclose(f); + return exit_status; +} + +int main(int argc, char **argv) +{ + int retval; + int sci_idx; + int c; + char *request = 0; + int exit_status = 0; + char *cmd_file = 0; + struct ext2_super_block param; + + initialize_ext2_error_table(); + + /* + * Create a sample filesystem structure + */ + memset(¶m, 0, sizeof(struct ext2_super_block)); + ext2fs_blocks_count_set(¶m, 80000); + param.s_inodes_count = 20000; + retval = ext2fs_initialize("/dev/null", 0, ¶m, + unix_io_manager, &test_fs); + if (retval) { + com_err("/dev/null", retval, "while setting up test fs"); + exit(1); + } + + while ((c = getopt (argc, argv, "wR:f:")) != EOF) { + switch (c) { + case 'R': + request = optarg; + break; + case 'f': + cmd_file = optarg; + break; + default: + com_err(argv[0], 0, "Usage: test_icount " + "[-R request] [-f cmd_file]"); + exit(1); + } + } + sci_idx = ss_create_invocation("test_icount", "0.0", (char *) NULL, + &test_cmds, &retval); + if (retval) { + ss_perror(sci_idx, retval, "creating invocation"); + exit(1); + } + + (void) ss_add_request_table (sci_idx, &ss_std_requests, 1, &retval); + if (retval) { + ss_perror(sci_idx, retval, "adding standard requests"); + exit (1); + } + if (request) { + retval = 0; + retval = ss_execute_line(sci_idx, request); + if (retval) { + ss_perror(sci_idx, retval, request); + exit_status++; + } + } else if (cmd_file) { + exit_status = source_file(cmd_file, sci_idx); + } else { + ss_listen(sci_idx); + } + + return(exit_status); +} diff --git a/tests/progs/test_icount.h b/tests/progs/test_icount.h new file mode 100644 index 0000000..29d56ab --- /dev/null +++ b/tests/progs/test_icount.h @@ -0,0 +1,10 @@ +void do_create_icount(int argc, char **argv, int sci_idx, void *infop); +void do_free_icount(int argc, char **argv, int sci_idx, void *infop); +void do_fetch(int argc, char **argv, int sci_idx, void *infop); +void do_increment(int argc, char **argv, int sci_idx, void *infop); +void do_decrement(int argc, char **argv, int sci_idx, void *infop); +void do_store(int argc, char **argv, int sci_idx, void *infop); +void do_get_size(int argc, char **argv, int sci_idx, void *infop); +void do_dump(int argc, char **argv, int sci_idx, void *infop); +void do_validate(int argc, char **argv, int sci_idx, void *infop); + diff --git a/tests/progs/test_icount_cmds.ct b/tests/progs/test_icount_cmds.ct new file mode 100644 index 0000000..c3cc6f4 --- /dev/null +++ b/tests/progs/test_icount_cmds.ct @@ -0,0 +1,37 @@ +# +# Copyright (C) 1997 Theodore Ts'o. This file may be redistributed +# under the terms of the GNU Public License. +# +command_table test_cmds; + +# +# Icount table commands +# +request do_create_icount, "Create an icount structure", + create_icount, create; + +request do_free_icount, "Free an icount structure", + free_icount, free; + +request do_fetch, "Fetch an icount entry", + fetch; + +request do_increment, "Increment an icount entry", + increment, inc; + +request do_decrement, "Decrement an icount entry", + decrement, dec; + +request do_store, "Store an icount entry", + store; + +request do_get_size, "Get the size of the icount structure", + get_size; + +request do_dump, "Dump the icount structure", + dump; + +request do_validate, "Validate the icount structure", + validate, check; + +end; diff --git a/tests/progs/test_rel.c b/tests/progs/test_rel.c new file mode 100644 index 0000000..8f7280c --- /dev/null +++ b/tests/progs/test_rel.c @@ -0,0 +1,764 @@ +/* + * test_rel.c + * + * Copyright (C) 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_GETOPT_H +#include <getopt.h> +#endif +#include <fcntl.h> + +#include <et/com_err.h> +#include <ss/ss.h> +#include <ext2fs/ext2_fs.h> +#include <ext2fs/ext2fs.h> +#include <ext2fs/irel.h> +#include <ext2fs/brel.h> + +#include "test_rel.h" + +extern ss_request_table test_cmds; + +ext2_irel irel = NULL; +ext2_brel brel = NULL; + +/* + * Helper function which parses an inode number. + */ +static int parse_inode(const char *request, const char *desc, + const char *str, ext2_ino_t *ino) +{ + char *tmp; + + *ino = strtoul(str, &tmp, 0); + if (*tmp) { + com_err(request, 0, "Bad %s - %s", desc, str); + return 1; + } + return 0; +} + +/* + * Helper function which parses a block number. + */ +static int parse_block(const char *request, const char *desc, + const char *str, blk_t *blk) +{ + char *tmp; + + *blk = strtoul(str, &tmp, 0); + if (*tmp) { + com_err(request, 0, "Bad %s - %s", desc, str); + return 1; + } + return 0; +} + +/* + * Helper function which assures that a brel table is open + */ +static int check_brel(char *request) +{ + if (brel) + return 0; + com_err(request, 0, "A block relocation table must be open."); + return 1; +} + +/* + * Helper function which assures that an irel table is open + */ +static int check_irel(char *request) +{ + if (irel) + return 0; + com_err(request, 0, "An inode relocation table must be open."); + return 1; +} + +/* + * Helper function which displays a brel entry + */ +static void display_brel_entry(blk_t old, + struct ext2_block_relocate_entry *ent) +{ + printf("Old= %u, New= %u, Owner= %u:%u\n", old, ent->new, + ent->owner.block_ref, ent->offset); +} + +/* + * Helper function which displays an irel entry + */ +static void display_irel_entry(ext2_ino_t old, + struct ext2_inode_relocate_entry *ent, + int do_refs) +{ + struct ext2_inode_reference ref; + errcode_t retval; + int first = 1; + + printf("Old= %lu, New= %lu, Original=%lu, Max_refs=%u\n", old, + ent->new, ent->orig, ent->max_refs); + if (!do_refs) + return; + + retval = ext2fs_irel_start_iter_ref(irel, old); + if (retval) { + printf("\tCouldn't get references: %s\n", + error_message(retval)); + return; + } + while (1) { + retval = ext2fs_irel_next_ref(irel, &ref); + if (retval) { + printf("(%s) ", error_message(retval)); + break; + } + if (ref.block == 0) + break; + if (first) { + fputc('\t', stdout); + first = 0; + } else + printf(", "); + printf("%u:%u", ref.block, ref.offset); + } + if (!first) + fputc('\n', stdout); +} + +/* + * These are the actual command table procedures + */ +void do_brel_ma_create(int argc, char **argv) +{ + const char *usage = "Usage: %s name max_blocks\n"; + errcode_t retval; + blk_t max_blk; + + if (argc < 3) { + printf(usage, argv[0]); + return; + } + if (parse_block(argv[0], "max_blocks", argv[2], &max_blk)) + return; + retval = ext2fs_brel_memarray_create(argv[1], max_blk, &brel); + if (retval) { + com_err(argv[0], retval, "while opening memarray brel"); + return; + } + return; +} + +void do_brel_free(int argc, char **argv) +{ + if (check_brel(argv[0])) + return; + ext2fs_brel_free(brel); + brel = NULL; + return; +} + +void do_brel_put(int argc, char **argv) +{ + const char *usage = "usage: %s old_block new_block [owner] [offset]"; + errcode_t retval; + struct ext2_block_relocate_entry ent; + blk_t old, new, offset=0, owner=0; + + if (check_brel(argv[0])) + return; + + if (argc < 3) { + printf(usage, argv[0]); + return; + } + if (parse_block(argv[0], "old block", argv[1], &old)) + return; + if (parse_block(argv[0], "new block", argv[2], &new)) + return; + if (argc > 3 && + parse_block(argv[0], "owner block", argv[3], &owner)) + return; + if (argc > 4 && + parse_block(argv[0], "offset", argv[4], &offset)) + return; + if (offset > 65535) { + printf("Offset too large.\n"); + return; + } + ent.new = new; + ent.offset = (__u16) offset; + ent.flags = 0; + ent.owner.block_ref = owner; + + retval = ext2fs_brel_put(brel, old, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_put"); + return; + } + return; +} + +void do_brel_get(int argc, char **argv) +{ + const char *usage = "%s block"; + errcode_t retval; + struct ext2_block_relocate_entry ent; + blk_t blk; + + if (check_brel(argv[0])) + return; + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_block(argv[0], "block", argv[1], &blk)) + return; + retval = ext2fs_brel_get(brel, blk, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_get"); + return; + } + display_brel_entry(blk, &ent); + return; +} + +void do_brel_start_iter(int argc, char **argv) +{ + errcode_t retval; + + if (check_brel(argv[0])) + return; + + retval = ext2fs_brel_start_iter(brel); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_start_iter"); + return; + } + return; +} + +void do_brel_next(int argc, char **argv) +{ + errcode_t retval; + struct ext2_block_relocate_entry ent; + blk_t blk; + + if (check_brel(argv[0])) + return; + + retval = ext2fs_brel_next(brel, &blk, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_next"); + return; + } + if (blk == 0) { + printf("No more entries!\n"); + return; + } + display_brel_entry(blk, &ent); + return; +} + +void do_brel_dump(int argc, char **argv) +{ + errcode_t retval; + struct ext2_block_relocate_entry ent; + blk_t blk; + + if (check_brel(argv[0])) + return; + + retval = ext2fs_brel_start_iter(brel); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_start_iter"); + return; + } + + while (1) { + retval = ext2fs_brel_next(brel, &blk, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_next"); + return; + } + if (blk == 0) + break; + + display_brel_entry(blk, &ent); + } + return; +} + +void do_brel_move(int argc, char **argv) +{ + const char *usage = "%s old_block new_block"; + errcode_t retval; + blk_t old, new; + + if (check_brel(argv[0])) + return; + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_block(argv[0], "old block", argv[1], &old)) + return; + if (parse_block(argv[0], "new block", argv[2], &new)) + return; + + retval = ext2fs_brel_move(brel, old, new); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_move"); + return; + } + return; +} + +void do_brel_delete(int argc, char **argv) +{ + const char *usage = "%s block"; + errcode_t retval; + blk_t blk; + + if (check_brel(argv[0])) + return; + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_block(argv[0], "block", argv[1], &blk)) + return; + + retval = ext2fs_brel_delete(brel, blk); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_brel_delete"); + return; + } +} + +void do_irel_ma_create(int argc, char **argv) +{ + const char *usage = "Usage: %s name max_inode\n"; + errcode_t retval; + ext2_ino_t max_ino; + + if (argc < 3) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "max_inodes", argv[2], &max_ino)) + return; + retval = ext2fs_irel_memarray_create(argv[1], max_ino, &irel); + if (retval) { + com_err(argv[0], retval, "while opening memarray irel"); + return; + } + return; +} + +void do_irel_free(int argc, char **argv) +{ + if (check_irel(argv[0])) + return; + + ext2fs_irel_free(irel); + irel = NULL; + return; +} + +void do_irel_put(int argc, char **argv) +{ + const char *usage = "%s old new max_refs"; + errcode_t retval; + ext2_ino_t old, new, max_refs; + struct ext2_inode_relocate_entry ent; + + if (check_irel(argv[0])) + return; + + if (argc < 4) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "old inode", argv[1], &old)) + return; + if (parse_inode(argv[0], "new inode", argv[2], &new)) + return; + if (parse_inode(argv[0], "max_refs", argv[3], &max_refs)) + return; + if (max_refs > 65535) { + printf("max_refs too big\n"); + return; + } + ent.new = new; + ent.max_refs = (__u16) max_refs; + ent.flags = 0; + + retval = ext2fs_irel_put(irel, old, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_put"); + return; + } + return; +} + +void do_irel_get(int argc, char **argv) +{ + const char *usage = "%s inode"; + errcode_t retval; + ext2_ino_t old; + struct ext2_inode_relocate_entry ent; + + if (check_irel(argv[0])) + return; + + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "inode", argv[1], &old)) + return; + + retval = ext2fs_irel_get(irel, old, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_get"); + return; + } + display_irel_entry(old, &ent, 1); + return; +} + +void do_irel_get_by_orig(int argc, char **argv) +{ + const char *usage = "%s orig_inode"; + errcode_t retval; + ext2_ino_t orig, old; + struct ext2_inode_relocate_entry ent; + + if (check_irel(argv[0])) + return; + + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "original inode", argv[1], &orig)) + return; + + retval = ext2fs_irel_get_by_orig(irel, orig, &old, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_get_by_orig"); + return; + } + display_irel_entry(old, &ent, 1); + return; +} + +void do_irel_start_iter(int argc, char **argv) +{ + errcode_t retval; + + if (check_irel(argv[0])) + return; + + retval = ext2fs_irel_start_iter(irel); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_start_iter"); + return; + } + return; +} + +void do_irel_next(int argc, char **argv) +{ + errcode_t retval; + ext2_ino_t old; + struct ext2_inode_relocate_entry ent; + + if (check_irel(argv[0])) + return; + + retval = ext2fs_irel_next(irel, &old, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_next"); + return; + } + if (old == 0) { + printf("No more entries!\n"); + return; + } + display_irel_entry(old, &ent, 1); + return; +} + +void do_irel_dump(int argc, char **argv) +{ + errcode_t retval; + ext2_ino_t ino; + struct ext2_inode_relocate_entry ent; + + if (check_irel(argv[0])) + return; + + retval = ext2fs_irel_start_iter(irel); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_start_iter"); + return; + } + + while (1) { + retval = ext2fs_irel_next(irel, &ino, &ent); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_next"); + return; + } + if (ino == 0) + break; + + display_irel_entry(ino, &ent, 1); + } + return; +} + +void do_irel_add_ref(int argc, char **argv) +{ + const char *usage = "%s inode block offset"; + errcode_t retval; + blk_t block, offset; + ext2_ino_t ino; + struct ext2_inode_reference ref; + + + if (check_irel(argv[0])) + return; + + if (argc < 4) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + if (parse_block(argv[0], "block", argv[2], &block)) + return; + if (parse_block(argv[0], "offset", argv[3], &offset)) + return; + if (offset > 65535) { + printf("Offset too big.\n"); + return; + } + ref.block = block; + ref.offset = offset; + + retval = ext2fs_irel_add_ref(irel, ino, &ref); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_add_ref"); + return; + } + return; +} + +void do_irel_start_iter_ref(int argc, char **argv) +{ + const char *usage = "%s inode"; + errcode_t retval; + ext2_ino_t ino; + + if (check_irel(argv[0])) + return; + + if (argc < 2) { + printf(usage, argv[0]); + return; + } + + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + retval = ext2fs_irel_start_iter_ref(irel, ino); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_start_iter_ref"); + return; + } + return; +} + +void do_irel_next_ref(int argc, char **argv) +{ + struct ext2_inode_reference ref; + errcode_t retval; + + if (check_irel(argv[0])) + return; + + retval = ext2fs_irel_next_ref(irel, &ref); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_next_ref"); + return; + } + printf("Inode reference: %u:%u\n", ref.block, ref.offset); + return; +} + +void do_irel_move(int argc, char **argv) +{ + const char *usage = "%s old new"; + errcode_t retval; + ext2_ino_t old, new; + + if (check_irel(argv[0])) + return; + + if (argc < 3) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "old inode", argv[1], &old)) + return; + if (parse_inode(argv[0], "new inode", argv[2], &new)) + return; + + retval = ext2fs_irel_move(irel, old, new); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_move"); + return; + } + return; +} + +void do_irel_delete(int argc, char **argv) +{ + const char *usage = "%s inode"; + errcode_t retval; + ext2_ino_t ino; + + if (check_irel(argv[0])) + return; + + if (argc < 2) { + printf(usage, argv[0]); + return; + } + if (parse_inode(argv[0], "inode", argv[1], &ino)) + return; + + retval = ext2fs_irel_delete(irel, ino); + if (retval) { + com_err(argv[0], retval, "while calling ext2fs_irel_delete"); + return; + } + return; +} + +static int source_file(const char *cmd_file, int sci_idx) +{ + FILE *f; + char buf[256]; + char *cp; + int exit_status = 0; + int retval; + int noecho; + + if (strcmp(cmd_file, "-") == 0) + f = stdin; + else { + f = fopen(cmd_file, "r"); + if (!f) { + perror(cmd_file); + exit(1); + } + } + fflush(stdout); + fflush(stderr); + setbuf(stdout, NULL); + setbuf(stderr, NULL); + while (!feof(f)) { + if (fgets(buf, sizeof(buf), f) == NULL) + break; + if (buf[0] == '#') + continue; + noecho = 0; + if (buf[0] == '-') { + noecho = 1; + buf[0] = ' '; + } + cp = strchr(buf, '\n'); + if (cp) + *cp = 0; + cp = strchr(buf, '\r'); + if (cp) + *cp = 0; + if (!noecho) + printf("test_rel: %s\n", buf); + retval = ss_execute_line(sci_idx, buf); + if (retval) { + ss_perror(sci_idx, retval, buf); + exit_status++; + } + } + return exit_status; +} + +void main(int argc, char **argv) +{ + int retval; + int sci_idx; + const char *usage = "Usage: test_rel [-R request] [-f cmd_file]"; + int c; + char *request = 0; + int exit_status = 0; + char *cmd_file = 0; + + initialize_ext2_error_table(); + + while ((c = getopt (argc, argv, "wR:f:")) != EOF) { + switch (c) { + case 'R': + request = optarg; + break; + case 'f': + cmd_file = optarg; + break; + default: + com_err(argv[0], 0, usage); + return; + } + } + sci_idx = ss_create_invocation("test_rel", "0.0", (char *) NULL, + &test_cmds, &retval); + if (retval) { + ss_perror(sci_idx, retval, "creating invocation"); + exit(1); + } + + (void) ss_add_request_table (sci_idx, &ss_std_requests, 1, &retval); + if (retval) { + ss_perror(sci_idx, retval, "adding standard requests"); + exit (1); + } + if (request) { + retval = 0; + retval = ss_execute_line(sci_idx, request); + if (retval) { + ss_perror(sci_idx, retval, request); + exit_status++; + } + } else if (cmd_file) { + exit_status = source_file(cmd_file, sci_idx); + } else { + ss_listen(sci_idx); + } + + exit(exit_status); +} + diff --git a/tests/progs/test_rel.h b/tests/progs/test_rel.h new file mode 100644 index 0000000..47c4d09 --- /dev/null +++ b/tests/progs/test_rel.h @@ -0,0 +1,35 @@ +/* + * test_rel.h + * + * Copyright (C) 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + + + +void do_brel_ma_create(int argc, char **argv); +void do_brel_free(int argc, char **argv); +void do_brel_put(int argc, char **argv); +void do_brel_get(int argc, char **argv); +void do_brel_start_iter(int argc, char **argv); +void do_brel_next(int argc, char **argv); +void do_brel_dump(int argc, char **argv); +void do_brel_move(int argc, char **argv); +void do_brel_delete(int argc, char **argv); +void do_irel_ma_create(int argc, char **argv); +void do_irel_free(int argc, char **argv); +void do_irel_put(int argc, char **argv); +void do_irel_get(int argc, char **argv); +void do_irel_get_by_orig(int argc, char **argv); +void do_irel_start_iter(int argc, char **argv); +void do_irel_next(int argc, char **argv); +void do_irel_dump(int argc, char **argv); +void do_irel_add_ref(int argc, char **argv); +void do_irel_start_iter_ref(int argc, char **argv); +void do_irel_next_ref(int argc, char **argv); +void do_irel_move(int argc, char **argv); +void do_irel_delete(int argc, char **argv); diff --git a/tests/progs/test_rel_cmds.ct b/tests/progs/test_rel_cmds.ct new file mode 100644 index 0000000..5ed6ae2 --- /dev/null +++ b/tests/progs/test_rel_cmds.ct @@ -0,0 +1,82 @@ +# +# Copyright (C) 1997 Theodore Ts'o. This file may be redistributed +# under the terms of the GNU Public License. +# +command_table test_cmds; + +# +# Block relocation table commands +# + +request do_brel_ma_create, "Open a memory array block relocation table", + brel_ma_create, bma_create; + +request do_brel_free, "Free a block relocation table", + brel_free, bfree; + +request do_brel_put, "Add or modify a block relocation entry", + brel_put, bput; + +request do_brel_get, "Get a block relocation entry", + brel_get, bget; + +request do_brel_start_iter, "Start iterating over the block table", + brel_start_iter, bstart; + +request do_brel_next, "Get the next block relocation entry", + brel_next, bnext; + +request do_brel_dump, "Dump the block relocation table", + brel_dump, bdump; + +request do_brel_move, "Move an entry in the block relocation table", + brel_move, bmove; + +request do_brel_delete, "Delete an entry in the block relocation table", + brel_delete, bdelete, bdel; + +# +# Inode relocation table commands +# + +request do_irel_ma_create, "Open a memory array inode relocation table", + irel_ma_create, ima_create; + +request do_irel_free, "Free an inode relocation table", + irel_free, ifree; + +request do_irel_put, "Add or modify an inode relocation entry", + irel_put, iput; + +request do_irel_get, "Get an inode relocation entry", + irel_get, iget; + +request do_irel_get_by_orig, + "Get an inode relocation entry by its original number", + irel_get_by_orig, igetorig, igeto; + +request do_irel_start_iter, "Start iterating over the inode table", + irel_start_iter, istart; + +request do_irel_next, "Get the next block relocation entry", + irel_next, inext; + +request do_irel_dump, "Dump the inode relocation table", + irel_dump, idump; + +request do_irel_add_ref, "Add a reference to an inode entry", + irel_add_ref, iaddref, iaddr; + +request do_irel_start_iter_ref, "Start iterating over references to an inode", + irel_start_iter_ref, istartref, istartr; + +request do_irel_next_ref, "Get the next reference for an inode entry", + irel_next_ref, inextref, inextr; + +request do_irel_move, "Move an entry in the inode relocation table", + irel_move, imove; + +request do_irel_delete, "Delete an entry in the inode relocation table", + irel_delete, idelete, idel; + +end; diff --git a/tests/r_1024_small_bg/script b/tests/r_1024_small_bg/script new file mode 100644 index 0000000..cdeb8e3 --- /dev/null +++ b/tests/r_1024_small_bg/script @@ -0,0 +1,30 @@ +test_description="ext2 1024 blocksize with small block groups" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext2 -O ^resize_inode -b 1024 -g 1024" +SIZE_1=64M +SIZE_2=2G +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck + + +. $cmd_dir/scripts/resize_test + +resize_test +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK + diff --git a/tests/r_32to64bit/expect b/tests/r_32to64bit/expect new file mode 100644 index 0000000..de573b3 --- /dev/null +++ b/tests/r_32to64bit/expect @@ -0,0 +1,100 @@ +resize2fs test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img -b +Converting the filesystem to 64-bit. +The filesystem on test.img is now 524288 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,13 +10,13 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 35228 + Free blocks: 589 + Free inodes: 65048 + First block: 1 + Block size: 1024 + Fragment size: 1024 +-Reserved GDT blocks: 256 ++Group descriptor size: 64 ++Reserved GDT blocks: 254 + Blocks per group: 8192 + Fragments per group: 8192 + Inodes per group: 1024 +@@ -43,16 +43,16 @@ + + + group:block:super:gdt:bbitmap:ibitmap:itable +-0:1:1:2-3:260:276:292 +-1:8193:8193:8194-8195:261:277:548 ++0:1:1:2-5:260:276:292 ++1:8193:8193:8194-8197:261:277:548 + 2:16385:-1:-1:262:278:804 +-3:24577:24577:24578-24579:263:279:1060 ++3:24577:24577:24578-24581:263:279:1060 + 4:32769:-1:-1:264:280:1316 +-5:40961:40961:40962-40963:265:281:1572 ++5:40961:40961:40962-40965:265:281:1572 + 6:49153:-1:-1:266:282:1828 +-7:57345:57345:57346-57347:267:283:2084 ++7:57345:57345:57346-57349:267:283:2084 + 8:65537:-1:-1:268:284:2340 +-9:73729:73729:73730-73731:269:285:2596 ++9:73729:73729:73730-73733:269:285:2596 + 10:81921:-1:-1:270:286:2852 + 11:90113:-1:-1:271:287:3108 + 12:98305:-1:-1:272:288:3364 +@@ -68,9 +68,9 @@ + 22:180225:-1:-1:131079:131095:132641 + 23:188417:-1:-1:131080:131096:132897 + 24:196609:-1:-1:131081:131097:133153 +-25:204801:204801:204802-204803:131082:131098:133409 ++25:204801:204801:204802-204805:131082:131098:133409 + 26:212993:-1:-1:131083:131099:133665 +-27:221185:221185:221186-221187:131084:131100:133921 ++27:221185:221185:221186-221189:131084:131100:133921 + 28:229377:-1:-1:131085:131101:134177 + 29:237569:-1:-1:131086:131102:134433 + 30:245761:-1:-1:131087:131103:134689 +@@ -92,7 +92,7 @@ + 46:376833:-1:-1:262159:262175:265761 + 47:385025:-1:-1:262160:262176:266017 + 48:393217:-1:-1:393217:393233:393249 +-49:401409:401409:401410-401411:393218:393234:393505 ++49:401409:401409:401410-401413:393218:393234:393505 + 50:409601:-1:-1:393219:393235:393761 + 51:417793:-1:-1:393220:393236:394017 + 52:425985:-1:-1:393221:393237:394273 +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 + +Exit status is 0 diff --git a/tests/r_32to64bit/name b/tests/r_32to64bit/name new file mode 100644 index 0000000..fb45fab --- /dev/null +++ b/tests/r_32to64bit/name @@ -0,0 +1 @@ +convert flex_bg 32bit fs to 64bit fs diff --git a/tests/r_32to64bit/script b/tests/r_32to64bit/script new file mode 100644 index 0000000..40b8088 --- /dev/null +++ b/tests/r_32to64bit/script @@ -0,0 +1,72 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -b" >> $OUT +$RESIZE2FS -b -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_32to64bit_expand_full/expect b/tests/r_32to64bit_expand_full/expect new file mode 100644 index 0000000..f9e30f3 --- /dev/null +++ b/tests/r_32to64bit_expand_full/expect @@ -0,0 +1,139 @@ +resize2fs test +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 727 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs -b test.img +Converting the filesystem to 64-bit. +The filesystem on test.img is now 786432 (1k) blocks long. + +resize2fs test.img +Resizing the filesystem on test.img to 1179648 (1k) blocks. +The filesystem on test.img is now 1179648 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -1,15 +1,15 @@ + + group:block:super:gdt:bbitmap:ibitmap:itable +-0:1:1:2-7:8:9:10 +-1:8193:8193:8194-8199:8200:8201:8202 ++0:1:1:2-10:266:267:268 ++1:8193:8193:8194-8202:8458:8459:8460 + 2:16385:-1:-1:16385:16386:16387 +-3:24577:24577:24578-24583:24584:24585:24586 ++3:24577:24577:24578-24586:24842:24843:24844 + 4:32769:-1:-1:32769:32770:32771 +-5:40961:40961:40962-40967:40968:40969:40970 ++5:40961:40961:40962-40970:41226:41227:41228 + 6:49153:-1:-1:49153:49154:49155 +-7:57345:57345:57346-57351:57352:57353:57354 ++7:57345:57345:57346-57354:57610:57611:57612 + 8:65537:-1:-1:65537:65538:65539 +-9:73729:73729:73730-73735:73736:73737:73738 ++9:73729:73729:73730-73738:73994:73995:73996 + 10:81921:-1:-1:81921:81922:81923 + 11:90113:-1:-1:90113:90114:90115 + 12:98305:-1:-1:98305:98306:98307 +@@ -25,9 +25,9 @@ + 22:180225:-1:-1:180225:180226:180227 + 23:188417:-1:-1:188417:188418:188419 + 24:196609:-1:-1:196609:196610:196611 +-25:204801:204801:204802-204807:204808:204809:204810 ++25:204801:204801:204802-204810:205066:205067:205068 + 26:212993:-1:-1:212993:212994:212995 +-27:221185:221185:221186-221191:221192:221193:221194 ++27:221185:221185:221186-221194:221450:221451:221452 + 28:229377:-1:-1:229377:229378:229379 + 29:237569:-1:-1:237569:237570:237571 + 30:245761:-1:-1:245761:245762:245763 +@@ -49,7 +49,7 @@ + 46:376833:-1:-1:376833:376834:376835 + 47:385025:-1:-1:385025:385026:385027 + 48:393217:-1:-1:393217:393218:393219 +-49:401409:401409:401410-401415:401416:401417:401418 ++49:401409:401409:401410-401418:401674:401675:401676 + 50:409601:-1:-1:409601:409602:409603 + 51:417793:-1:-1:417793:417794:417795 + 52:425985:-1:-1:425985:425986:425987 +@@ -81,7 +81,7 @@ + 78:638977:-1:-1:638977:638978:638979 + 79:647169:-1:-1:647169:647170:647171 + 80:655361:-1:-1:655361:655362:655363 +-81:663553:663553:663554-663559:663560:663561:663562 ++81:663553:663553:663554-663562:663818:663819:663820 + 82:671745:-1:-1:671745:671746:671747 + 83:679937:-1:-1:679937:679938:679939 + 84:688129:-1:-1:688129:688130:688131 +@@ -96,3 +96,51 @@ + 93:761857:-1:-1:761857:761858:761859 + 94:770049:-1:-1:770049:770050:770051 + 95:778241:-1:-1:778241:778242:778243 ++96:786433:-1:-1:786433:786434:786435 ++97:794625:-1:-1:794625:794626:794627 ++98:802817:-1:-1:802817:802818:802819 ++99:811009:-1:-1:811009:811010:811011 ++100:819201:-1:-1:819201:819202:819203 ++101:827393:-1:-1:827393:827394:827395 ++102:835585:-1:-1:835585:835586:835587 ++103:843777:-1:-1:843777:843778:843779 ++104:851969:-1:-1:851969:851970:851971 ++105:860161:-1:-1:860161:860162:860163 ++106:868353:-1:-1:868353:868354:868355 ++107:876545:-1:-1:876545:876546:876547 ++108:884737:-1:-1:884737:884738:884739 ++109:892929:-1:-1:892929:892930:892931 ++110:901121:-1:-1:901121:901122:901123 ++111:909313:-1:-1:909313:909314:909315 ++112:917505:-1:-1:917505:917506:917507 ++113:925697:-1:-1:925697:925698:925699 ++114:933889:-1:-1:933889:933890:933891 ++115:942081:-1:-1:942081:942082:942083 ++116:950273:-1:-1:950273:950274:950275 ++117:958465:-1:-1:958465:958466:958467 ++118:966657:-1:-1:966657:966658:966659 ++119:974849:-1:-1:974849:974850:974851 ++120:983041:-1:-1:983041:983042:983043 ++121:991233:-1:-1:991233:991234:991235 ++122:999425:-1:-1:999425:999426:999427 ++123:1007617:-1:-1:1007617:1007618:1007619 ++124:1015809:-1:-1:1015809:1015810:1015811 ++125:1024001:1024001:1024002-1024010:1024011:1024012:1024013 ++126:1032193:-1:-1:1032193:1032194:1032195 ++127:1040385:-1:-1:1040385:1040386:1040387 ++128:1048577:-1:-1:1048577:1048578:1048579 ++129:1056769:-1:-1:1056769:1056770:1056771 ++130:1064961:-1:-1:1064961:1064962:1064963 ++131:1073153:-1:-1:1073153:1073154:1073155 ++132:1081345:-1:-1:1081345:1081346:1081347 ++133:1089537:-1:-1:1089537:1089538:1089539 ++134:1097729:-1:-1:1097729:1097730:1097731 ++135:1105921:-1:-1:1105921:1105922:1105923 ++136:1114113:-1:-1:1114113:1114114:1114115 ++137:1122305:-1:-1:1122305:1122306:1122307 ++138:1130497:-1:-1:1130497:1130498:1130499 ++139:1138689:-1:-1:1138689:1138690:1138691 ++140:1146881:-1:-1:1146881:1146882:1146883 ++141:1155073:-1:-1:1155073:1155074:1155075 ++142:1163265:-1:-1:1163265:1163266:1163267 ++143:1171457:-1:-1:1171457:1171458:1171459 +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 + +Exit status is 0 diff --git a/tests/r_32to64bit_expand_full/name b/tests/r_32to64bit_expand_full/name new file mode 100644 index 0000000..34b08c7 --- /dev/null +++ b/tests/r_32to64bit_expand_full/name @@ -0,0 +1 @@ +convert+expand full fs to 64bit diff --git a/tests/r_32to64bit_expand_full/script b/tests/r_32to64bit_expand_full/script new file mode 100644 index 0000000..018f42c --- /dev/null +++ b/tests/r_32to64bit_expand_full/script @@ -0,0 +1,81 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +#gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# check +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# convert it +echo "resize2fs -b test.img" >> $OUT +$RESIZE2FS -b -f $TMPFILE >> $OUT 2>&1 +$DUMPE2FS -g $TMPFILE >> $OUT.before 2> /dev/null + +# grow it +echo "resize2fs test.img" >> $OUT +dd if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=1207959552 2> /dev/null +$RESIZE2FS -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS -g $TMPFILE >> $OUT.after 2> /dev/null +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_32to64bit_meta/expect b/tests/r_32to64bit_meta/expect new file mode 100644 index 0000000..70babbd --- /dev/null +++ b/tests/r_32to64bit_meta/expect @@ -0,0 +1,81 @@ +resize2fs test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 479 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img -b +Converting the filesystem to 64-bit. +The filesystem on test.img is now 524288 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,12 +10,12 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 32912 +-Free blocks: 858 ++Free blocks: 852 + Free inodes: 65046 + First block: 1 + Block size: 1024 + Fragment size: 1024 ++Group descriptor size: 64 + Blocks per group: 8192 + Fragments per group: 8192 + Inodes per group: 1024 +@@ -57,9 +57,9 @@ + 12:98305:-1:-1:15:31:3107 + 13:106497:-1:-1:16:32:3363 + 14:114689:-1:-1:17:33:3619 +-15:122881:-1:-1:18:34:3875 +-16:131073:-1:-1:131073:131089:131105 +-17:139265:-1:-1:131074:131090:131361 ++15:122881:-1:122881:18:34:3875 ++16:131073:-1:131073:135201:131089:131105 ++17:139265:-1:139265:131074:131090:131361 + 18:147457:-1:-1:131075:131091:131617 + 19:155649:-1:-1:131076:131092:131873 + 20:163841:-1:-1:131077:131093:132129 +@@ -89,9 +89,9 @@ + 44:360449:-1:-1:262158:262174:265250 + 45:368641:-1:-1:262159:262175:265506 + 46:376833:-1:-1:262160:262176:265762 +-47:385025:-1:-1:262161:262177:266018 +-48:393217:-1:-1:393217:393233:393249 +-49:401409:401409:-1:393218:393234:393505 ++47:385025:-1:385025:262161:262177:266018 ++48:393217:-1:393217:397345:393233:393249 ++49:401409:401409:401410:393218:393234:393505 + 50:409601:-1:-1:393219:393235:393761 + 51:417793:-1:-1:393220:393236:394017 + 52:425985:-1:-1:393221:393237:394273 +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 + +Exit status is 0 diff --git a/tests/r_32to64bit_meta/name b/tests/r_32to64bit_meta/name new file mode 100644 index 0000000..d83492e --- /dev/null +++ b/tests/r_32to64bit_meta/name @@ -0,0 +1 @@ +convert meta_bg 32bit fs to 64bit fs diff --git a/tests/r_32to64bit_meta/script b/tests/r_32to64bit_meta/script new file mode 100644 index 0000000..20106fd --- /dev/null +++ b/tests/r_32to64bit_meta/script @@ -0,0 +1,72 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,meta_bg,^resize_inode + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -b" >> $OUT +$RESIZE2FS -b -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_32to64bit_move_itable/expect b/tests/r_32to64bit_move_itable/expect new file mode 100644 index 0000000..a1d2aeb --- /dev/null +++ b/tests/r_32to64bit_move_itable/expect @@ -0,0 +1,108 @@ +resize2fs test +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 727 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img -b +Converting the filesystem to 64-bit. +The filesystem on test.img is now 786432 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr dir_index filetype extent sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr dir_index filetype extent 64bit sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,12 +10,12 @@ + Inode count: 98304 + Block count: 786432 + Reserved block count: 39321 +-Overhead clusters: 41193 +-Free blocks: 764 ++Free blocks: 734 + Free inodes: 97566 + First block: 1 + Block size: 1024 + Fragment size: 1024 ++Group descriptor size: 64 + Blocks per group: 8192 + Fragments per group: 8192 + Inodes per group: 1024 +@@ -41,16 +41,16 @@ + + + group:block:super:gdt:bbitmap:ibitmap:itable +-0:1:1:2-4:5:6:7 +-1:8193:8193:8194-8196:8197:8198:8199 ++0:1:1:2-7:8:9:10 ++1:8193:8193:8194-8199:8200:8201:8202 + 2:16385:-1:-1:16385:16386:16387 +-3:24577:24577:24578-24580:24581:24582:24583 ++3:24577:24577:24578-24583:24584:24585:24586 + 4:32769:-1:-1:32769:32770:32771 +-5:40961:40961:40962-40964:40965:40966:40967 ++5:40961:40961:40962-40967:40968:40969:40970 + 6:49153:-1:-1:49153:49154:49155 +-7:57345:57345:57346-57348:57349:57350:57351 ++7:57345:57345:57346-57351:57352:57353:57354 + 8:65537:-1:-1:65537:65538:65539 +-9:73729:73729:73730-73732:73733:73734:73735 ++9:73729:73729:73730-73735:73736:73737:73738 + 10:81921:-1:-1:81921:81922:81923 + 11:90113:-1:-1:90113:90114:90115 + 12:98305:-1:-1:98305:98306:98307 +@@ -66,9 +66,9 @@ + 22:180225:-1:-1:180225:180226:180227 + 23:188417:-1:-1:188417:188418:188419 + 24:196609:-1:-1:196609:196610:196611 +-25:204801:204801:204802-204804:204805:204806:204807 ++25:204801:204801:204802-204807:204808:204809:204810 + 26:212993:-1:-1:212993:212994:212995 +-27:221185:221185:221186-221188:221189:221190:221191 ++27:221185:221185:221186-221191:221192:221193:221194 + 28:229377:-1:-1:229377:229378:229379 + 29:237569:-1:-1:237569:237570:237571 + 30:245761:-1:-1:245761:245762:245763 +@@ -90,7 +90,7 @@ + 46:376833:-1:-1:376833:376834:376835 + 47:385025:-1:-1:385025:385026:385027 + 48:393217:-1:-1:393217:393218:393219 +-49:401409:401409:401410-401412:401413:401414:401415 ++49:401409:401409:401410-401415:401416:401417:401418 + 50:409601:-1:-1:409601:409602:409603 + 51:417793:-1:-1:417793:417794:417795 + 52:425985:-1:-1:425985:425986:425987 +@@ -122,7 +122,7 @@ + 78:638977:-1:-1:638977:638978:638979 + 79:647169:-1:-1:647169:647170:647171 + 80:655361:-1:-1:655361:655362:655363 +-81:663553:663553:663554-663556:663557:663558:663559 ++81:663553:663553:663554-663559:663560:663561:663562 + 82:671745:-1:-1:671745:671746:671747 + 83:679937:-1:-1:679937:679938:679939 + 84:688129:-1:-1:688129:688130:688131 +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 + +Exit status is 0 diff --git a/tests/r_32to64bit_move_itable/name b/tests/r_32to64bit_move_itable/name new file mode 100644 index 0000000..7dc2155 --- /dev/null +++ b/tests/r_32to64bit_move_itable/name @@ -0,0 +1 @@ +convert 32 to 64bit w/ itable move diff --git a/tests/r_32to64bit_move_itable/script b/tests/r_32to64bit_move_itable/script new file mode 100644 index 0000000..0748986 --- /dev/null +++ b/tests/r_32to64bit_move_itable/script @@ -0,0 +1,72 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# convert it +echo "resize2fs test.img -b" >> $OUT +$RESIZE2FS -b -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_64bit_big_expand/is_slow_test b/tests/r_64bit_big_expand/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/r_64bit_big_expand/is_slow_test diff --git a/tests/r_64bit_big_expand/script b/tests/r_64bit_big_expand/script new file mode 100644 index 0000000..d1bf8cd --- /dev/null +++ b/tests/r_64bit_big_expand/script @@ -0,0 +1,35 @@ +test_description="very large fs growth using ext4 w/64bit" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext4 -O 64bit" +SIZE_1=512M +SIZE_2=2T +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck + +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 2TB filesystem + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +. $cmd_dir/scripts/resize_test + +resize_test +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK diff --git a/tests/r_64to32bit/expect b/tests/r_64to32bit/expect new file mode 100644 index 0000000..eb609fb --- /dev/null +++ b/tests/r_64to32bit/expect @@ -0,0 +1,99 @@ +resize2fs test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img -s +Converting the filesystem to 32-bit. +The filesystem on test.img is now 524288 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,13 +10,11 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 35246 +-Free blocks: 571 ++Free blocks: 589 + Free inodes: 65048 + First block: 1 + Block size: 1024 + Fragment size: 1024 +-Group descriptor size: 64 + Reserved GDT blocks: 256 + Blocks per group: 8192 + Fragments per group: 8192 +@@ -44,16 +42,16 @@ + + + group:block:super:gdt:bbitmap:ibitmap:itable +-0:1:1:2-5:262:278:294 +-1:8193:8193:8194-8197:263:279:550 ++0:1:1:2-3:262:278:294 ++1:8193:8193:8194-8195:263:279:550 + 2:16385:-1:-1:264:280:806 +-3:24577:24577:24578-24581:265:281:1062 ++3:24577:24577:24578-24579:265:281:1062 + 4:32769:-1:-1:266:282:1318 +-5:40961:40961:40962-40965:267:283:1574 ++5:40961:40961:40962-40963:267:283:1574 + 6:49153:-1:-1:268:284:1830 +-7:57345:57345:57346-57349:269:285:2086 ++7:57345:57345:57346-57347:269:285:2086 + 8:65537:-1:-1:270:286:2342 +-9:73729:73729:73730-73733:271:287:2598 ++9:73729:73729:73730-73731:271:287:2598 + 10:81921:-1:-1:272:288:2854 + 11:90113:-1:-1:273:289:3110 + 12:98305:-1:-1:274:290:3366 +@@ -69,9 +67,9 @@ + 22:180225:-1:-1:131079:131095:132641 + 23:188417:-1:-1:131080:131096:132897 + 24:196609:-1:-1:131081:131097:133153 +-25:204801:204801:204802-204805:131082:131098:133409 ++25:204801:204801:204802-204803:131082:131098:133409 + 26:212993:-1:-1:131083:131099:133665 +-27:221185:221185:221186-221189:131084:131100:133921 ++27:221185:221185:221186-221187:131084:131100:133921 + 28:229377:-1:-1:131085:131101:134177 + 29:237569:-1:-1:131086:131102:134433 + 30:245761:-1:-1:131087:131103:134689 +@@ -93,7 +91,7 @@ + 46:376833:-1:-1:262159:262175:265761 + 47:385025:-1:-1:262160:262176:266017 + 48:393217:-1:-1:393217:393233:393249 +-49:401409:401409:401410-401413:393218:393234:393505 ++49:401409:401409:401410-401411:393218:393234:393505 + 50:409601:-1:-1:393219:393235:393761 + 51:417793:-1:-1:393220:393236:394017 + 52:425985:-1:-1:393221:393237:394273 +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 + +Exit status is 0 diff --git a/tests/r_64to32bit/name b/tests/r_64to32bit/name new file mode 100644 index 0000000..4c82371 --- /dev/null +++ b/tests/r_64to32bit/name @@ -0,0 +1 @@ +convert flex_bg 64bit fs to 32bit fs diff --git a/tests/r_64to32bit/script b/tests/r_64to32bit/script new file mode 100644 index 0000000..df2b545 --- /dev/null +++ b/tests/r_64to32bit/script @@ -0,0 +1,74 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -s" >> $OUT +$RESIZE2FS -s -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_64to32bit_meta/expect b/tests/r_64to32bit_meta/expect new file mode 100644 index 0000000..7065590 --- /dev/null +++ b/tests/r_64to32bit_meta/expect @@ -0,0 +1,81 @@ +resize2fs test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 479 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img -s +Converting the filesystem to 32-bit. +The filesystem on test.img is now 524288 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -10,13 +10,11 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 32918 +-Free blocks: 852 ++Free blocks: 858 + Free inodes: 65046 + First block: 1 + Block size: 1024 + Fragment size: 1024 +-Group descriptor size: 64 + Blocks per group: 8192 + Fragments per group: 8192 + Inodes per group: 1024 +@@ -58,9 +56,9 @@ + 12:98305:-1:-1:15:31:3107 + 13:106497:-1:-1:16:32:3363 + 14:114689:-1:-1:17:33:3619 +-15:122881:-1:122881:18:34:3875 +-16:131073:-1:131073:131074:131090:131106 +-17:139265:-1:139265:131075:131091:131362 ++15:122881:-1:-1:18:34:3875 ++16:131073:-1:-1:131074:131090:131106 ++17:139265:-1:-1:131075:131091:131362 + 18:147457:-1:-1:131076:131092:131618 + 19:155649:-1:-1:131077:131093:131874 + 20:163841:-1:-1:131078:131094:132130 +@@ -90,9 +88,9 @@ + 44:360449:-1:-1:262158:262174:265250 + 45:368641:-1:-1:262159:262175:265506 + 46:376833:-1:-1:262160:262176:265762 +-47:385025:-1:385025:262161:262177:266018 +-48:393217:-1:393217:393218:393234:393250 +-49:401409:401409:401410:393219:393235:393506 ++47:385025:-1:-1:262161:262177:266018 ++48:393217:-1:-1:393218:393234:393250 ++49:401409:401409:-1:393219:393235:393506 + 50:409601:-1:-1:393220:393236:393762 + 51:417793:-1:-1:393221:393237:394018 + 52:425985:-1:-1:393222:393238:394274 +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 + +Exit status is 0 diff --git a/tests/r_64to32bit_meta/name b/tests/r_64to32bit_meta/name new file mode 100644 index 0000000..e99ed8b --- /dev/null +++ b/tests/r_64to32bit_meta/name @@ -0,0 +1 @@ +convert meta_bg 64bit fs to 32bit fs diff --git a/tests/r_64to32bit_meta/script b/tests/r_64to32bit_meta/script new file mode 100644 index 0000000..5ee9f02 --- /dev/null +++ b/tests/r_64to32bit_meta/script @@ -0,0 +1,74 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,meta_bg,^resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -s" >> $OUT +$RESIZE2FS -s -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_bigalloc_big_expand/script b/tests/r_bigalloc_big_expand/script new file mode 100644 index 0000000..101aafb --- /dev/null +++ b/tests/r_bigalloc_big_expand/script @@ -0,0 +1,36 @@ +test_description="ext4 with bigalloc" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext4 -O bigalloc" +SIZE_1=512M +SIZE_2=2T +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck +RESIZE2FS_OPTS=-f + +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 2TB filesystem + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +. $cmd_dir/scripts/resize_test + +resize_test +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK diff --git a/tests/r_corrupt_fs/expect b/tests/r_corrupt_fs/expect new file mode 100644 index 0000000..fe0f2bc --- /dev/null +++ b/tests/r_corrupt_fs/expect @@ -0,0 +1,4 @@ +mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M +debugfs -w -R "set_bg 1 free_blocks_count 65536" /tmp/foo.img +resize2fs -P /tmp/foo.img +Estimated minimum size of the filesystem: 6604 diff --git a/tests/r_corrupt_fs/name b/tests/r_corrupt_fs/name new file mode 100644 index 0000000..ed62741 --- /dev/null +++ b/tests/r_corrupt_fs/name @@ -0,0 +1 @@ +resize2fs -P of a corrupted file system diff --git a/tests/r_corrupt_fs/script b/tests/r_corrupt_fs/script new file mode 100644 index 0000000..f6d3a89 --- /dev/null +++ b/tests/r_corrupt_fs/script @@ -0,0 +1,45 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +echo mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M > $OUT.new +$MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1 + +echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new +$DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1 + +if timeout -v 1s true > /dev/null 2>&1 ; then + TIMEOUT="timeout -v 30s" +else + TIMEOUT= +fi + +echo resize2fs -P /tmp/foo.img >> $OUT.new +$TIMEOUT $RESIZE2FS -P $TMPFILE >> $OUT.new 2>&1 + +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT + +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE OUT EXP TIMEOUT diff --git a/tests/r_expand_full/expect b/tests/r_expand_full/expect new file mode 100644 index 0000000..c80baa2 --- /dev/null +++ b/tests/r_expand_full/expect @@ -0,0 +1,375 @@ +resize2fs test +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 727 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +resize2fs test.img +Resizing the filesystem on test.img to 3145728 (1k) blocks. +The filesystem on test.img is now 3145728 (1k) blocks long. + +Exit status is 0 +Change in FS metadata: +@@ -1,15 +1,15 @@ + + group:block:super:gdt:bbitmap:ibitmap:itable +-0:1:1:2-4:5:6:7 +-1:8193:8193:8194-8196:8197:8198:8199 ++0:1:1:2-13:263:264:265 ++1:8193:8193:8194-8205:8455:8456:8457 + 2:16385:-1:-1:16385:16386:16387 +-3:24577:24577:24578-24580:24581:24582:24583 ++3:24577:24577:24578-24589:24839:24840:24841 + 4:32769:-1:-1:32769:32770:32771 +-5:40961:40961:40962-40964:40965:40966:40967 ++5:40961:40961:40962-40973:41223:41224:41225 + 6:49153:-1:-1:49153:49154:49155 +-7:57345:57345:57346-57348:57349:57350:57351 ++7:57345:57345:57346-57357:57607:57608:57609 + 8:65537:-1:-1:65537:65538:65539 +-9:73729:73729:73730-73732:73733:73734:73735 ++9:73729:73729:73730-73741:73991:73992:73993 + 10:81921:-1:-1:81921:81922:81923 + 11:90113:-1:-1:90113:90114:90115 + 12:98305:-1:-1:98305:98306:98307 +@@ -25,9 +25,9 @@ + 22:180225:-1:-1:180225:180226:180227 + 23:188417:-1:-1:188417:188418:188419 + 24:196609:-1:-1:196609:196610:196611 +-25:204801:204801:204802-204804:204805:204806:204807 ++25:204801:204801:204802-204813:205063:205064:205065 + 26:212993:-1:-1:212993:212994:212995 +-27:221185:221185:221186-221188:221189:221190:221191 ++27:221185:221185:221186-221197:221447:221448:221449 + 28:229377:-1:-1:229377:229378:229379 + 29:237569:-1:-1:237569:237570:237571 + 30:245761:-1:-1:245761:245762:245763 +@@ -49,7 +49,7 @@ + 46:376833:-1:-1:376833:376834:376835 + 47:385025:-1:-1:385025:385026:385027 + 48:393217:-1:-1:393217:393218:393219 +-49:401409:401409:401410-401412:401413:401414:401415 ++49:401409:401409:401410-401421:401671:401672:401673 + 50:409601:-1:-1:409601:409602:409603 + 51:417793:-1:-1:417793:417794:417795 + 52:425985:-1:-1:425985:425986:425987 +@@ -81,7 +81,7 @@ + 78:638977:-1:-1:638977:638978:638979 + 79:647169:-1:-1:647169:647170:647171 + 80:655361:-1:-1:655361:655362:655363 +-81:663553:663553:663554-663556:663557:663558:663559 ++81:663553:663553:663554-663565:663815:663816:663817 + 82:671745:-1:-1:671745:671746:671747 + 83:679937:-1:-1:679937:679938:679939 + 84:688129:-1:-1:688129:688130:688131 +@@ -96,3 +96,291 @@ + 93:761857:-1:-1:761857:761858:761859 + 94:770049:-1:-1:770049:770050:770051 + 95:778241:-1:-1:778241:778242:778243 ++96:786433:-1:-1:786433:786434:786435 ++97:794625:-1:-1:794625:794626:794627 ++98:802817:-1:-1:802817:802818:802819 ++99:811009:-1:-1:811009:811010:811011 ++100:819201:-1:-1:819201:819202:819203 ++101:827393:-1:-1:827393:827394:827395 ++102:835585:-1:-1:835585:835586:835587 ++103:843777:-1:-1:843777:843778:843779 ++104:851969:-1:-1:851969:851970:851971 ++105:860161:-1:-1:860161:860162:860163 ++106:868353:-1:-1:868353:868354:868355 ++107:876545:-1:-1:876545:876546:876547 ++108:884737:-1:-1:884737:884738:884739 ++109:892929:-1:-1:892929:892930:892931 ++110:901121:-1:-1:901121:901122:901123 ++111:909313:-1:-1:909313:909314:909315 ++112:917505:-1:-1:917505:917506:917507 ++113:925697:-1:-1:925697:925698:925699 ++114:933889:-1:-1:933889:933890:933891 ++115:942081:-1:-1:942081:942082:942083 ++116:950273:-1:-1:950273:950274:950275 ++117:958465:-1:-1:958465:958466:958467 ++118:966657:-1:-1:966657:966658:966659 ++119:974849:-1:-1:974849:974850:974851 ++120:983041:-1:-1:983041:983042:983043 ++121:991233:-1:-1:991233:991234:991235 ++122:999425:-1:-1:999425:999426:999427 ++123:1007617:-1:-1:1007617:1007618:1007619 ++124:1015809:-1:-1:1015809:1015810:1015811 ++125:1024001:1024001:1024002-1024013:1024014:1024015:1024016 ++126:1032193:-1:-1:1032193:1032194:1032195 ++127:1040385:-1:-1:1040385:1040386:1040387 ++128:1048577:-1:-1:1048577:1048578:1048579 ++129:1056769:-1:-1:1056769:1056770:1056771 ++130:1064961:-1:-1:1064961:1064962:1064963 ++131:1073153:-1:-1:1073153:1073154:1073155 ++132:1081345:-1:-1:1081345:1081346:1081347 ++133:1089537:-1:-1:1089537:1089538:1089539 ++134:1097729:-1:-1:1097729:1097730:1097731 ++135:1105921:-1:-1:1105921:1105922:1105923 ++136:1114113:-1:-1:1114113:1114114:1114115 ++137:1122305:-1:-1:1122305:1122306:1122307 ++138:1130497:-1:-1:1130497:1130498:1130499 ++139:1138689:-1:-1:1138689:1138690:1138691 ++140:1146881:-1:-1:1146881:1146882:1146883 ++141:1155073:-1:-1:1155073:1155074:1155075 ++142:1163265:-1:-1:1163265:1163266:1163267 ++143:1171457:-1:-1:1171457:1171458:1171459 ++144:1179649:-1:-1:1179649:1179650:1179651 ++145:1187841:-1:-1:1187841:1187842:1187843 ++146:1196033:-1:-1:1196033:1196034:1196035 ++147:1204225:-1:-1:1204225:1204226:1204227 ++148:1212417:-1:-1:1212417:1212418:1212419 ++149:1220609:-1:-1:1220609:1220610:1220611 ++150:1228801:-1:-1:1228801:1228802:1228803 ++151:1236993:-1:-1:1236993:1236994:1236995 ++152:1245185:-1:-1:1245185:1245186:1245187 ++153:1253377:-1:-1:1253377:1253378:1253379 ++154:1261569:-1:-1:1261569:1261570:1261571 ++155:1269761:-1:-1:1269761:1269762:1269763 ++156:1277953:-1:-1:1277953:1277954:1277955 ++157:1286145:-1:-1:1286145:1286146:1286147 ++158:1294337:-1:-1:1294337:1294338:1294339 ++159:1302529:-1:-1:1302529:1302530:1302531 ++160:1310721:-1:-1:1310721:1310722:1310723 ++161:1318913:-1:-1:1318913:1318914:1318915 ++162:1327105:-1:-1:1327105:1327106:1327107 ++163:1335297:-1:-1:1335297:1335298:1335299 ++164:1343489:-1:-1:1343489:1343490:1343491 ++165:1351681:-1:-1:1351681:1351682:1351683 ++166:1359873:-1:-1:1359873:1359874:1359875 ++167:1368065:-1:-1:1368065:1368066:1368067 ++168:1376257:-1:-1:1376257:1376258:1376259 ++169:1384449:-1:-1:1384449:1384450:1384451 ++170:1392641:-1:-1:1392641:1392642:1392643 ++171:1400833:-1:-1:1400833:1400834:1400835 ++172:1409025:-1:-1:1409025:1409026:1409027 ++173:1417217:-1:-1:1417217:1417218:1417219 ++174:1425409:-1:-1:1425409:1425410:1425411 ++175:1433601:-1:-1:1433601:1433602:1433603 ++176:1441793:-1:-1:1441793:1441794:1441795 ++177:1449985:-1:-1:1449985:1449986:1449987 ++178:1458177:-1:-1:1458177:1458178:1458179 ++179:1466369:-1:-1:1466369:1466370:1466371 ++180:1474561:-1:-1:1474561:1474562:1474563 ++181:1482753:-1:-1:1482753:1482754:1482755 ++182:1490945:-1:-1:1490945:1490946:1490947 ++183:1499137:-1:-1:1499137:1499138:1499139 ++184:1507329:-1:-1:1507329:1507330:1507331 ++185:1515521:-1:-1:1515521:1515522:1515523 ++186:1523713:-1:-1:1523713:1523714:1523715 ++187:1531905:-1:-1:1531905:1531906:1531907 ++188:1540097:-1:-1:1540097:1540098:1540099 ++189:1548289:-1:-1:1548289:1548290:1548291 ++190:1556481:-1:-1:1556481:1556482:1556483 ++191:1564673:-1:-1:1564673:1564674:1564675 ++192:1572865:-1:-1:1572865:1572866:1572867 ++193:1581057:-1:-1:1581057:1581058:1581059 ++194:1589249:-1:-1:1589249:1589250:1589251 ++195:1597441:-1:-1:1597441:1597442:1597443 ++196:1605633:-1:-1:1605633:1605634:1605635 ++197:1613825:-1:-1:1613825:1613826:1613827 ++198:1622017:-1:-1:1622017:1622018:1622019 ++199:1630209:-1:-1:1630209:1630210:1630211 ++200:1638401:-1:-1:1638401:1638402:1638403 ++201:1646593:-1:-1:1646593:1646594:1646595 ++202:1654785:-1:-1:1654785:1654786:1654787 ++203:1662977:-1:-1:1662977:1662978:1662979 ++204:1671169:-1:-1:1671169:1671170:1671171 ++205:1679361:-1:-1:1679361:1679362:1679363 ++206:1687553:-1:-1:1687553:1687554:1687555 ++207:1695745:-1:-1:1695745:1695746:1695747 ++208:1703937:-1:-1:1703937:1703938:1703939 ++209:1712129:-1:-1:1712129:1712130:1712131 ++210:1720321:-1:-1:1720321:1720322:1720323 ++211:1728513:-1:-1:1728513:1728514:1728515 ++212:1736705:-1:-1:1736705:1736706:1736707 ++213:1744897:-1:-1:1744897:1744898:1744899 ++214:1753089:-1:-1:1753089:1753090:1753091 ++215:1761281:-1:-1:1761281:1761282:1761283 ++216:1769473:-1:-1:1769473:1769474:1769475 ++217:1777665:-1:-1:1777665:1777666:1777667 ++218:1785857:-1:-1:1785857:1785858:1785859 ++219:1794049:-1:-1:1794049:1794050:1794051 ++220:1802241:-1:-1:1802241:1802242:1802243 ++221:1810433:-1:-1:1810433:1810434:1810435 ++222:1818625:-1:-1:1818625:1818626:1818627 ++223:1826817:-1:-1:1826817:1826818:1826819 ++224:1835009:-1:-1:1835009:1835010:1835011 ++225:1843201:-1:-1:1843201:1843202:1843203 ++226:1851393:-1:-1:1851393:1851394:1851395 ++227:1859585:-1:-1:1859585:1859586:1859587 ++228:1867777:-1:-1:1867777:1867778:1867779 ++229:1875969:-1:-1:1875969:1875970:1875971 ++230:1884161:-1:-1:1884161:1884162:1884163 ++231:1892353:-1:-1:1892353:1892354:1892355 ++232:1900545:-1:-1:1900545:1900546:1900547 ++233:1908737:-1:-1:1908737:1908738:1908739 ++234:1916929:-1:-1:1916929:1916930:1916931 ++235:1925121:-1:-1:1925121:1925122:1925123 ++236:1933313:-1:-1:1933313:1933314:1933315 ++237:1941505:-1:-1:1941505:1941506:1941507 ++238:1949697:-1:-1:1949697:1949698:1949699 ++239:1957889:-1:-1:1957889:1957890:1957891 ++240:1966081:-1:-1:1966081:1966082:1966083 ++241:1974273:-1:-1:1974273:1974274:1974275 ++242:1982465:-1:-1:1982465:1982466:1982467 ++243:1990657:1990657:1990658-1990669:1990670:1990671:1990672 ++244:1998849:-1:-1:1998849:1998850:1998851 ++245:2007041:-1:-1:2007041:2007042:2007043 ++246:2015233:-1:-1:2015233:2015234:2015235 ++247:2023425:-1:-1:2023425:2023426:2023427 ++248:2031617:-1:-1:2031617:2031618:2031619 ++249:2039809:-1:-1:2039809:2039810:2039811 ++250:2048001:-1:-1:2048001:2048002:2048003 ++251:2056193:-1:-1:2056193:2056194:2056195 ++252:2064385:-1:-1:2064385:2064386:2064387 ++253:2072577:-1:-1:2072577:2072578:2072579 ++254:2080769:-1:-1:2080769:2080770:2080771 ++255:2088961:-1:-1:2088961:2088962:2088963 ++256:2097153:-1:-1:2097153:2097154:2097155 ++257:2105345:-1:-1:2105345:2105346:2105347 ++258:2113537:-1:-1:2113537:2113538:2113539 ++259:2121729:-1:-1:2121729:2121730:2121731 ++260:2129921:-1:-1:2129921:2129922:2129923 ++261:2138113:-1:-1:2138113:2138114:2138115 ++262:2146305:-1:-1:2146305:2146306:2146307 ++263:2154497:-1:-1:2154497:2154498:2154499 ++264:2162689:-1:-1:2162689:2162690:2162691 ++265:2170881:-1:-1:2170881:2170882:2170883 ++266:2179073:-1:-1:2179073:2179074:2179075 ++267:2187265:-1:-1:2187265:2187266:2187267 ++268:2195457:-1:-1:2195457:2195458:2195459 ++269:2203649:-1:-1:2203649:2203650:2203651 ++270:2211841:-1:-1:2211841:2211842:2211843 ++271:2220033:-1:-1:2220033:2220034:2220035 ++272:2228225:-1:-1:2228225:2228226:2228227 ++273:2236417:-1:-1:2236417:2236418:2236419 ++274:2244609:-1:-1:2244609:2244610:2244611 ++275:2252801:-1:-1:2252801:2252802:2252803 ++276:2260993:-1:-1:2260993:2260994:2260995 ++277:2269185:-1:-1:2269185:2269186:2269187 ++278:2277377:-1:-1:2277377:2277378:2277379 ++279:2285569:-1:-1:2285569:2285570:2285571 ++280:2293761:-1:-1:2293761:2293762:2293763 ++281:2301953:-1:-1:2301953:2301954:2301955 ++282:2310145:-1:-1:2310145:2310146:2310147 ++283:2318337:-1:-1:2318337:2318338:2318339 ++284:2326529:-1:-1:2326529:2326530:2326531 ++285:2334721:-1:-1:2334721:2334722:2334723 ++286:2342913:-1:-1:2342913:2342914:2342915 ++287:2351105:-1:-1:2351105:2351106:2351107 ++288:2359297:-1:-1:2359297:2359298:2359299 ++289:2367489:-1:-1:2367489:2367490:2367491 ++290:2375681:-1:-1:2375681:2375682:2375683 ++291:2383873:-1:-1:2383873:2383874:2383875 ++292:2392065:-1:-1:2392065:2392066:2392067 ++293:2400257:-1:-1:2400257:2400258:2400259 ++294:2408449:-1:-1:2408449:2408450:2408451 ++295:2416641:-1:-1:2416641:2416642:2416643 ++296:2424833:-1:-1:2424833:2424834:2424835 ++297:2433025:-1:-1:2433025:2433026:2433027 ++298:2441217:-1:-1:2441217:2441218:2441219 ++299:2449409:-1:-1:2449409:2449410:2449411 ++300:2457601:-1:-1:2457601:2457602:2457603 ++301:2465793:-1:-1:2465793:2465794:2465795 ++302:2473985:-1:-1:2473985:2473986:2473987 ++303:2482177:-1:-1:2482177:2482178:2482179 ++304:2490369:-1:-1:2490369:2490370:2490371 ++305:2498561:-1:-1:2498561:2498562:2498563 ++306:2506753:-1:-1:2506753:2506754:2506755 ++307:2514945:-1:-1:2514945:2514946:2514947 ++308:2523137:-1:-1:2523137:2523138:2523139 ++309:2531329:-1:-1:2531329:2531330:2531331 ++310:2539521:-1:-1:2539521:2539522:2539523 ++311:2547713:-1:-1:2547713:2547714:2547715 ++312:2555905:-1:-1:2555905:2555906:2555907 ++313:2564097:-1:-1:2564097:2564098:2564099 ++314:2572289:-1:-1:2572289:2572290:2572291 ++315:2580481:-1:-1:2580481:2580482:2580483 ++316:2588673:-1:-1:2588673:2588674:2588675 ++317:2596865:-1:-1:2596865:2596866:2596867 ++318:2605057:-1:-1:2605057:2605058:2605059 ++319:2613249:-1:-1:2613249:2613250:2613251 ++320:2621441:-1:-1:2621441:2621442:2621443 ++321:2629633:-1:-1:2629633:2629634:2629635 ++322:2637825:-1:-1:2637825:2637826:2637827 ++323:2646017:-1:-1:2646017:2646018:2646019 ++324:2654209:-1:-1:2654209:2654210:2654211 ++325:2662401:-1:-1:2662401:2662402:2662403 ++326:2670593:-1:-1:2670593:2670594:2670595 ++327:2678785:-1:-1:2678785:2678786:2678787 ++328:2686977:-1:-1:2686977:2686978:2686979 ++329:2695169:-1:-1:2695169:2695170:2695171 ++330:2703361:-1:-1:2703361:2703362:2703363 ++331:2711553:-1:-1:2711553:2711554:2711555 ++332:2719745:-1:-1:2719745:2719746:2719747 ++333:2727937:-1:-1:2727937:2727938:2727939 ++334:2736129:-1:-1:2736129:2736130:2736131 ++335:2744321:-1:-1:2744321:2744322:2744323 ++336:2752513:-1:-1:2752513:2752514:2752515 ++337:2760705:-1:-1:2760705:2760706:2760707 ++338:2768897:-1:-1:2768897:2768898:2768899 ++339:2777089:-1:-1:2777089:2777090:2777091 ++340:2785281:-1:-1:2785281:2785282:2785283 ++341:2793473:-1:-1:2793473:2793474:2793475 ++342:2801665:-1:-1:2801665:2801666:2801667 ++343:2809857:2809857:2809858-2809869:2809870:2809871:2809872 ++344:2818049:-1:-1:2818049:2818050:2818051 ++345:2826241:-1:-1:2826241:2826242:2826243 ++346:2834433:-1:-1:2834433:2834434:2834435 ++347:2842625:-1:-1:2842625:2842626:2842627 ++348:2850817:-1:-1:2850817:2850818:2850819 ++349:2859009:-1:-1:2859009:2859010:2859011 ++350:2867201:-1:-1:2867201:2867202:2867203 ++351:2875393:-1:-1:2875393:2875394:2875395 ++352:2883585:-1:-1:2883585:2883586:2883587 ++353:2891777:-1:-1:2891777:2891778:2891779 ++354:2899969:-1:-1:2899969:2899970:2899971 ++355:2908161:-1:-1:2908161:2908162:2908163 ++356:2916353:-1:-1:2916353:2916354:2916355 ++357:2924545:-1:-1:2924545:2924546:2924547 ++358:2932737:-1:-1:2932737:2932738:2932739 ++359:2940929:-1:-1:2940929:2940930:2940931 ++360:2949121:-1:-1:2949121:2949122:2949123 ++361:2957313:-1:-1:2957313:2957314:2957315 ++362:2965505:-1:-1:2965505:2965506:2965507 ++363:2973697:-1:-1:2973697:2973698:2973699 ++364:2981889:-1:-1:2981889:2981890:2981891 ++365:2990081:-1:-1:2990081:2990082:2990083 ++366:2998273:-1:-1:2998273:2998274:2998275 ++367:3006465:-1:-1:3006465:3006466:3006467 ++368:3014657:-1:-1:3014657:3014658:3014659 ++369:3022849:-1:-1:3022849:3022850:3022851 ++370:3031041:-1:-1:3031041:3031042:3031043 ++371:3039233:-1:-1:3039233:3039234:3039235 ++372:3047425:-1:-1:3047425:3047426:3047427 ++373:3055617:-1:-1:3055617:3055618:3055619 ++374:3063809:-1:-1:3063809:3063810:3063811 ++375:3072001:-1:-1:3072001:3072002:3072003 ++376:3080193:-1:-1:3080193:3080194:3080195 ++377:3088385:-1:-1:3088385:3088386:3088387 ++378:3096577:-1:-1:3096577:3096578:3096579 ++379:3104769:-1:-1:3104769:3104770:3104771 ++380:3112961:-1:-1:3112961:3112962:3112963 ++381:3121153:-1:-1:3121153:3121154:3121155 ++382:3129345:-1:-1:3129345:3129346:3129347 ++383:3137537:-1:-1:3137537:3137538:3137539 +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 + +Exit status is 0 diff --git a/tests/r_expand_full/name b/tests/r_expand_full/name new file mode 100644 index 0000000..af40cba --- /dev/null +++ b/tests/r_expand_full/name @@ -0,0 +1 @@ +expand a totally full filesystem diff --git a/tests/r_expand_full/script b/tests/r_expand_full/script new file mode 100644 index 0000000..8b25652 --- /dev/null +++ b/tests/r_expand_full/script @@ -0,0 +1,83 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +#gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +if [ $(uname -s) = "Darwin" ]; then + # creates a 786MB filesystem + echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" + return 0 +fi + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS -g $TMPFILE >> $OUT.before 2> /dev/null +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# convert it +echo "resize2fs test.img" >> $OUT +$DD if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=3221225471 2> /dev/null +$RESIZE2FS -f $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS -g $TMPFILE >> $OUT.after 2> /dev/null +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/r_ext4_big_expand/is_slow_test b/tests/r_ext4_big_expand/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/r_ext4_big_expand/is_slow_test diff --git a/tests/r_ext4_big_expand/script b/tests/r_ext4_big_expand/script new file mode 100644 index 0000000..a49e4c3 --- /dev/null +++ b/tests/r_ext4_big_expand/script @@ -0,0 +1,35 @@ +test_description="very large fs growth using ext4" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext4" +SIZE_1=512M +SIZE_2=2T +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck + +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 2TB filesystem + echo "$test_name: $test_description: skipped for FreeBSD" + return 0 +fi + +. $cmd_dir/scripts/resize_test + +resize_test +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK diff --git a/tests/r_ext4_small_bg/script b/tests/r_ext4_small_bg/script new file mode 100644 index 0000000..ac7556c --- /dev/null +++ b/tests/r_ext4_small_bg/script @@ -0,0 +1,29 @@ +test_description="ext4 1024 blocksize with small block groups" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext4 -O ^resize_inode -b 1024 -g 512" +SIZE_1=64M +SIZE_2=2G +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck + + +. $cmd_dir/scripts/resize_test + +resize_test +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK diff --git a/tests/r_fixup_lastbg/expect b/tests/r_fixup_lastbg/expect new file mode 100644 index 0000000..96b154a --- /dev/null +++ b/tests/r_fixup_lastbg/expect @@ -0,0 +1,39 @@ +Creating filesystem with 20000 1k blocks and 1248 inodes +Superblock backups stored on blocks: + 8193 + +Allocating group tables: done +Writing inode tables: done +Creating journal (1024 blocks): done +Writing superblocks and filesystem accounting information: done + +Group 2: (Blocks 16385-19999) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 3615 free blocks, 416 free inodes, 0 directories, 416 unused inodes + Free blocks: 16385-19999 + Free inodes: 833-1248 +Group 2: (Blocks 16385-19999) + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 3615 free blocks, 416 free inodes, 0 directories + Free blocks: 16385-19999 + Free inodes: 833-1248 +Resizing the filesystem on test.img to 20004 (1k) blocks. +The filesystem on test.img is now 20004 (1k) blocks long. + +Group 2: (Blocks 16385-20003) [INODE_UNINIT] + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 3619 free blocks, 416 free inodes, 0 directories, 416 unused inodes + Free blocks: 16385-20003 + Free inodes: 833-1248 +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.img: 11/1248 files (0.0% non-contiguous), 1517/20004 blocks diff --git a/tests/r_fixup_lastbg/script b/tests/r_fixup_lastbg/script new file mode 100755 index 0000000..2a54aa7 --- /dev/null +++ b/tests/r_fixup_lastbg/script @@ -0,0 +1,35 @@ +test_description="fix up last bg when expanding within the last bg" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +EXP=$test_dir/expect +OUT=$test_name.log +E2FSCK=../e2fsck/e2fsck + +$MKE2FS -T ext4 -o Linux -b 1024 -F -U 56d3ee50-8532-4f29-8181-d7c6ea4a94a6 $TMPFILE 20000 > $OUT 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT +$DEBUGFS -R "set_bg 2 itable_unused 0" -w $TMPFILE > /dev/null 2>&1 +$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 * 20004)) conv=notrunc >> $OUT 2> /dev/null +$RESIZE2FS_EXE -f -p $TMPFILE 20004 >> $OUT 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT +$E2FSCK -fy $TMPFILE >> $OUT 2>&1 + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? +if [ $status -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT > $test_name.failed +fi + +unset EXP OUT E2FSCK diff --git a/tests/r_fixup_lastbg_big/expect b/tests/r_fixup_lastbg_big/expect new file mode 100644 index 0000000..edaabaf --- /dev/null +++ b/tests/r_fixup_lastbg_big/expect @@ -0,0 +1,45 @@ +Creating filesystem with 20000 1k blocks and 1248 inodes +Superblock backups stored on blocks: + 8193 + +Allocating group tables: done +Writing inode tables: done +Creating journal (1024 blocks): done +Writing superblocks and filesystem accounting information: done + +Group 2: (Blocks 16385-19999) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 3615 free blocks, 416 free inodes, 0 directories, 416 unused inodes + Free blocks: 16385-19999 + Free inodes: 833-1248 +Group 2: (Blocks 16385-19999) + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 3615 free blocks, 416 free inodes, 0 directories + 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] + Block bitmap at 83 (bg #0 + 82) + Inode bitmap at 86 (bg #0 + 85) + Inode table at 295-398 (bg #0 + 294) + 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, ITABLE_ZEROED] + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24656 + Block bitmap at 413 (bg #0 + 412) +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.img: 11/2080 files (0.0% non-contiguous), 1809/40000 blocks diff --git a/tests/r_fixup_lastbg_big/script b/tests/r_fixup_lastbg_big/script new file mode 100755 index 0000000..c13f731 --- /dev/null +++ b/tests/r_fixup_lastbg_big/script @@ -0,0 +1,40 @@ +test_description="fix up last bg when expanding beyond the last bg" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +EXP=$test_dir/expect +OUT=$test_name.log +E2FSCK=../e2fsck/e2fsck + +$MKE2FS -T ext4 -o Linux -b 1024 -F -U 56d3ee50-8532-4f29-8181-d7c6ea4a94a6 $TMPFILE 20000 > $OUT 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT +$DEBUGFS -R "set_bg 2 itable_unused 0" -w $TMPFILE > /dev/null 2>&1 +$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 +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 + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? +if [ $status -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP $OUT > $test_name.failed +fi + +unset EXP OUT E2FSCK diff --git a/tests/r_inline_xattr/expect b/tests/r_inline_xattr/expect new file mode 100644 index 0000000..773db10 --- /dev/null +++ b/tests/r_inline_xattr/expect @@ -0,0 +1,14 @@ +resize2fs test +debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \('' +Inode: 1550 Type: regular Mode: 0644 Flags: 0x0 + user.name (11) = "propervalue" +Exit status is 0 +resize2fs test.img 5M +Resizing the filesystem on test.img to 5120 (1k) blocks. +The filesystem on test.img is now 5120 (1k) blocks long. + +Exit status is 0 +debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \('' +Inode: 12 Type: regular Mode: 0644 Flags: 0x0 + user.name (11) = "propervalue" +Exit status is 0 diff --git a/tests/r_inline_xattr/image.gz b/tests/r_inline_xattr/image.gz Binary files differnew file mode 100644 index 0000000..ead2869 --- /dev/null +++ b/tests/r_inline_xattr/image.gz diff --git a/tests/r_inline_xattr/name b/tests/r_inline_xattr/name new file mode 100644 index 0000000..97654fb --- /dev/null +++ b/tests/r_inline_xattr/name @@ -0,0 +1 @@ +shrinking filesystem with in-inode extended attributes diff --git a/tests/r_inline_xattr/script b/tests/r_inline_xattr/script new file mode 100644 index 0000000..2f754e6 --- /dev/null +++ b/tests/r_inline_xattr/script @@ -0,0 +1,51 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-yf +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $IMAGE > $TMPFILE + +echo "resize2fs test" > $OUT.new + +# Look at existing inline extended attribute +echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new +$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new +status=$? +echo Exit status is $status >> $OUT.new + +# resize it +echo "resize2fs test.img 5M" >> $OUT.new +$RESIZE2FS $TMPFILE 5M >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +# Look at inline extended attribute in resized fs +echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new +$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new +status=$? +echo Exit status is $status >> $OUT.new + +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT +rm $TMPFILE $OUT.new + +# +# Do the verification +# + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_meta_bg_shrink/script b/tests/r_meta_bg_shrink/script new file mode 100644 index 0000000..c39b860 --- /dev/null +++ b/tests/r_meta_bg_shrink/script @@ -0,0 +1,32 @@ +test_description="meta_bg shrink" +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FEATURES="-t ext4 -O 64bit,meta_bg,^resize_inode -b 1024" +SIZE_1=1G +SIZE_2=48M +LOG=$test_name.log +E2FSCK=../e2fsck/e2fsck +RESIZE2FS_OPTS=-f + +. $cmd_dir/scripts/resize_test + +export MKE2FS_FIRST_META_BG=2 +resize_test +unset MKE2FS_FIRST_META_BG + +RC=$? +if [ $RC -eq 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped (no large sparse files)" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + ln $LOG $test_name.failed +fi + +unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK diff --git a/tests/r_min_itable/expect b/tests/r_min_itable/expect new file mode 100644 index 0000000..e01041c --- /dev/null +++ b/tests/r_min_itable/expect @@ -0,0 +1,15 @@ +resize2fs test +resize2fs -M test.img +Resizing the filesystem on test.img to 1124 (1k) blocks. +The filesystem on test.img is now 1124 (1k) blocks long. + +Exit status is 0 + +fsck -yf -N test_filesys test.img +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: 13/512 files (0.0% non-contiguous), 1120/1124 blocks +Exit status is 0 diff --git a/tests/r_min_itable/image.gz b/tests/r_min_itable/image.gz Binary files differnew file mode 100644 index 0000000..7c40c56 --- /dev/null +++ b/tests/r_min_itable/image.gz diff --git a/tests/r_min_itable/name b/tests/r_min_itable/name new file mode 100644 index 0000000..841b043 --- /dev/null +++ b/tests/r_min_itable/name @@ -0,0 +1 @@ +resize2fs -M with inode table in middle of last block group diff --git a/tests/r_min_itable/script b/tests/r_min_itable/script new file mode 100644 index 0000000..16d3f64 --- /dev/null +++ b/tests/r_min_itable/script @@ -0,0 +1,42 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT=-yf +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $IMAGE > $TMPFILE + +echo "resize2fs test" > $OUT.new + +echo "resize2fs -M test.img" >> $OUT.new +$RESIZE2FS -M $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo " " >> $OUT.new +echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm $TMPFILE $OUT.new + +# +# Do the verification +# + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_move_inode_int_extent/expect b/tests/r_move_inode_int_extent/expect new file mode 100644 index 0000000..1de31d0 --- /dev/null +++ b/tests/r_move_inode_int_extent/expect @@ -0,0 +1,15 @@ +resize2fs test +resize2fs test.img 8M +Resizing the filesystem on test.img to 8192 (1k) blocks. +The filesystem on test.img is now 8192 (1k) blocks long. + +Exit status is 0 + +fsck -yf -E fixes_only -N test_filesys test.img +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: 14/2048 files (0.0% non-contiguous), 1445/8192 blocks +Exit status is 0 diff --git a/tests/r_move_inode_int_extent/image.gz b/tests/r_move_inode_int_extent/image.gz Binary files differnew file mode 100644 index 0000000..d5de18f --- /dev/null +++ b/tests/r_move_inode_int_extent/image.gz diff --git a/tests/r_move_inode_int_extent/name b/tests/r_move_inode_int_extent/name new file mode 100644 index 0000000..64a55b5 --- /dev/null +++ b/tests/r_move_inode_int_extent/name @@ -0,0 +1 @@ +move inode and its interior extent tree block diff --git a/tests/r_move_inode_int_extent/script b/tests/r_move_inode_int_extent/script new file mode 100644 index 0000000..9c1a392 --- /dev/null +++ b/tests/r_move_inode_int_extent/script @@ -0,0 +1,42 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +IMAGE=$test_dir/image.gz +FSCK_OPT="-yf -E fixes_only" +OUT=$test_name.log +EXP=$test_dir/expect + +gunzip < $IMAGE > $TMPFILE + +echo "resize2fs test" > $OUT.new + +echo "resize2fs test.img 8M" >> $OUT.new +$RESIZE2FS $TMPFILE 8M >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +echo " " >> $OUT.new +echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed $OUT.new > $OUT +rm $TMPFILE $OUT.new + +# +# Do the verification +# + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_move_itable/expect b/tests/r_move_itable/expect new file mode 100644 index 0000000..74a00fe --- /dev/null +++ b/tests/r_move_itable/expect @@ -0,0 +1,2655 @@ +mke2fs -q -F -o Linux -b 1024 -g 256 -O ^resize_inode test.img 1024 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 128 +Block count: 1024 +Reserved block count: 51 +Overhead clusters: 47 +Free blocks: 964 +Free inodes: 117 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 32 +Inode blocks per group: 8 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-256) + Primary superblock at 1, Group descriptors at 2-2 + Block bitmap at 3 (+2), Inode bitmap at 4 (+3) + Inode table at 5-12 (+4) + 231 free blocks, 21 free inodes, 2 directories + Free blocks: 26-256 + Free inodes: 12-32 +Group 1: (Blocks 257-512) + Backup superblock at 257, Group descriptors at 258-258 + Block bitmap at 259 (+2), Inode bitmap at 260 (+3) + Inode table at 261-268 (+4) + 244 free blocks, 32 free inodes, 0 directories + Free blocks: 269-512 + Free inodes: 33-64 +Group 2: (Blocks 513-768) + Block bitmap at 513 (+0), Inode bitmap at 514 (+1) + Inode table at 515-522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 523-768 + Free inodes: 65-96 +Group 3: (Blocks 769-1023) + Backup superblock at 769, Group descriptors at 770-770 + Block bitmap at 771 (+2), Inode bitmap at 772 (+3) + Inode table at 773-780 (+4) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 781-1023 + Free inodes: 97-128 +resize2fs -p test.img 10000 +Resizing the filesystem on test.img to 9985 (1k) blocks. +Begin pass 1 (max = 35) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 2 (max = 1) +Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 3 (max = 4) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 9985 (1k) blocks long. + +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: 11/1248 files (0.0% non-contiguous), 428/9985 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 1248 +Block count: 9985 +Reserved block count: 497 +Free blocks: 9557 +Free inodes: 1237 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 32 +Inode blocks per group: 8 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-256) + Primary superblock at 1, Group descriptors at 2-3 + Block bitmap at 13 (+12), Inode bitmap at 4 (+3) + Inode table at 5-12 (+4) + 230 free blocks, 21 free inodes, 2 directories + Free blocks: 27-256 + Free inodes: 12-32 +Group 1: (Blocks 257-512) + Backup superblock at 257, Group descriptors at 258-259 + Block bitmap at 269 (+12), Inode bitmap at 260 (+3) + Inode table at 261-268 (+4) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 270-512 + Free inodes: 33-64 +Group 2: (Blocks 513-768) + Block bitmap at 513 (+0), Inode bitmap at 514 (+1) + Inode table at 515-522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 523-768 + Free inodes: 65-96 +Group 3: (Blocks 769-1024) + Backup superblock at 769, Group descriptors at 770-771 + Block bitmap at 781 (+12), Inode bitmap at 772 (+3) + Inode table at 773-780 (+4) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 782-1024 + Free inodes: 97-128 +Group 4: (Blocks 1025-1280) + Block bitmap at 1025 (+0), Inode bitmap at 1026 (+1) + Inode table at 1027-1034 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1035-1280 + Free inodes: 129-160 +Group 5: (Blocks 1281-1536) + Backup superblock at 1281, Group descriptors at 1282-1283 + Block bitmap at 1284 (+3), Inode bitmap at 1285 (+4) + Inode table at 1286-1293 (+5) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 1294-1536 + Free inodes: 161-192 +Group 6: (Blocks 1537-1792) + Block bitmap at 1537 (+0), Inode bitmap at 1538 (+1) + Inode table at 1539-1546 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1547-1792 + Free inodes: 193-224 +Group 7: (Blocks 1793-2048) + Backup superblock at 1793, Group descriptors at 1794-1795 + Block bitmap at 1796 (+3), Inode bitmap at 1797 (+4) + Inode table at 1798-1805 (+5) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 1806-2048 + Free inodes: 225-256 +Group 8: (Blocks 2049-2304) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2058 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2059-2304 + Free inodes: 257-288 +Group 9: (Blocks 2305-2560) + Backup superblock at 2305, Group descriptors at 2306-2307 + Block bitmap at 2308 (+3), Inode bitmap at 2309 (+4) + Inode table at 2310-2317 (+5) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 2318-2560 + Free inodes: 289-320 +Group 10: (Blocks 2561-2816) + Block bitmap at 2561 (+0), Inode bitmap at 2562 (+1) + Inode table at 2563-2570 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2571-2816 + Free inodes: 321-352 +Group 11: (Blocks 2817-3072) + Block bitmap at 2817 (+0), Inode bitmap at 2818 (+1) + Inode table at 2819-2826 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2827-3072 + Free inodes: 353-384 +Group 12: (Blocks 3073-3328) + Block bitmap at 3073 (+0), Inode bitmap at 3074 (+1) + Inode table at 3075-3082 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3083-3328 + Free inodes: 385-416 +Group 13: (Blocks 3329-3584) + Block bitmap at 3329 (+0), Inode bitmap at 3330 (+1) + Inode table at 3331-3338 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3339-3584 + Free inodes: 417-448 +Group 14: (Blocks 3585-3840) + Block bitmap at 3585 (+0), Inode bitmap at 3586 (+1) + Inode table at 3587-3594 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3595-3840 + Free inodes: 449-480 +Group 15: (Blocks 3841-4096) + Block bitmap at 3841 (+0), Inode bitmap at 3842 (+1) + Inode table at 3843-3850 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3851-4096 + Free inodes: 481-512 +Group 16: (Blocks 4097-4352) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4106 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4107-4352 + Free inodes: 513-544 +Group 17: (Blocks 4353-4608) + Block bitmap at 4353 (+0), Inode bitmap at 4354 (+1) + Inode table at 4355-4362 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4363-4608 + Free inodes: 545-576 +Group 18: (Blocks 4609-4864) + Block bitmap at 4609 (+0), Inode bitmap at 4610 (+1) + Inode table at 4611-4618 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4619-4864 + Free inodes: 577-608 +Group 19: (Blocks 4865-5120) + Block bitmap at 4865 (+0), Inode bitmap at 4866 (+1) + Inode table at 4867-4874 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4875-5120 + Free inodes: 609-640 +Group 20: (Blocks 5121-5376) + Block bitmap at 5121 (+0), Inode bitmap at 5122 (+1) + Inode table at 5123-5130 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5131-5376 + Free inodes: 641-672 +Group 21: (Blocks 5377-5632) + Block bitmap at 5377 (+0), Inode bitmap at 5378 (+1) + Inode table at 5379-5386 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5387-5632 + Free inodes: 673-704 +Group 22: (Blocks 5633-5888) + Block bitmap at 5633 (+0), Inode bitmap at 5634 (+1) + Inode table at 5635-5642 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5643-5888 + Free inodes: 705-736 +Group 23: (Blocks 5889-6144) + Block bitmap at 5889 (+0), Inode bitmap at 5890 (+1) + Inode table at 5891-5898 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5899-6144 + Free inodes: 737-768 +Group 24: (Blocks 6145-6400) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6154 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6155-6400 + Free inodes: 769-800 +Group 25: (Blocks 6401-6656) + Backup superblock at 6401, Group descriptors at 6402-6403 + Block bitmap at 6404 (+3), Inode bitmap at 6405 (+4) + Inode table at 6406-6413 (+5) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 6414-6656 + Free inodes: 801-832 +Group 26: (Blocks 6657-6912) + Block bitmap at 6657 (+0), Inode bitmap at 6658 (+1) + Inode table at 6659-6666 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6667-6912 + Free inodes: 833-864 +Group 27: (Blocks 6913-7168) + Backup superblock at 6913, Group descriptors at 6914-6915 + Block bitmap at 6916 (+3), Inode bitmap at 6917 (+4) + Inode table at 6918-6925 (+5) + 243 free blocks, 32 free inodes, 0 directories + Free blocks: 6926-7168 + Free inodes: 865-896 +Group 28: (Blocks 7169-7424) + Block bitmap at 7169 (+0), Inode bitmap at 7170 (+1) + Inode table at 7171-7178 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7179-7424 + Free inodes: 897-928 +Group 29: (Blocks 7425-7680) + Block bitmap at 7425 (+0), Inode bitmap at 7426 (+1) + Inode table at 7427-7434 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7435-7680 + Free inodes: 929-960 +Group 30: (Blocks 7681-7936) + Block bitmap at 7681 (+0), Inode bitmap at 7682 (+1) + Inode table at 7683-7690 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7691-7936 + Free inodes: 961-992 +Group 31: (Blocks 7937-8192) + Block bitmap at 7937 (+0), Inode bitmap at 7938 (+1) + Inode table at 7939-7946 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7947-8192 + Free inodes: 993-1024 +Group 32: (Blocks 8193-8448) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8202 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8203-8448 + Free inodes: 1025-1056 +Group 33: (Blocks 8449-8704) + Block bitmap at 8449 (+0), Inode bitmap at 8450 (+1) + Inode table at 8451-8458 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8459-8704 + Free inodes: 1057-1088 +Group 34: (Blocks 8705-8960) + Block bitmap at 8705 (+0), Inode bitmap at 8706 (+1) + Inode table at 8707-8714 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8715-8960 + Free inodes: 1089-1120 +Group 35: (Blocks 8961-9216) + Block bitmap at 8961 (+0), Inode bitmap at 8962 (+1) + Inode table at 8963-8970 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8971-9216 + Free inodes: 1121-1152 +Group 36: (Blocks 9217-9472) + Block bitmap at 9217 (+0), Inode bitmap at 9218 (+1) + Inode table at 9219-9226 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9227-9472 + Free inodes: 1153-1184 +Group 37: (Blocks 9473-9728) + Block bitmap at 9473 (+0), Inode bitmap at 9474 (+1) + Inode table at 9475-9482 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9483-9728 + Free inodes: 1185-1216 +Group 38: (Blocks 9729-9984) + Block bitmap at 9729 (+0), Inode bitmap at 9730 (+1) + Inode table at 9731-9738 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9739-9984 + Free inodes: 1217-1248 +-------------------------------- +resize2fs -p test.img 20000 +Resizing the filesystem on test.img to 19969 (1k) blocks. +Begin pass 1 (max = 39) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 2 (max = 1) +Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 3 (max = 39) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 19969 (1k) blocks long. + +Filesystem did not have a UUID; generating one. + +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: 11/2496 files (9.1% non-contiguous), 830/19969 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 2496 +Block count: 19969 +Reserved block count: 993 +Free blocks: 19139 +Free inodes: 2485 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 32 +Inode blocks per group: 8 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-256) + Primary superblock at 1, Group descriptors at 2-4 + Block bitmap at 13 (+12), Inode bitmap at 14 (+13) + Inode table at 5-12 (+4) + 229 free blocks, 21 free inodes, 2 directories + Free blocks: 28-256 + Free inodes: 12-32 +Group 1: (Blocks 257-512) + Backup superblock at 257, Group descriptors at 258-260 + Block bitmap at 269 (+12), Inode bitmap at 270 (+13) + Inode table at 261-268 (+4) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 271-512 + Free inodes: 33-64 +Group 2: (Blocks 513-768) + Block bitmap at 513 (+0), Inode bitmap at 514 (+1) + Inode table at 515-522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 523-768 + Free inodes: 65-96 +Group 3: (Blocks 769-1024) + Backup superblock at 769, Group descriptors at 770-772 + Block bitmap at 781 (+12), Inode bitmap at 782 (+13) + Inode table at 773-780 (+4) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 783-1024 + Free inodes: 97-128 +Group 4: (Blocks 1025-1280) + Block bitmap at 1025 (+0), Inode bitmap at 1026 (+1) + Inode table at 1027-1034 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1035-1280 + Free inodes: 129-160 +Group 5: (Blocks 1281-1536) + Backup superblock at 1281, Group descriptors at 1282-1284 + Block bitmap at 1294 (+13), Inode bitmap at 1285 (+4) + Inode table at 1286-1293 (+5) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 1295-1536 + Free inodes: 161-192 +Group 6: (Blocks 1537-1792) + Block bitmap at 1537 (+0), Inode bitmap at 1538 (+1) + Inode table at 1539-1546 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1547-1792 + Free inodes: 193-224 +Group 7: (Blocks 1793-2048) + Backup superblock at 1793, Group descriptors at 1794-1796 + Block bitmap at 1806 (+13), Inode bitmap at 1797 (+4) + Inode table at 1798-1805 (+5) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 1807-2048 + Free inodes: 225-256 +Group 8: (Blocks 2049-2304) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2058 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2059-2304 + Free inodes: 257-288 +Group 9: (Blocks 2305-2560) + Backup superblock at 2305, Group descriptors at 2306-2308 + Block bitmap at 2318 (+13), Inode bitmap at 2309 (+4) + Inode table at 2310-2317 (+5) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 2319-2560 + Free inodes: 289-320 +Group 10: (Blocks 2561-2816) + Block bitmap at 2561 (+0), Inode bitmap at 2562 (+1) + Inode table at 2563-2570 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2571-2816 + Free inodes: 321-352 +Group 11: (Blocks 2817-3072) + Block bitmap at 2817 (+0), Inode bitmap at 2818 (+1) + Inode table at 2819-2826 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2827-3072 + Free inodes: 353-384 +Group 12: (Blocks 3073-3328) + Block bitmap at 3073 (+0), Inode bitmap at 3074 (+1) + Inode table at 3075-3082 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3083-3328 + Free inodes: 385-416 +Group 13: (Blocks 3329-3584) + Block bitmap at 3329 (+0), Inode bitmap at 3330 (+1) + Inode table at 3331-3338 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3339-3584 + Free inodes: 417-448 +Group 14: (Blocks 3585-3840) + Block bitmap at 3585 (+0), Inode bitmap at 3586 (+1) + Inode table at 3587-3594 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3595-3840 + Free inodes: 449-480 +Group 15: (Blocks 3841-4096) + Block bitmap at 3841 (+0), Inode bitmap at 3842 (+1) + Inode table at 3843-3850 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3851-4096 + Free inodes: 481-512 +Group 16: (Blocks 4097-4352) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4106 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4107-4352 + Free inodes: 513-544 +Group 17: (Blocks 4353-4608) + Block bitmap at 4353 (+0), Inode bitmap at 4354 (+1) + Inode table at 4355-4362 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4363-4608 + Free inodes: 545-576 +Group 18: (Blocks 4609-4864) + Block bitmap at 4609 (+0), Inode bitmap at 4610 (+1) + Inode table at 4611-4618 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4619-4864 + Free inodes: 577-608 +Group 19: (Blocks 4865-5120) + Block bitmap at 4865 (+0), Inode bitmap at 4866 (+1) + Inode table at 4867-4874 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4875-5120 + Free inodes: 609-640 +Group 20: (Blocks 5121-5376) + Block bitmap at 5121 (+0), Inode bitmap at 5122 (+1) + Inode table at 5123-5130 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5131-5376 + Free inodes: 641-672 +Group 21: (Blocks 5377-5632) + Block bitmap at 5377 (+0), Inode bitmap at 5378 (+1) + Inode table at 5379-5386 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5387-5632 + Free inodes: 673-704 +Group 22: (Blocks 5633-5888) + Block bitmap at 5633 (+0), Inode bitmap at 5634 (+1) + Inode table at 5635-5642 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5643-5888 + Free inodes: 705-736 +Group 23: (Blocks 5889-6144) + Block bitmap at 5889 (+0), Inode bitmap at 5890 (+1) + Inode table at 5891-5898 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5899-6144 + Free inodes: 737-768 +Group 24: (Blocks 6145-6400) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6154 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6155-6400 + Free inodes: 769-800 +Group 25: (Blocks 6401-6656) + Backup superblock at 6401, Group descriptors at 6402-6404 + Block bitmap at 6414 (+13), Inode bitmap at 6405 (+4) + Inode table at 6406-6413 (+5) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 6415-6656 + Free inodes: 801-832 +Group 26: (Blocks 6657-6912) + Block bitmap at 6657 (+0), Inode bitmap at 6658 (+1) + Inode table at 6659-6666 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6667-6912 + Free inodes: 833-864 +Group 27: (Blocks 6913-7168) + Backup superblock at 6913, Group descriptors at 6914-6916 + Block bitmap at 6926 (+13), Inode bitmap at 6917 (+4) + Inode table at 6918-6925 (+5) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 6927-7168 + Free inodes: 865-896 +Group 28: (Blocks 7169-7424) + Block bitmap at 7169 (+0), Inode bitmap at 7170 (+1) + Inode table at 7171-7178 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7179-7424 + Free inodes: 897-928 +Group 29: (Blocks 7425-7680) + Block bitmap at 7425 (+0), Inode bitmap at 7426 (+1) + Inode table at 7427-7434 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7435-7680 + Free inodes: 929-960 +Group 30: (Blocks 7681-7936) + Block bitmap at 7681 (+0), Inode bitmap at 7682 (+1) + Inode table at 7683-7690 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7691-7936 + Free inodes: 961-992 +Group 31: (Blocks 7937-8192) + Block bitmap at 7937 (+0), Inode bitmap at 7938 (+1) + Inode table at 7939-7946 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7947-8192 + Free inodes: 993-1024 +Group 32: (Blocks 8193-8448) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8202 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8203-8448 + Free inodes: 1025-1056 +Group 33: (Blocks 8449-8704) + Block bitmap at 8449 (+0), Inode bitmap at 8450 (+1) + Inode table at 8451-8458 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8459-8704 + Free inodes: 1057-1088 +Group 34: (Blocks 8705-8960) + Block bitmap at 8705 (+0), Inode bitmap at 8706 (+1) + Inode table at 8707-8714 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8715-8960 + Free inodes: 1089-1120 +Group 35: (Blocks 8961-9216) + Block bitmap at 8961 (+0), Inode bitmap at 8962 (+1) + Inode table at 8963-8970 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8971-9216 + Free inodes: 1121-1152 +Group 36: (Blocks 9217-9472) + Block bitmap at 9217 (+0), Inode bitmap at 9218 (+1) + Inode table at 9219-9226 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9227-9472 + Free inodes: 1153-1184 +Group 37: (Blocks 9473-9728) + Block bitmap at 9473 (+0), Inode bitmap at 9474 (+1) + Inode table at 9475-9482 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9483-9728 + Free inodes: 1185-1216 +Group 38: (Blocks 9729-9984) + Block bitmap at 9729 (+0), Inode bitmap at 9730 (+1) + Inode table at 9731-9738 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9739-9984 + Free inodes: 1217-1248 +Group 39: (Blocks 9985-10240) + Block bitmap at 9985 (+0), Inode bitmap at 9986 (+1) + Inode table at 9987-9994 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9995-10240 + Free inodes: 1249-1280 +Group 40: (Blocks 10241-10496) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10250 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10251-10496 + Free inodes: 1281-1312 +Group 41: (Blocks 10497-10752) + Block bitmap at 10497 (+0), Inode bitmap at 10498 (+1) + Inode table at 10499-10506 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10507-10752 + Free inodes: 1313-1344 +Group 42: (Blocks 10753-11008) + Block bitmap at 10753 (+0), Inode bitmap at 10754 (+1) + Inode table at 10755-10762 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10763-11008 + Free inodes: 1345-1376 +Group 43: (Blocks 11009-11264) + Block bitmap at 11009 (+0), Inode bitmap at 11010 (+1) + Inode table at 11011-11018 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11019-11264 + Free inodes: 1377-1408 +Group 44: (Blocks 11265-11520) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11274 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11275-11520 + Free inodes: 1409-1440 +Group 45: (Blocks 11521-11776) + Block bitmap at 11521 (+0), Inode bitmap at 11522 (+1) + Inode table at 11523-11530 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11531-11776 + Free inodes: 1441-1472 +Group 46: (Blocks 11777-12032) + Block bitmap at 11777 (+0), Inode bitmap at 11778 (+1) + Inode table at 11779-11786 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11787-12032 + Free inodes: 1473-1504 +Group 47: (Blocks 12033-12288) + Block bitmap at 12033 (+0), Inode bitmap at 12034 (+1) + Inode table at 12035-12042 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12043-12288 + Free inodes: 1505-1536 +Group 48: (Blocks 12289-12544) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12298 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12299-12544 + Free inodes: 1537-1568 +Group 49: (Blocks 12545-12800) + Backup superblock at 12545, Group descriptors at 12546-12548 + Block bitmap at 12549 (+4), Inode bitmap at 12550 (+5) + Inode table at 12551-12558 (+6) + 242 free blocks, 32 free inodes, 0 directories + Free blocks: 12559-12800 + Free inodes: 1569-1600 +Group 50: (Blocks 12801-13056) + Block bitmap at 12801 (+0), Inode bitmap at 12802 (+1) + Inode table at 12803-12810 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12811-13056 + Free inodes: 1601-1632 +Group 51: (Blocks 13057-13312) + Block bitmap at 13057 (+0), Inode bitmap at 13058 (+1) + Inode table at 13059-13066 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13067-13312 + Free inodes: 1633-1664 +Group 52: (Blocks 13313-13568) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13322 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13323-13568 + Free inodes: 1665-1696 +Group 53: (Blocks 13569-13824) + Block bitmap at 13569 (+0), Inode bitmap at 13570 (+1) + Inode table at 13571-13578 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13579-13824 + Free inodes: 1697-1728 +Group 54: (Blocks 13825-14080) + Block bitmap at 13825 (+0), Inode bitmap at 13826 (+1) + Inode table at 13827-13834 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13835-14080 + Free inodes: 1729-1760 +Group 55: (Blocks 14081-14336) + Block bitmap at 14081 (+0), Inode bitmap at 14082 (+1) + Inode table at 14083-14090 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14091-14336 + Free inodes: 1761-1792 +Group 56: (Blocks 14337-14592) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14346 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14347-14592 + Free inodes: 1793-1824 +Group 57: (Blocks 14593-14848) + Block bitmap at 14593 (+0), Inode bitmap at 14594 (+1) + Inode table at 14595-14602 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14603-14848 + Free inodes: 1825-1856 +Group 58: (Blocks 14849-15104) + Block bitmap at 14849 (+0), Inode bitmap at 14850 (+1) + Inode table at 14851-14858 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14859-15104 + Free inodes: 1857-1888 +Group 59: (Blocks 15105-15360) + Block bitmap at 15105 (+0), Inode bitmap at 15106 (+1) + Inode table at 15107-15114 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15115-15360 + Free inodes: 1889-1920 +Group 60: (Blocks 15361-15616) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15370 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15371-15616 + Free inodes: 1921-1952 +Group 61: (Blocks 15617-15872) + Block bitmap at 15617 (+0), Inode bitmap at 15618 (+1) + Inode table at 15619-15626 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15627-15872 + Free inodes: 1953-1984 +Group 62: (Blocks 15873-16128) + Block bitmap at 15873 (+0), Inode bitmap at 15874 (+1) + Inode table at 15875-15882 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15883-16128 + Free inodes: 1985-2016 +Group 63: (Blocks 16129-16384) + Block bitmap at 16129 (+0), Inode bitmap at 16130 (+1) + Inode table at 16131-16138 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16139-16384 + Free inodes: 2017-2048 +Group 64: (Blocks 16385-16640) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16394 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16395-16640 + Free inodes: 2049-2080 +Group 65: (Blocks 16641-16896) + Block bitmap at 16641 (+0), Inode bitmap at 16642 (+1) + Inode table at 16643-16650 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16651-16896 + Free inodes: 2081-2112 +Group 66: (Blocks 16897-17152) + Block bitmap at 16897 (+0), Inode bitmap at 16898 (+1) + Inode table at 16899-16906 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16907-17152 + Free inodes: 2113-2144 +Group 67: (Blocks 17153-17408) + Block bitmap at 17153 (+0), Inode bitmap at 17154 (+1) + Inode table at 17155-17162 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17163-17408 + Free inodes: 2145-2176 +Group 68: (Blocks 17409-17664) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17418 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17419-17664 + Free inodes: 2177-2208 +Group 69: (Blocks 17665-17920) + Block bitmap at 17665 (+0), Inode bitmap at 17666 (+1) + Inode table at 17667-17674 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17675-17920 + Free inodes: 2209-2240 +Group 70: (Blocks 17921-18176) + Block bitmap at 17921 (+0), Inode bitmap at 17922 (+1) + Inode table at 17923-17930 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17931-18176 + Free inodes: 2241-2272 +Group 71: (Blocks 18177-18432) + Block bitmap at 18177 (+0), Inode bitmap at 18178 (+1) + Inode table at 18179-18186 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18187-18432 + Free inodes: 2273-2304 +Group 72: (Blocks 18433-18688) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18442 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18443-18688 + Free inodes: 2305-2336 +Group 73: (Blocks 18689-18944) + Block bitmap at 18689 (+0), Inode bitmap at 18690 (+1) + Inode table at 18691-18698 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18699-18944 + Free inodes: 2337-2368 +Group 74: (Blocks 18945-19200) + Block bitmap at 18945 (+0), Inode bitmap at 18946 (+1) + Inode table at 18947-18954 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18955-19200 + Free inodes: 2369-2400 +Group 75: (Blocks 19201-19456) + Block bitmap at 19201 (+0), Inode bitmap at 19202 (+1) + Inode table at 19203-19210 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19211-19456 + Free inodes: 2401-2432 +Group 76: (Blocks 19457-19712) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19466 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19467-19712 + Free inodes: 2433-2464 +Group 77: (Blocks 19713-19968) + Block bitmap at 19713 (+0), Inode bitmap at 19714 (+1) + Inode table at 19715-19722 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19723-19968 + Free inodes: 2465-2496 +-------------------------------- +resize2fs -p test.img 30000 +Resizing the filesystem on test.img to 29953 (1k) blocks. +Begin pass 1 (max = 39) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 2 (max = 8) +Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 3 (max = 78) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 5 (max = 3) +Moving inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 29953 (1k) blocks long. + +Filesystem did not have a UUID; generating one. + +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: 11/3744 files (9.1% non-contiguous), 1234/29953 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 3744 +Block count: 29953 +Reserved block count: 1489 +Free blocks: 28719 +Free inodes: 3733 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 32 +Inode blocks per group: 8 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-256) + Primary superblock at 1, Group descriptors at 2-5 + Block bitmap at 13 (+12), Inode bitmap at 14 (+13) + Inode table at 15-22 (+14) + 228 free blocks, 21 free inodes, 2 directories + Free blocks: 6-12, 36-256 + Free inodes: 12-32 +Group 1: (Blocks 257-512) + Backup superblock at 257, Group descriptors at 258-261 + Block bitmap at 269 (+12), Inode bitmap at 270 (+13) + Inode table at 271-278 (+14) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 262-268, 279-512 + Free inodes: 33-64 +Group 2: (Blocks 513-768) + Block bitmap at 513 (+0), Inode bitmap at 514 (+1) + Inode table at 515-522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 523-768 + Free inodes: 65-96 +Group 3: (Blocks 769-1024) + Backup superblock at 769, Group descriptors at 770-773 + Block bitmap at 781 (+12), Inode bitmap at 782 (+13) + Inode table at 783-790 (+14) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 774-780, 791-1024 + Free inodes: 97-128 +Group 4: (Blocks 1025-1280) + Block bitmap at 1025 (+0), Inode bitmap at 1026 (+1) + Inode table at 1027-1034 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1035-1280 + Free inodes: 129-160 +Group 5: (Blocks 1281-1536) + Backup superblock at 1281, Group descriptors at 1282-1285 + Block bitmap at 1294 (+13), Inode bitmap at 1295 (+14) + Inode table at 1286-1293 (+5) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 1296-1536 + Free inodes: 161-192 +Group 6: (Blocks 1537-1792) + Block bitmap at 1537 (+0), Inode bitmap at 1538 (+1) + Inode table at 1539-1546 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1547-1792 + Free inodes: 193-224 +Group 7: (Blocks 1793-2048) + Backup superblock at 1793, Group descriptors at 1794-1797 + Block bitmap at 1806 (+13), Inode bitmap at 1807 (+14) + Inode table at 1798-1805 (+5) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 1808-2048 + Free inodes: 225-256 +Group 8: (Blocks 2049-2304) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2058 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2059-2304 + Free inodes: 257-288 +Group 9: (Blocks 2305-2560) + Backup superblock at 2305, Group descriptors at 2306-2309 + Block bitmap at 2318 (+13), Inode bitmap at 2319 (+14) + Inode table at 2310-2317 (+5) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 2320-2560 + Free inodes: 289-320 +Group 10: (Blocks 2561-2816) + Block bitmap at 2561 (+0), Inode bitmap at 2562 (+1) + Inode table at 2563-2570 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2571-2816 + Free inodes: 321-352 +Group 11: (Blocks 2817-3072) + Block bitmap at 2817 (+0), Inode bitmap at 2818 (+1) + Inode table at 2819-2826 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2827-3072 + Free inodes: 353-384 +Group 12: (Blocks 3073-3328) + Block bitmap at 3073 (+0), Inode bitmap at 3074 (+1) + Inode table at 3075-3082 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3083-3328 + Free inodes: 385-416 +Group 13: (Blocks 3329-3584) + Block bitmap at 3329 (+0), Inode bitmap at 3330 (+1) + Inode table at 3331-3338 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3339-3584 + Free inodes: 417-448 +Group 14: (Blocks 3585-3840) + Block bitmap at 3585 (+0), Inode bitmap at 3586 (+1) + Inode table at 3587-3594 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3595-3840 + Free inodes: 449-480 +Group 15: (Blocks 3841-4096) + Block bitmap at 3841 (+0), Inode bitmap at 3842 (+1) + Inode table at 3843-3850 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3851-4096 + Free inodes: 481-512 +Group 16: (Blocks 4097-4352) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4106 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4107-4352 + Free inodes: 513-544 +Group 17: (Blocks 4353-4608) + Block bitmap at 4353 (+0), Inode bitmap at 4354 (+1) + Inode table at 4355-4362 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4363-4608 + Free inodes: 545-576 +Group 18: (Blocks 4609-4864) + Block bitmap at 4609 (+0), Inode bitmap at 4610 (+1) + Inode table at 4611-4618 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4619-4864 + Free inodes: 577-608 +Group 19: (Blocks 4865-5120) + Block bitmap at 4865 (+0), Inode bitmap at 4866 (+1) + Inode table at 4867-4874 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4875-5120 + Free inodes: 609-640 +Group 20: (Blocks 5121-5376) + Block bitmap at 5121 (+0), Inode bitmap at 5122 (+1) + Inode table at 5123-5130 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5131-5376 + Free inodes: 641-672 +Group 21: (Blocks 5377-5632) + Block bitmap at 5377 (+0), Inode bitmap at 5378 (+1) + Inode table at 5379-5386 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5387-5632 + Free inodes: 673-704 +Group 22: (Blocks 5633-5888) + Block bitmap at 5633 (+0), Inode bitmap at 5634 (+1) + Inode table at 5635-5642 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5643-5888 + Free inodes: 705-736 +Group 23: (Blocks 5889-6144) + Block bitmap at 5889 (+0), Inode bitmap at 5890 (+1) + Inode table at 5891-5898 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5899-6144 + Free inodes: 737-768 +Group 24: (Blocks 6145-6400) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6154 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6155-6400 + Free inodes: 769-800 +Group 25: (Blocks 6401-6656) + Backup superblock at 6401, Group descriptors at 6402-6405 + Block bitmap at 6414 (+13), Inode bitmap at 6415 (+14) + Inode table at 6406-6413 (+5) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 6416-6656 + Free inodes: 801-832 +Group 26: (Blocks 6657-6912) + Block bitmap at 6657 (+0), Inode bitmap at 6658 (+1) + Inode table at 6659-6666 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6667-6912 + Free inodes: 833-864 +Group 27: (Blocks 6913-7168) + Backup superblock at 6913, Group descriptors at 6914-6917 + Block bitmap at 6926 (+13), Inode bitmap at 6927 (+14) + Inode table at 6918-6925 (+5) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 6928-7168 + Free inodes: 865-896 +Group 28: (Blocks 7169-7424) + Block bitmap at 7169 (+0), Inode bitmap at 7170 (+1) + Inode table at 7171-7178 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7179-7424 + Free inodes: 897-928 +Group 29: (Blocks 7425-7680) + Block bitmap at 7425 (+0), Inode bitmap at 7426 (+1) + Inode table at 7427-7434 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7435-7680 + Free inodes: 929-960 +Group 30: (Blocks 7681-7936) + Block bitmap at 7681 (+0), Inode bitmap at 7682 (+1) + Inode table at 7683-7690 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7691-7936 + Free inodes: 961-992 +Group 31: (Blocks 7937-8192) + Block bitmap at 7937 (+0), Inode bitmap at 7938 (+1) + Inode table at 7939-7946 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7947-8192 + Free inodes: 993-1024 +Group 32: (Blocks 8193-8448) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8202 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8203-8448 + Free inodes: 1025-1056 +Group 33: (Blocks 8449-8704) + Block bitmap at 8449 (+0), Inode bitmap at 8450 (+1) + Inode table at 8451-8458 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8459-8704 + Free inodes: 1057-1088 +Group 34: (Blocks 8705-8960) + Block bitmap at 8705 (+0), Inode bitmap at 8706 (+1) + Inode table at 8707-8714 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8715-8960 + Free inodes: 1089-1120 +Group 35: (Blocks 8961-9216) + Block bitmap at 8961 (+0), Inode bitmap at 8962 (+1) + Inode table at 8963-8970 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8971-9216 + Free inodes: 1121-1152 +Group 36: (Blocks 9217-9472) + Block bitmap at 9217 (+0), Inode bitmap at 9218 (+1) + Inode table at 9219-9226 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9227-9472 + Free inodes: 1153-1184 +Group 37: (Blocks 9473-9728) + Block bitmap at 9473 (+0), Inode bitmap at 9474 (+1) + Inode table at 9475-9482 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9483-9728 + Free inodes: 1185-1216 +Group 38: (Blocks 9729-9984) + Block bitmap at 9729 (+0), Inode bitmap at 9730 (+1) + Inode table at 9731-9738 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9739-9984 + Free inodes: 1217-1248 +Group 39: (Blocks 9985-10240) + Block bitmap at 9985 (+0), Inode bitmap at 9986 (+1) + Inode table at 9987-9994 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9995-10240 + Free inodes: 1249-1280 +Group 40: (Blocks 10241-10496) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10250 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10251-10496 + Free inodes: 1281-1312 +Group 41: (Blocks 10497-10752) + Block bitmap at 10497 (+0), Inode bitmap at 10498 (+1) + Inode table at 10499-10506 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10507-10752 + Free inodes: 1313-1344 +Group 42: (Blocks 10753-11008) + Block bitmap at 10753 (+0), Inode bitmap at 10754 (+1) + Inode table at 10755-10762 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10763-11008 + Free inodes: 1345-1376 +Group 43: (Blocks 11009-11264) + Block bitmap at 11009 (+0), Inode bitmap at 11010 (+1) + Inode table at 11011-11018 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11019-11264 + Free inodes: 1377-1408 +Group 44: (Blocks 11265-11520) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11274 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11275-11520 + Free inodes: 1409-1440 +Group 45: (Blocks 11521-11776) + Block bitmap at 11521 (+0), Inode bitmap at 11522 (+1) + Inode table at 11523-11530 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11531-11776 + Free inodes: 1441-1472 +Group 46: (Blocks 11777-12032) + Block bitmap at 11777 (+0), Inode bitmap at 11778 (+1) + Inode table at 11779-11786 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11787-12032 + Free inodes: 1473-1504 +Group 47: (Blocks 12033-12288) + Block bitmap at 12033 (+0), Inode bitmap at 12034 (+1) + Inode table at 12035-12042 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12043-12288 + Free inodes: 1505-1536 +Group 48: (Blocks 12289-12544) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12298 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12299-12544 + Free inodes: 1537-1568 +Group 49: (Blocks 12545-12800) + Backup superblock at 12545, Group descriptors at 12546-12549 + Block bitmap at 12559 (+14), Inode bitmap at 12550 (+5) + Inode table at 12551-12558 (+6) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 12560-12800 + Free inodes: 1569-1600 +Group 50: (Blocks 12801-13056) + Block bitmap at 12801 (+0), Inode bitmap at 12802 (+1) + Inode table at 12803-12810 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12811-13056 + Free inodes: 1601-1632 +Group 51: (Blocks 13057-13312) + Block bitmap at 13057 (+0), Inode bitmap at 13058 (+1) + Inode table at 13059-13066 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13067-13312 + Free inodes: 1633-1664 +Group 52: (Blocks 13313-13568) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13322 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13323-13568 + Free inodes: 1665-1696 +Group 53: (Blocks 13569-13824) + Block bitmap at 13569 (+0), Inode bitmap at 13570 (+1) + Inode table at 13571-13578 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13579-13824 + Free inodes: 1697-1728 +Group 54: (Blocks 13825-14080) + Block bitmap at 13825 (+0), Inode bitmap at 13826 (+1) + Inode table at 13827-13834 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13835-14080 + Free inodes: 1729-1760 +Group 55: (Blocks 14081-14336) + Block bitmap at 14081 (+0), Inode bitmap at 14082 (+1) + Inode table at 14083-14090 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14091-14336 + Free inodes: 1761-1792 +Group 56: (Blocks 14337-14592) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14346 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14347-14592 + Free inodes: 1793-1824 +Group 57: (Blocks 14593-14848) + Block bitmap at 14593 (+0), Inode bitmap at 14594 (+1) + Inode table at 14595-14602 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14603-14848 + Free inodes: 1825-1856 +Group 58: (Blocks 14849-15104) + Block bitmap at 14849 (+0), Inode bitmap at 14850 (+1) + Inode table at 14851-14858 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14859-15104 + Free inodes: 1857-1888 +Group 59: (Blocks 15105-15360) + Block bitmap at 15105 (+0), Inode bitmap at 15106 (+1) + Inode table at 15107-15114 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15115-15360 + Free inodes: 1889-1920 +Group 60: (Blocks 15361-15616) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15370 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15371-15616 + Free inodes: 1921-1952 +Group 61: (Blocks 15617-15872) + Block bitmap at 15617 (+0), Inode bitmap at 15618 (+1) + Inode table at 15619-15626 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15627-15872 + Free inodes: 1953-1984 +Group 62: (Blocks 15873-16128) + Block bitmap at 15873 (+0), Inode bitmap at 15874 (+1) + Inode table at 15875-15882 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15883-16128 + Free inodes: 1985-2016 +Group 63: (Blocks 16129-16384) + Block bitmap at 16129 (+0), Inode bitmap at 16130 (+1) + Inode table at 16131-16138 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16139-16384 + Free inodes: 2017-2048 +Group 64: (Blocks 16385-16640) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16394 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16395-16640 + Free inodes: 2049-2080 +Group 65: (Blocks 16641-16896) + Block bitmap at 16641 (+0), Inode bitmap at 16642 (+1) + Inode table at 16643-16650 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16651-16896 + Free inodes: 2081-2112 +Group 66: (Blocks 16897-17152) + Block bitmap at 16897 (+0), Inode bitmap at 16898 (+1) + Inode table at 16899-16906 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16907-17152 + Free inodes: 2113-2144 +Group 67: (Blocks 17153-17408) + Block bitmap at 17153 (+0), Inode bitmap at 17154 (+1) + Inode table at 17155-17162 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17163-17408 + Free inodes: 2145-2176 +Group 68: (Blocks 17409-17664) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17418 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17419-17664 + Free inodes: 2177-2208 +Group 69: (Blocks 17665-17920) + Block bitmap at 17665 (+0), Inode bitmap at 17666 (+1) + Inode table at 17667-17674 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17675-17920 + Free inodes: 2209-2240 +Group 70: (Blocks 17921-18176) + Block bitmap at 17921 (+0), Inode bitmap at 17922 (+1) + Inode table at 17923-17930 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17931-18176 + Free inodes: 2241-2272 +Group 71: (Blocks 18177-18432) + Block bitmap at 18177 (+0), Inode bitmap at 18178 (+1) + Inode table at 18179-18186 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18187-18432 + Free inodes: 2273-2304 +Group 72: (Blocks 18433-18688) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18442 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18443-18688 + Free inodes: 2305-2336 +Group 73: (Blocks 18689-18944) + Block bitmap at 18689 (+0), Inode bitmap at 18690 (+1) + Inode table at 18691-18698 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18699-18944 + Free inodes: 2337-2368 +Group 74: (Blocks 18945-19200) + Block bitmap at 18945 (+0), Inode bitmap at 18946 (+1) + Inode table at 18947-18954 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18955-19200 + Free inodes: 2369-2400 +Group 75: (Blocks 19201-19456) + Block bitmap at 19201 (+0), Inode bitmap at 19202 (+1) + Inode table at 19203-19210 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19211-19456 + Free inodes: 2401-2432 +Group 76: (Blocks 19457-19712) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19466 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19467-19712 + Free inodes: 2433-2464 +Group 77: (Blocks 19713-19968) + Block bitmap at 19713 (+0), Inode bitmap at 19714 (+1) + Inode table at 19715-19722 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19723-19968 + Free inodes: 2465-2496 +Group 78: (Blocks 19969-20224) + Block bitmap at 19969 (+0), Inode bitmap at 19970 (+1) + Inode table at 19971-19978 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19979-20224 + Free inodes: 2497-2528 +Group 79: (Blocks 20225-20480) + Block bitmap at 20225 (+0), Inode bitmap at 20226 (+1) + Inode table at 20227-20234 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 20235-20480 + Free inodes: 2529-2560 +Group 80: (Blocks 20481-20736) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20490 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 20491-20736 + Free inodes: 2561-2592 +Group 81: (Blocks 20737-20992) + Backup superblock at 20737, Group descriptors at 20738-20741 + Block bitmap at 20742 (+5), Inode bitmap at 20743 (+6) + Inode table at 20744-20751 (+7) + 241 free blocks, 32 free inodes, 0 directories + Free blocks: 20752-20992 + Free inodes: 2593-2624 +Group 82: (Blocks 20993-21248) + Block bitmap at 20993 (+0), Inode bitmap at 20994 (+1) + Inode table at 20995-21002 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21003-21248 + Free inodes: 2625-2656 +Group 83: (Blocks 21249-21504) + Block bitmap at 21249 (+0), Inode bitmap at 21250 (+1) + Inode table at 21251-21258 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21259-21504 + Free inodes: 2657-2688 +Group 84: (Blocks 21505-21760) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21514 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21515-21760 + Free inodes: 2689-2720 +Group 85: (Blocks 21761-22016) + Block bitmap at 21761 (+0), Inode bitmap at 21762 (+1) + Inode table at 21763-21770 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21771-22016 + Free inodes: 2721-2752 +Group 86: (Blocks 22017-22272) + Block bitmap at 22017 (+0), Inode bitmap at 22018 (+1) + Inode table at 22019-22026 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22027-22272 + Free inodes: 2753-2784 +Group 87: (Blocks 22273-22528) + Block bitmap at 22273 (+0), Inode bitmap at 22274 (+1) + Inode table at 22275-22282 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22283-22528 + Free inodes: 2785-2816 +Group 88: (Blocks 22529-22784) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22538 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22539-22784 + Free inodes: 2817-2848 +Group 89: (Blocks 22785-23040) + Block bitmap at 22785 (+0), Inode bitmap at 22786 (+1) + Inode table at 22787-22794 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22795-23040 + Free inodes: 2849-2880 +Group 90: (Blocks 23041-23296) + Block bitmap at 23041 (+0), Inode bitmap at 23042 (+1) + Inode table at 23043-23050 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23051-23296 + Free inodes: 2881-2912 +Group 91: (Blocks 23297-23552) + Block bitmap at 23297 (+0), Inode bitmap at 23298 (+1) + Inode table at 23299-23306 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23307-23552 + Free inodes: 2913-2944 +Group 92: (Blocks 23553-23808) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23562 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23563-23808 + Free inodes: 2945-2976 +Group 93: (Blocks 23809-24064) + Block bitmap at 23809 (+0), Inode bitmap at 23810 (+1) + Inode table at 23811-23818 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23819-24064 + Free inodes: 2977-3008 +Group 94: (Blocks 24065-24320) + Block bitmap at 24065 (+0), Inode bitmap at 24066 (+1) + Inode table at 24067-24074 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24075-24320 + Free inodes: 3009-3040 +Group 95: (Blocks 24321-24576) + Block bitmap at 24321 (+0), Inode bitmap at 24322 (+1) + Inode table at 24323-24330 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24331-24576 + Free inodes: 3041-3072 +Group 96: (Blocks 24577-24832) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24586 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24587-24832 + Free inodes: 3073-3104 +Group 97: (Blocks 24833-25088) + Block bitmap at 24833 (+0), Inode bitmap at 24834 (+1) + Inode table at 24835-24842 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24843-25088 + Free inodes: 3105-3136 +Group 98: (Blocks 25089-25344) + Block bitmap at 25089 (+0), Inode bitmap at 25090 (+1) + Inode table at 25091-25098 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25099-25344 + Free inodes: 3137-3168 +Group 99: (Blocks 25345-25600) + Block bitmap at 25345 (+0), Inode bitmap at 25346 (+1) + Inode table at 25347-25354 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25355-25600 + Free inodes: 3169-3200 +Group 100: (Blocks 25601-25856) + Block bitmap at 25601 (+0), Inode bitmap at 25602 (+1) + Inode table at 25603-25610 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25611-25856 + Free inodes: 3201-3232 +Group 101: (Blocks 25857-26112) + Block bitmap at 25857 (+0), Inode bitmap at 25858 (+1) + Inode table at 25859-25866 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25867-26112 + Free inodes: 3233-3264 +Group 102: (Blocks 26113-26368) + Block bitmap at 26113 (+0), Inode bitmap at 26114 (+1) + Inode table at 26115-26122 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26123-26368 + Free inodes: 3265-3296 +Group 103: (Blocks 26369-26624) + Block bitmap at 26369 (+0), Inode bitmap at 26370 (+1) + Inode table at 26371-26378 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26379-26624 + Free inodes: 3297-3328 +Group 104: (Blocks 26625-26880) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26634 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26635-26880 + Free inodes: 3329-3360 +Group 105: (Blocks 26881-27136) + Block bitmap at 26881 (+0), Inode bitmap at 26882 (+1) + Inode table at 26883-26890 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26891-27136 + Free inodes: 3361-3392 +Group 106: (Blocks 27137-27392) + Block bitmap at 27137 (+0), Inode bitmap at 27138 (+1) + Inode table at 27139-27146 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27147-27392 + Free inodes: 3393-3424 +Group 107: (Blocks 27393-27648) + Block bitmap at 27393 (+0), Inode bitmap at 27394 (+1) + Inode table at 27395-27402 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27403-27648 + Free inodes: 3425-3456 +Group 108: (Blocks 27649-27904) + Block bitmap at 27649 (+0), Inode bitmap at 27650 (+1) + Inode table at 27651-27658 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27659-27904 + Free inodes: 3457-3488 +Group 109: (Blocks 27905-28160) + Block bitmap at 27905 (+0), Inode bitmap at 27906 (+1) + Inode table at 27907-27914 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27915-28160 + Free inodes: 3489-3520 +Group 110: (Blocks 28161-28416) + Block bitmap at 28161 (+0), Inode bitmap at 28162 (+1) + Inode table at 28163-28170 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28171-28416 + Free inodes: 3521-3552 +Group 111: (Blocks 28417-28672) + Block bitmap at 28417 (+0), Inode bitmap at 28418 (+1) + Inode table at 28419-28426 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28427-28672 + Free inodes: 3553-3584 +Group 112: (Blocks 28673-28928) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28682 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28683-28928 + Free inodes: 3585-3616 +Group 113: (Blocks 28929-29184) + Block bitmap at 28929 (+0), Inode bitmap at 28930 (+1) + Inode table at 28931-28938 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28939-29184 + Free inodes: 3617-3648 +Group 114: (Blocks 29185-29440) + Block bitmap at 29185 (+0), Inode bitmap at 29186 (+1) + Inode table at 29187-29194 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29195-29440 + Free inodes: 3649-3680 +Group 115: (Blocks 29441-29696) + Block bitmap at 29441 (+0), Inode bitmap at 29442 (+1) + Inode table at 29443-29450 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29451-29696 + Free inodes: 3681-3712 +Group 116: (Blocks 29697-29952) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29706 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29707-29952 + Free inodes: 3713-3744 +-------------------------------- +resize2fs -p test.img 40000 +Resizing the filesystem on test.img to 40000 (1k) blocks. +Begin pass 1 (max = 40) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 5 (max = 5) +Moving inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 40000 (1k) blocks long. + +Filesystem did not have a UUID; generating one. + +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: 11/5024 files (9.1% non-contiguous), 1650/40000 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 5024 +Block count: 40000 +Reserved block count: 1988 +Free blocks: 38350 +Free inodes: 5013 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 256 +Fragments per group: 256 +Inodes per group: 32 +Inode blocks per group: 8 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-256) + Primary superblock at 1, Group descriptors at 2-6 + Block bitmap at 13 (+12), Inode bitmap at 14 (+13) + Inode table at 15-22 (+14) + 227 free blocks, 21 free inodes, 2 directories + Free blocks: 7-12, 36-256 + Free inodes: 12-32 +Group 1: (Blocks 257-512) + Backup superblock at 257, Group descriptors at 258-262 + Block bitmap at 269 (+12), Inode bitmap at 270 (+13) + Inode table at 271-278 (+14) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 263-268, 279-512 + Free inodes: 33-64 +Group 2: (Blocks 513-768) + Block bitmap at 513 (+0), Inode bitmap at 514 (+1) + Inode table at 515-522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 523-768 + Free inodes: 65-96 +Group 3: (Blocks 769-1024) + Backup superblock at 769, Group descriptors at 770-774 + Block bitmap at 781 (+12), Inode bitmap at 782 (+13) + Inode table at 783-790 (+14) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 775-780, 791-1024 + Free inodes: 97-128 +Group 4: (Blocks 1025-1280) + Block bitmap at 1025 (+0), Inode bitmap at 1026 (+1) + Inode table at 1027-1034 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1035-1280 + Free inodes: 129-160 +Group 5: (Blocks 1281-1536) + Backup superblock at 1281, Group descriptors at 1282-1286 + Block bitmap at 1294 (+13), Inode bitmap at 1295 (+14) + Inode table at 1296-1303 (+15) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 1287-1293, 1304-1536 + Free inodes: 161-192 +Group 6: (Blocks 1537-1792) + Block bitmap at 1537 (+0), Inode bitmap at 1538 (+1) + Inode table at 1539-1546 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 1547-1792 + Free inodes: 193-224 +Group 7: (Blocks 1793-2048) + Backup superblock at 1793, Group descriptors at 1794-1798 + Block bitmap at 1806 (+13), Inode bitmap at 1807 (+14) + Inode table at 1808-1815 (+15) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 1799-1805, 1816-2048 + Free inodes: 225-256 +Group 8: (Blocks 2049-2304) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2058 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2059-2304 + Free inodes: 257-288 +Group 9: (Blocks 2305-2560) + Backup superblock at 2305, Group descriptors at 2306-2310 + Block bitmap at 2318 (+13), Inode bitmap at 2319 (+14) + Inode table at 2320-2327 (+15) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 2311-2317, 2328-2560 + Free inodes: 289-320 +Group 10: (Blocks 2561-2816) + Block bitmap at 2561 (+0), Inode bitmap at 2562 (+1) + Inode table at 2563-2570 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2571-2816 + Free inodes: 321-352 +Group 11: (Blocks 2817-3072) + Block bitmap at 2817 (+0), Inode bitmap at 2818 (+1) + Inode table at 2819-2826 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 2827-3072 + Free inodes: 353-384 +Group 12: (Blocks 3073-3328) + Block bitmap at 3073 (+0), Inode bitmap at 3074 (+1) + Inode table at 3075-3082 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3083-3328 + Free inodes: 385-416 +Group 13: (Blocks 3329-3584) + Block bitmap at 3329 (+0), Inode bitmap at 3330 (+1) + Inode table at 3331-3338 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3339-3584 + Free inodes: 417-448 +Group 14: (Blocks 3585-3840) + Block bitmap at 3585 (+0), Inode bitmap at 3586 (+1) + Inode table at 3587-3594 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3595-3840 + Free inodes: 449-480 +Group 15: (Blocks 3841-4096) + Block bitmap at 3841 (+0), Inode bitmap at 3842 (+1) + Inode table at 3843-3850 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 3851-4096 + Free inodes: 481-512 +Group 16: (Blocks 4097-4352) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4106 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4107-4352 + Free inodes: 513-544 +Group 17: (Blocks 4353-4608) + Block bitmap at 4353 (+0), Inode bitmap at 4354 (+1) + Inode table at 4355-4362 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4363-4608 + Free inodes: 545-576 +Group 18: (Blocks 4609-4864) + Block bitmap at 4609 (+0), Inode bitmap at 4610 (+1) + Inode table at 4611-4618 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4619-4864 + Free inodes: 577-608 +Group 19: (Blocks 4865-5120) + Block bitmap at 4865 (+0), Inode bitmap at 4866 (+1) + Inode table at 4867-4874 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 4875-5120 + Free inodes: 609-640 +Group 20: (Blocks 5121-5376) + Block bitmap at 5121 (+0), Inode bitmap at 5122 (+1) + Inode table at 5123-5130 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5131-5376 + Free inodes: 641-672 +Group 21: (Blocks 5377-5632) + Block bitmap at 5377 (+0), Inode bitmap at 5378 (+1) + Inode table at 5379-5386 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5387-5632 + Free inodes: 673-704 +Group 22: (Blocks 5633-5888) + Block bitmap at 5633 (+0), Inode bitmap at 5634 (+1) + Inode table at 5635-5642 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5643-5888 + Free inodes: 705-736 +Group 23: (Blocks 5889-6144) + Block bitmap at 5889 (+0), Inode bitmap at 5890 (+1) + Inode table at 5891-5898 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 5899-6144 + Free inodes: 737-768 +Group 24: (Blocks 6145-6400) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6154 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6155-6400 + Free inodes: 769-800 +Group 25: (Blocks 6401-6656) + Backup superblock at 6401, Group descriptors at 6402-6406 + Block bitmap at 6414 (+13), Inode bitmap at 6415 (+14) + Inode table at 6416-6423 (+15) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 6407-6413, 6424-6656 + Free inodes: 801-832 +Group 26: (Blocks 6657-6912) + Block bitmap at 6657 (+0), Inode bitmap at 6658 (+1) + Inode table at 6659-6666 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 6667-6912 + Free inodes: 833-864 +Group 27: (Blocks 6913-7168) + Backup superblock at 6913, Group descriptors at 6914-6918 + Block bitmap at 6926 (+13), Inode bitmap at 6927 (+14) + Inode table at 6928-6935 (+15) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 6919-6925, 6936-7168 + Free inodes: 865-896 +Group 28: (Blocks 7169-7424) + Block bitmap at 7169 (+0), Inode bitmap at 7170 (+1) + Inode table at 7171-7178 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7179-7424 + Free inodes: 897-928 +Group 29: (Blocks 7425-7680) + Block bitmap at 7425 (+0), Inode bitmap at 7426 (+1) + Inode table at 7427-7434 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7435-7680 + Free inodes: 929-960 +Group 30: (Blocks 7681-7936) + Block bitmap at 7681 (+0), Inode bitmap at 7682 (+1) + Inode table at 7683-7690 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7691-7936 + Free inodes: 961-992 +Group 31: (Blocks 7937-8192) + Block bitmap at 7937 (+0), Inode bitmap at 7938 (+1) + Inode table at 7939-7946 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 7947-8192 + Free inodes: 993-1024 +Group 32: (Blocks 8193-8448) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8202 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8203-8448 + Free inodes: 1025-1056 +Group 33: (Blocks 8449-8704) + Block bitmap at 8449 (+0), Inode bitmap at 8450 (+1) + Inode table at 8451-8458 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8459-8704 + Free inodes: 1057-1088 +Group 34: (Blocks 8705-8960) + Block bitmap at 8705 (+0), Inode bitmap at 8706 (+1) + Inode table at 8707-8714 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8715-8960 + Free inodes: 1089-1120 +Group 35: (Blocks 8961-9216) + Block bitmap at 8961 (+0), Inode bitmap at 8962 (+1) + Inode table at 8963-8970 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 8971-9216 + Free inodes: 1121-1152 +Group 36: (Blocks 9217-9472) + Block bitmap at 9217 (+0), Inode bitmap at 9218 (+1) + Inode table at 9219-9226 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9227-9472 + Free inodes: 1153-1184 +Group 37: (Blocks 9473-9728) + Block bitmap at 9473 (+0), Inode bitmap at 9474 (+1) + Inode table at 9475-9482 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9483-9728 + Free inodes: 1185-1216 +Group 38: (Blocks 9729-9984) + Block bitmap at 9729 (+0), Inode bitmap at 9730 (+1) + Inode table at 9731-9738 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9739-9984 + Free inodes: 1217-1248 +Group 39: (Blocks 9985-10240) + Block bitmap at 9985 (+0), Inode bitmap at 9986 (+1) + Inode table at 9987-9994 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 9995-10240 + Free inodes: 1249-1280 +Group 40: (Blocks 10241-10496) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10250 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10251-10496 + Free inodes: 1281-1312 +Group 41: (Blocks 10497-10752) + Block bitmap at 10497 (+0), Inode bitmap at 10498 (+1) + Inode table at 10499-10506 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10507-10752 + Free inodes: 1313-1344 +Group 42: (Blocks 10753-11008) + Block bitmap at 10753 (+0), Inode bitmap at 10754 (+1) + Inode table at 10755-10762 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 10763-11008 + Free inodes: 1345-1376 +Group 43: (Blocks 11009-11264) + Block bitmap at 11009 (+0), Inode bitmap at 11010 (+1) + Inode table at 11011-11018 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11019-11264 + Free inodes: 1377-1408 +Group 44: (Blocks 11265-11520) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11274 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11275-11520 + Free inodes: 1409-1440 +Group 45: (Blocks 11521-11776) + Block bitmap at 11521 (+0), Inode bitmap at 11522 (+1) + Inode table at 11523-11530 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11531-11776 + Free inodes: 1441-1472 +Group 46: (Blocks 11777-12032) + Block bitmap at 11777 (+0), Inode bitmap at 11778 (+1) + Inode table at 11779-11786 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 11787-12032 + Free inodes: 1473-1504 +Group 47: (Blocks 12033-12288) + Block bitmap at 12033 (+0), Inode bitmap at 12034 (+1) + Inode table at 12035-12042 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12043-12288 + Free inodes: 1505-1536 +Group 48: (Blocks 12289-12544) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12298 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12299-12544 + Free inodes: 1537-1568 +Group 49: (Blocks 12545-12800) + Backup superblock at 12545, Group descriptors at 12546-12550 + Block bitmap at 12559 (+14), Inode bitmap at 12560 (+15) + Inode table at 12551-12558 (+6) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 12561-12800 + Free inodes: 1569-1600 +Group 50: (Blocks 12801-13056) + Block bitmap at 12801 (+0), Inode bitmap at 12802 (+1) + Inode table at 12803-12810 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 12811-13056 + Free inodes: 1601-1632 +Group 51: (Blocks 13057-13312) + Block bitmap at 13057 (+0), Inode bitmap at 13058 (+1) + Inode table at 13059-13066 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13067-13312 + Free inodes: 1633-1664 +Group 52: (Blocks 13313-13568) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13322 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13323-13568 + Free inodes: 1665-1696 +Group 53: (Blocks 13569-13824) + Block bitmap at 13569 (+0), Inode bitmap at 13570 (+1) + Inode table at 13571-13578 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13579-13824 + Free inodes: 1697-1728 +Group 54: (Blocks 13825-14080) + Block bitmap at 13825 (+0), Inode bitmap at 13826 (+1) + Inode table at 13827-13834 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 13835-14080 + Free inodes: 1729-1760 +Group 55: (Blocks 14081-14336) + Block bitmap at 14081 (+0), Inode bitmap at 14082 (+1) + Inode table at 14083-14090 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14091-14336 + Free inodes: 1761-1792 +Group 56: (Blocks 14337-14592) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14346 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14347-14592 + Free inodes: 1793-1824 +Group 57: (Blocks 14593-14848) + Block bitmap at 14593 (+0), Inode bitmap at 14594 (+1) + Inode table at 14595-14602 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14603-14848 + Free inodes: 1825-1856 +Group 58: (Blocks 14849-15104) + Block bitmap at 14849 (+0), Inode bitmap at 14850 (+1) + Inode table at 14851-14858 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 14859-15104 + Free inodes: 1857-1888 +Group 59: (Blocks 15105-15360) + Block bitmap at 15105 (+0), Inode bitmap at 15106 (+1) + Inode table at 15107-15114 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15115-15360 + Free inodes: 1889-1920 +Group 60: (Blocks 15361-15616) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15370 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15371-15616 + Free inodes: 1921-1952 +Group 61: (Blocks 15617-15872) + Block bitmap at 15617 (+0), Inode bitmap at 15618 (+1) + Inode table at 15619-15626 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15627-15872 + Free inodes: 1953-1984 +Group 62: (Blocks 15873-16128) + Block bitmap at 15873 (+0), Inode bitmap at 15874 (+1) + Inode table at 15875-15882 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 15883-16128 + Free inodes: 1985-2016 +Group 63: (Blocks 16129-16384) + Block bitmap at 16129 (+0), Inode bitmap at 16130 (+1) + Inode table at 16131-16138 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16139-16384 + Free inodes: 2017-2048 +Group 64: (Blocks 16385-16640) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16394 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16395-16640 + Free inodes: 2049-2080 +Group 65: (Blocks 16641-16896) + Block bitmap at 16641 (+0), Inode bitmap at 16642 (+1) + Inode table at 16643-16650 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16651-16896 + Free inodes: 2081-2112 +Group 66: (Blocks 16897-17152) + Block bitmap at 16897 (+0), Inode bitmap at 16898 (+1) + Inode table at 16899-16906 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 16907-17152 + Free inodes: 2113-2144 +Group 67: (Blocks 17153-17408) + Block bitmap at 17153 (+0), Inode bitmap at 17154 (+1) + Inode table at 17155-17162 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17163-17408 + Free inodes: 2145-2176 +Group 68: (Blocks 17409-17664) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17418 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17419-17664 + Free inodes: 2177-2208 +Group 69: (Blocks 17665-17920) + Block bitmap at 17665 (+0), Inode bitmap at 17666 (+1) + Inode table at 17667-17674 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17675-17920 + Free inodes: 2209-2240 +Group 70: (Blocks 17921-18176) + Block bitmap at 17921 (+0), Inode bitmap at 17922 (+1) + Inode table at 17923-17930 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 17931-18176 + Free inodes: 2241-2272 +Group 71: (Blocks 18177-18432) + Block bitmap at 18177 (+0), Inode bitmap at 18178 (+1) + Inode table at 18179-18186 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18187-18432 + Free inodes: 2273-2304 +Group 72: (Blocks 18433-18688) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18442 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18443-18688 + Free inodes: 2305-2336 +Group 73: (Blocks 18689-18944) + Block bitmap at 18689 (+0), Inode bitmap at 18690 (+1) + Inode table at 18691-18698 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18699-18944 + Free inodes: 2337-2368 +Group 74: (Blocks 18945-19200) + Block bitmap at 18945 (+0), Inode bitmap at 18946 (+1) + Inode table at 18947-18954 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 18955-19200 + Free inodes: 2369-2400 +Group 75: (Blocks 19201-19456) + Block bitmap at 19201 (+0), Inode bitmap at 19202 (+1) + Inode table at 19203-19210 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19211-19456 + Free inodes: 2401-2432 +Group 76: (Blocks 19457-19712) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19466 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19467-19712 + Free inodes: 2433-2464 +Group 77: (Blocks 19713-19968) + Block bitmap at 19713 (+0), Inode bitmap at 19714 (+1) + Inode table at 19715-19722 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19723-19968 + Free inodes: 2465-2496 +Group 78: (Blocks 19969-20224) + Block bitmap at 19969 (+0), Inode bitmap at 19970 (+1) + Inode table at 19971-19978 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 19979-20224 + Free inodes: 2497-2528 +Group 79: (Blocks 20225-20480) + Block bitmap at 20225 (+0), Inode bitmap at 20226 (+1) + Inode table at 20227-20234 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 20235-20480 + Free inodes: 2529-2560 +Group 80: (Blocks 20481-20736) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20490 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 20491-20736 + Free inodes: 2561-2592 +Group 81: (Blocks 20737-20992) + Backup superblock at 20737, Group descriptors at 20738-20742 + Block bitmap at 20752 (+15), Inode bitmap at 20743 (+6) + Inode table at 20744-20751 (+7) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 20753-20992 + Free inodes: 2593-2624 +Group 82: (Blocks 20993-21248) + Block bitmap at 20993 (+0), Inode bitmap at 20994 (+1) + Inode table at 20995-21002 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21003-21248 + Free inodes: 2625-2656 +Group 83: (Blocks 21249-21504) + Block bitmap at 21249 (+0), Inode bitmap at 21250 (+1) + Inode table at 21251-21258 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21259-21504 + Free inodes: 2657-2688 +Group 84: (Blocks 21505-21760) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21514 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21515-21760 + Free inodes: 2689-2720 +Group 85: (Blocks 21761-22016) + Block bitmap at 21761 (+0), Inode bitmap at 21762 (+1) + Inode table at 21763-21770 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 21771-22016 + Free inodes: 2721-2752 +Group 86: (Blocks 22017-22272) + Block bitmap at 22017 (+0), Inode bitmap at 22018 (+1) + Inode table at 22019-22026 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22027-22272 + Free inodes: 2753-2784 +Group 87: (Blocks 22273-22528) + Block bitmap at 22273 (+0), Inode bitmap at 22274 (+1) + Inode table at 22275-22282 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22283-22528 + Free inodes: 2785-2816 +Group 88: (Blocks 22529-22784) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22538 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22539-22784 + Free inodes: 2817-2848 +Group 89: (Blocks 22785-23040) + Block bitmap at 22785 (+0), Inode bitmap at 22786 (+1) + Inode table at 22787-22794 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 22795-23040 + Free inodes: 2849-2880 +Group 90: (Blocks 23041-23296) + Block bitmap at 23041 (+0), Inode bitmap at 23042 (+1) + Inode table at 23043-23050 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23051-23296 + Free inodes: 2881-2912 +Group 91: (Blocks 23297-23552) + Block bitmap at 23297 (+0), Inode bitmap at 23298 (+1) + Inode table at 23299-23306 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23307-23552 + Free inodes: 2913-2944 +Group 92: (Blocks 23553-23808) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23562 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23563-23808 + Free inodes: 2945-2976 +Group 93: (Blocks 23809-24064) + Block bitmap at 23809 (+0), Inode bitmap at 23810 (+1) + Inode table at 23811-23818 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 23819-24064 + Free inodes: 2977-3008 +Group 94: (Blocks 24065-24320) + Block bitmap at 24065 (+0), Inode bitmap at 24066 (+1) + Inode table at 24067-24074 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24075-24320 + Free inodes: 3009-3040 +Group 95: (Blocks 24321-24576) + Block bitmap at 24321 (+0), Inode bitmap at 24322 (+1) + Inode table at 24323-24330 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24331-24576 + Free inodes: 3041-3072 +Group 96: (Blocks 24577-24832) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24586 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24587-24832 + Free inodes: 3073-3104 +Group 97: (Blocks 24833-25088) + Block bitmap at 24833 (+0), Inode bitmap at 24834 (+1) + Inode table at 24835-24842 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 24843-25088 + Free inodes: 3105-3136 +Group 98: (Blocks 25089-25344) + Block bitmap at 25089 (+0), Inode bitmap at 25090 (+1) + Inode table at 25091-25098 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25099-25344 + Free inodes: 3137-3168 +Group 99: (Blocks 25345-25600) + Block bitmap at 25345 (+0), Inode bitmap at 25346 (+1) + Inode table at 25347-25354 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25355-25600 + Free inodes: 3169-3200 +Group 100: (Blocks 25601-25856) + Block bitmap at 25601 (+0), Inode bitmap at 25602 (+1) + Inode table at 25603-25610 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25611-25856 + Free inodes: 3201-3232 +Group 101: (Blocks 25857-26112) + Block bitmap at 25857 (+0), Inode bitmap at 25858 (+1) + Inode table at 25859-25866 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 25867-26112 + Free inodes: 3233-3264 +Group 102: (Blocks 26113-26368) + Block bitmap at 26113 (+0), Inode bitmap at 26114 (+1) + Inode table at 26115-26122 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26123-26368 + Free inodes: 3265-3296 +Group 103: (Blocks 26369-26624) + Block bitmap at 26369 (+0), Inode bitmap at 26370 (+1) + Inode table at 26371-26378 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26379-26624 + Free inodes: 3297-3328 +Group 104: (Blocks 26625-26880) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26634 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26635-26880 + Free inodes: 3329-3360 +Group 105: (Blocks 26881-27136) + Block bitmap at 26881 (+0), Inode bitmap at 26882 (+1) + Inode table at 26883-26890 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 26891-27136 + Free inodes: 3361-3392 +Group 106: (Blocks 27137-27392) + Block bitmap at 27137 (+0), Inode bitmap at 27138 (+1) + Inode table at 27139-27146 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27147-27392 + Free inodes: 3393-3424 +Group 107: (Blocks 27393-27648) + Block bitmap at 27393 (+0), Inode bitmap at 27394 (+1) + Inode table at 27395-27402 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27403-27648 + Free inodes: 3425-3456 +Group 108: (Blocks 27649-27904) + Block bitmap at 27649 (+0), Inode bitmap at 27650 (+1) + Inode table at 27651-27658 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27659-27904 + Free inodes: 3457-3488 +Group 109: (Blocks 27905-28160) + Block bitmap at 27905 (+0), Inode bitmap at 27906 (+1) + Inode table at 27907-27914 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 27915-28160 + Free inodes: 3489-3520 +Group 110: (Blocks 28161-28416) + Block bitmap at 28161 (+0), Inode bitmap at 28162 (+1) + Inode table at 28163-28170 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28171-28416 + Free inodes: 3521-3552 +Group 111: (Blocks 28417-28672) + Block bitmap at 28417 (+0), Inode bitmap at 28418 (+1) + Inode table at 28419-28426 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28427-28672 + Free inodes: 3553-3584 +Group 112: (Blocks 28673-28928) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28682 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28683-28928 + Free inodes: 3585-3616 +Group 113: (Blocks 28929-29184) + Block bitmap at 28929 (+0), Inode bitmap at 28930 (+1) + Inode table at 28931-28938 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 28939-29184 + Free inodes: 3617-3648 +Group 114: (Blocks 29185-29440) + Block bitmap at 29185 (+0), Inode bitmap at 29186 (+1) + Inode table at 29187-29194 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29195-29440 + Free inodes: 3649-3680 +Group 115: (Blocks 29441-29696) + Block bitmap at 29441 (+0), Inode bitmap at 29442 (+1) + Inode table at 29443-29450 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29451-29696 + Free inodes: 3681-3712 +Group 116: (Blocks 29697-29952) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29706 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29707-29952 + Free inodes: 3713-3744 +Group 117: (Blocks 29953-30208) + Block bitmap at 29953 (+0), Inode bitmap at 29954 (+1) + Inode table at 29955-29962 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 29963-30208 + Free inodes: 3745-3776 +Group 118: (Blocks 30209-30464) + Block bitmap at 30209 (+0), Inode bitmap at 30210 (+1) + Inode table at 30211-30218 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 30219-30464 + Free inodes: 3777-3808 +Group 119: (Blocks 30465-30720) + Block bitmap at 30465 (+0), Inode bitmap at 30466 (+1) + Inode table at 30467-30474 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 30475-30720 + Free inodes: 3809-3840 +Group 120: (Blocks 30721-30976) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30730 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 30731-30976 + Free inodes: 3841-3872 +Group 121: (Blocks 30977-31232) + Block bitmap at 30977 (+0), Inode bitmap at 30978 (+1) + Inode table at 30979-30986 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 30987-31232 + Free inodes: 3873-3904 +Group 122: (Blocks 31233-31488) + Block bitmap at 31233 (+0), Inode bitmap at 31234 (+1) + Inode table at 31235-31242 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 31243-31488 + Free inodes: 3905-3936 +Group 123: (Blocks 31489-31744) + Block bitmap at 31489 (+0), Inode bitmap at 31490 (+1) + Inode table at 31491-31498 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 31499-31744 + Free inodes: 3937-3968 +Group 124: (Blocks 31745-32000) + Block bitmap at 31745 (+0), Inode bitmap at 31746 (+1) + Inode table at 31747-31754 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 31755-32000 + Free inodes: 3969-4000 +Group 125: (Blocks 32001-32256) + Backup superblock at 32001, Group descriptors at 32002-32006 + Block bitmap at 32007 (+6), Inode bitmap at 32008 (+7) + Inode table at 32009-32016 (+8) + 240 free blocks, 32 free inodes, 0 directories + Free blocks: 32017-32256 + Free inodes: 4001-4032 +Group 126: (Blocks 32257-32512) + Block bitmap at 32257 (+0), Inode bitmap at 32258 (+1) + Inode table at 32259-32266 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 32267-32512 + Free inodes: 4033-4064 +Group 127: (Blocks 32513-32768) + Block bitmap at 32513 (+0), Inode bitmap at 32514 (+1) + Inode table at 32515-32522 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 32523-32768 + Free inodes: 4065-4096 +Group 128: (Blocks 32769-33024) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-32778 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 32779-33024 + Free inodes: 4097-4128 +Group 129: (Blocks 33025-33280) + Block bitmap at 33025 (+0), Inode bitmap at 33026 (+1) + Inode table at 33027-33034 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 33035-33280 + Free inodes: 4129-4160 +Group 130: (Blocks 33281-33536) + Block bitmap at 33281 (+0), Inode bitmap at 33282 (+1) + Inode table at 33283-33290 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 33291-33536 + Free inodes: 4161-4192 +Group 131: (Blocks 33537-33792) + Block bitmap at 33537 (+0), Inode bitmap at 33538 (+1) + Inode table at 33539-33546 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 33547-33792 + Free inodes: 4193-4224 +Group 132: (Blocks 33793-34048) + Block bitmap at 33793 (+0), Inode bitmap at 33794 (+1) + Inode table at 33795-33802 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 33803-34048 + Free inodes: 4225-4256 +Group 133: (Blocks 34049-34304) + Block bitmap at 34049 (+0), Inode bitmap at 34050 (+1) + Inode table at 34051-34058 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 34059-34304 + Free inodes: 4257-4288 +Group 134: (Blocks 34305-34560) + Block bitmap at 34305 (+0), Inode bitmap at 34306 (+1) + Inode table at 34307-34314 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 34315-34560 + Free inodes: 4289-4320 +Group 135: (Blocks 34561-34816) + Block bitmap at 34561 (+0), Inode bitmap at 34562 (+1) + Inode table at 34563-34570 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 34571-34816 + Free inodes: 4321-4352 +Group 136: (Blocks 34817-35072) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34826 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 34827-35072 + Free inodes: 4353-4384 +Group 137: (Blocks 35073-35328) + Block bitmap at 35073 (+0), Inode bitmap at 35074 (+1) + Inode table at 35075-35082 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 35083-35328 + Free inodes: 4385-4416 +Group 138: (Blocks 35329-35584) + Block bitmap at 35329 (+0), Inode bitmap at 35330 (+1) + Inode table at 35331-35338 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 35339-35584 + Free inodes: 4417-4448 +Group 139: (Blocks 35585-35840) + Block bitmap at 35585 (+0), Inode bitmap at 35586 (+1) + Inode table at 35587-35594 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 35595-35840 + Free inodes: 4449-4480 +Group 140: (Blocks 35841-36096) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35850 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 35851-36096 + Free inodes: 4481-4512 +Group 141: (Blocks 36097-36352) + Block bitmap at 36097 (+0), Inode bitmap at 36098 (+1) + Inode table at 36099-36106 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 36107-36352 + Free inodes: 4513-4544 +Group 142: (Blocks 36353-36608) + Block bitmap at 36353 (+0), Inode bitmap at 36354 (+1) + Inode table at 36355-36362 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 36363-36608 + Free inodes: 4545-4576 +Group 143: (Blocks 36609-36864) + Block bitmap at 36609 (+0), Inode bitmap at 36610 (+1) + Inode table at 36611-36618 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 36619-36864 + Free inodes: 4577-4608 +Group 144: (Blocks 36865-37120) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36874 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 36875-37120 + Free inodes: 4609-4640 +Group 145: (Blocks 37121-37376) + Block bitmap at 37121 (+0), Inode bitmap at 37122 (+1) + Inode table at 37123-37130 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 37131-37376 + Free inodes: 4641-4672 +Group 146: (Blocks 37377-37632) + Block bitmap at 37377 (+0), Inode bitmap at 37378 (+1) + Inode table at 37379-37386 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 37387-37632 + Free inodes: 4673-4704 +Group 147: (Blocks 37633-37888) + Block bitmap at 37633 (+0), Inode bitmap at 37634 (+1) + Inode table at 37635-37642 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 37643-37888 + Free inodes: 4705-4736 +Group 148: (Blocks 37889-38144) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37898 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 37899-38144 + Free inodes: 4737-4768 +Group 149: (Blocks 38145-38400) + Block bitmap at 38145 (+0), Inode bitmap at 38146 (+1) + Inode table at 38147-38154 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 38155-38400 + Free inodes: 4769-4800 +Group 150: (Blocks 38401-38656) + Block bitmap at 38401 (+0), Inode bitmap at 38402 (+1) + Inode table at 38403-38410 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 38411-38656 + Free inodes: 4801-4832 +Group 151: (Blocks 38657-38912) + Block bitmap at 38657 (+0), Inode bitmap at 38658 (+1) + Inode table at 38659-38666 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 38667-38912 + Free inodes: 4833-4864 +Group 152: (Blocks 38913-39168) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38922 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 38923-39168 + Free inodes: 4865-4896 +Group 153: (Blocks 39169-39424) + Block bitmap at 39169 (+0), Inode bitmap at 39170 (+1) + Inode table at 39171-39178 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 39179-39424 + Free inodes: 4897-4928 +Group 154: (Blocks 39425-39680) + Block bitmap at 39425 (+0), Inode bitmap at 39426 (+1) + Inode table at 39427-39434 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 39435-39680 + Free inodes: 4929-4960 +Group 155: (Blocks 39681-39936) + Block bitmap at 39681 (+0), Inode bitmap at 39682 (+1) + Inode table at 39683-39690 (+2) + 246 free blocks, 32 free inodes, 0 directories + Free blocks: 39691-39936 + Free inodes: 4961-4992 +Group 156: (Blocks 39937-39999) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-39946 (+2) + 53 free blocks, 32 free inodes, 0 directories + Free blocks: 39947-39999 + Free inodes: 4993-5024 diff --git a/tests/r_move_itable/name b/tests/r_move_itable/name new file mode 100644 index 0000000..58c2d6d --- /dev/null +++ b/tests/r_move_itable/name @@ -0,0 +1 @@ +filesystem resize which requires moving the inode table diff --git a/tests/r_move_itable/script b/tests/r_move_itable/script new file mode 100644 index 0000000..6625e82 --- /dev/null +++ b/tests/r_move_itable/script @@ -0,0 +1,103 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 -g 256 -O ^resize_inode test.img 1024 > $OUT.new +$MKE2FS -q -F -o Linux -b 1024 -g 256 -O ^resize_inode $TMPFILE 1024 >> $OUT.new 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo resize2fs -p test.img 10000 >> $OUT.new +$RESIZE2FS -p $TMPFILE 10000 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo "--------------------------------" >> $OUT.new + +echo resize2fs -p test.img 20000 >> $OUT.new +$RESIZE2FS -p $TMPFILE 20000 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo "--------------------------------" >> $OUT.new + +echo resize2fs -p test.img 30000 >> $OUT.new +$RESIZE2FS -p $TMPFILE 30000 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo "--------------------------------" >> $OUT.new + +echo resize2fs -p test.img 40000 >> $OUT.new +$RESIZE2FS -p $TMPFILE 40000 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_move_itable_nostride/expect b/tests/r_move_itable_nostride/expect new file mode 100644 index 0000000..74c2cc0 --- /dev/null +++ b/tests/r_move_itable_nostride/expect @@ -0,0 +1,61 @@ +mke2fs -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 test.img 1024000 +resize2fs -p test.img 10240000 +Resizing the filesystem on test.img to 100000000 (1k) blocks. +Begin pass 2 (max = 2062) +Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 3 (max = 125) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 5 (max = 5) +Moving inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 99999745 (1k) blocks long. + +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: 11/99999744 files (0.0% non-contiguous), 25048026/99999745 blocks +Exit status is 0 +dumpe2fs -h test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 99999744 +Block count: 99999745 +Reserved block count: 4999987 +Free blocks: 74951719 +Free inodes: 99999733 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 8192 +Inode blocks per group: 2048 +RAID stride: 8192 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 16M +Total journal blocks: 16384 +Max transaction length: 16384 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + diff --git a/tests/r_move_itable_nostride/name b/tests/r_move_itable_nostride/name new file mode 100644 index 0000000..798af7f --- /dev/null +++ b/tests/r_move_itable_nostride/name @@ -0,0 +1 @@ +resize with flex_bg and stride value set diff --git a/tests/r_move_itable_nostride/script b/tests/r_move_itable_nostride/script new file mode 100644 index 0000000..d24df22 --- /dev/null +++ b/tests/r_move_itable_nostride/script @@ -0,0 +1,58 @@ +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 96GB filesystem + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 test.img 1024000 > $OUT +$MKE2FS -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 \ + $TMPFILE 1024000 >> $OUT 2>&1 + +echo resize2fs -p test.img 10240000 >> $OUT +$RESIZE2FS -p $TMPFILE 100000000 >> $OUT 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs -h test.img >> $OUT +$DUMPE2FS -h $TMPFILE >> $OUT 2>&1 +sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT > $OUT.new +mv $OUT.new $OUT +rm -f $TMPFILE + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_move_itable_realloc/expect b/tests/r_move_itable_realloc/expect new file mode 100644 index 0000000..67f2fe4 --- /dev/null +++ b/tests/r_move_itable_realloc/expect @@ -0,0 +1,60 @@ +mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000 +resize2fs -p test.img 100000000 +Resizing the filesystem on test.img to 100000000 (1k) blocks. +Begin pass 2 (max = 2061) +Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 3 (max = 125) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 5 (max = 5) +Moving inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 99999745 (1k) blocks long. + +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: 11/99999744 files (0.0% non-contiguous), 25048025/99999745 blocks +Exit status is 0 +dumpe2fs -h test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 99999744 +Block count: 99999745 +Reserved block count: 4999987 +Free blocks: 74951720 +Free inodes: 99999733 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 8192 +Inode blocks per group: 2048 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Journal features: (none) +Total journal size: 16M +Total journal blocks: 16384 +Max transaction length: 16384 +Fast commit length: 0 +Journal sequence: 0x00000001 +Journal start: 0 + diff --git a/tests/r_move_itable_realloc/name b/tests/r_move_itable_realloc/name new file mode 100644 index 0000000..c265317 --- /dev/null +++ b/tests/r_move_itable_realloc/name @@ -0,0 +1 @@ +don't allocate inode table from in-use blocks diff --git a/tests/r_move_itable_realloc/script b/tests/r_move_itable_realloc/script new file mode 100644 index 0000000..20c26db --- /dev/null +++ b/tests/r_move_itable_realloc/script @@ -0,0 +1,58 @@ +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 96GB filesystem + echo "$test_name: $test_description: skipped: skipped for $os" + return 0 +fi + +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000 > $OUT +$MKE2FS -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 \ + $TMPFILE 1024000 >> $OUT 2>&1 + +echo resize2fs -p test.img 100000000 >> $OUT +$RESIZE2FS -p $TMPFILE 100000000 >> $OUT 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs -h test.img >> $OUT +$DUMPE2FS -h $TMPFILE >> $OUT 2>&1 +sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT > $OUT.new +mv $OUT.new $OUT +rm -f $TMPFILE + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/r_resize_inode/expect b/tests/r_resize_inode/expect new file mode 100644 index 0000000..6756580 --- /dev/null +++ b/tests/r_resize_inode/expect @@ -0,0 +1,2231 @@ +mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 4096 +Block count: 16384 +Reserved block count: 819 +Overhead clusters: 2605 +Free blocks: 13765 +Free inodes: 4085 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-258 + Block bitmap at 259 (+258), Inode bitmap at 260 (+259) + Inode table at 261-324 (+260) + 686 free blocks, 245 free inodes, 2 directories + Free blocks: 339-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1026 + Reserved GDT blocks at 1027-1282 + Block bitmap at 1283 (+258), Inode bitmap at 1284 (+259) + Inode table at 1285-1348 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 1349-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3074 + Reserved GDT blocks at 3075-3330 + Block bitmap at 3331 (+258), Inode bitmap at 3332 (+259) + Inode table at 3333-3396 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 3397-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5122 + Reserved GDT blocks at 5123-5378 + Block bitmap at 5379 (+258), Inode bitmap at 5380 (+259) + Inode table at 5381-5444 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 5445-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7170 + Reserved GDT blocks at 7171-7426 + Block bitmap at 7427 (+258), Inode bitmap at 7428 (+259) + Inode table at 7429-7492 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 7493-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9218 + Reserved GDT blocks at 9219-9474 + Block bitmap at 9475 (+258), Inode bitmap at 9476 (+259) + Inode table at 9477-9540 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 9541-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16383) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16383 + Free inodes: 3841-4096 +resize2fs -p test.img 65536 +Resizing the filesystem on test.img to 65536 (1k) blocks. +Begin pass 1 (max = 48) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 65536 (1k) blocks long. + +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: 11/16384 files (0.0% non-contiguous), 6561/65536 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Free blocks: 58975 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 255 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-3 + Reserved GDT blocks at 4-258 + Block bitmap at 259 (+258), Inode bitmap at 260 (+259) + Inode table at 261-324 (+260) + 686 free blocks, 245 free inodes, 2 directories + Free blocks: 339-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1027 + Reserved GDT blocks at 1028-1282 + Block bitmap at 1283 (+258), Inode bitmap at 1284 (+259) + Inode table at 1285-1348 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 1349-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3075 + Reserved GDT blocks at 3076-3330 + Block bitmap at 3331 (+258), Inode bitmap at 3332 (+259) + Inode table at 3333-3396 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 3397-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5123 + Reserved GDT blocks at 5124-5378 + Block bitmap at 5379 (+258), Inode bitmap at 5380 (+259) + Inode table at 5381-5444 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 5445-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7171 + Reserved GDT blocks at 7172-7426 + Block bitmap at 7427 (+258), Inode bitmap at 7428 (+259) + Inode table at 7429-7492 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 7493-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9219 + Reserved GDT blocks at 9220-9474 + Block bitmap at 9475 (+258), Inode bitmap at 9476 (+259) + Inode table at 9477-9540 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 9541-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16384) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16384 + Free inodes: 3841-4096 +Group 16: (Blocks 16385-17408) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16450 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 16451-17408 + Free inodes: 4097-4352 +Group 17: (Blocks 17409-18432) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17474 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 17475-18432 + Free inodes: 4353-4608 +Group 18: (Blocks 18433-19456) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18498 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 18499-19456 + Free inodes: 4609-4864 +Group 19: (Blocks 19457-20480) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19522 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 19523-20480 + Free inodes: 4865-5120 +Group 20: (Blocks 20481-21504) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20546 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 20547-21504 + Free inodes: 5121-5376 +Group 21: (Blocks 21505-22528) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21570 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 21571-22528 + Free inodes: 5377-5632 +Group 22: (Blocks 22529-23552) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22594 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 22595-23552 + Free inodes: 5633-5888 +Group 23: (Blocks 23553-24576) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23618 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 23619-24576 + Free inodes: 5889-6144 +Group 24: (Blocks 24577-25600) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24642 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 24643-25600 + Free inodes: 6145-6400 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601, Group descriptors at 25602-25603 + Reserved GDT blocks at 25604-25858 + Block bitmap at 25859 (+258), Inode bitmap at 25860 (+259) + Inode table at 25861-25924 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 25925-26624 + Free inodes: 6401-6656 +Group 26: (Blocks 26625-27648) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26690 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 26691-27648 + Free inodes: 6657-6912 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649, Group descriptors at 27650-27651 + Reserved GDT blocks at 27652-27906 + Block bitmap at 27907 (+258), Inode bitmap at 27908 (+259) + Inode table at 27909-27972 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 27973-28672 + Free inodes: 6913-7168 +Group 28: (Blocks 28673-29696) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28738 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 28739-29696 + Free inodes: 7169-7424 +Group 29: (Blocks 29697-30720) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29762 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 29763-30720 + Free inodes: 7425-7680 +Group 30: (Blocks 30721-31744) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30786 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 30787-31744 + Free inodes: 7681-7936 +Group 31: (Blocks 31745-32768) + Block bitmap at 31745 (+0), Inode bitmap at 31746 (+1) + Inode table at 31747-31810 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 31811-32768 + Free inodes: 7937-8192 +Group 32: (Blocks 32769-33792) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-32834 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 32835-33792 + Free inodes: 8193-8448 +Group 33: (Blocks 33793-34816) + Block bitmap at 33793 (+0), Inode bitmap at 33794 (+1) + Inode table at 33795-33858 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 33859-34816 + Free inodes: 8449-8704 +Group 34: (Blocks 34817-35840) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34882 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 34883-35840 + Free inodes: 8705-8960 +Group 35: (Blocks 35841-36864) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35906 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 35907-36864 + Free inodes: 8961-9216 +Group 36: (Blocks 36865-37888) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36930 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 36931-37888 + Free inodes: 9217-9472 +Group 37: (Blocks 37889-38912) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37954 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 37955-38912 + Free inodes: 9473-9728 +Group 38: (Blocks 38913-39936) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38978 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 38979-39936 + Free inodes: 9729-9984 +Group 39: (Blocks 39937-40960) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-40002 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 40003-40960 + Free inodes: 9985-10240 +Group 40: (Blocks 40961-41984) + Block bitmap at 40961 (+0), Inode bitmap at 40962 (+1) + Inode table at 40963-41026 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 41027-41984 + Free inodes: 10241-10496 +Group 41: (Blocks 41985-43008) + Block bitmap at 41985 (+0), Inode bitmap at 41986 (+1) + Inode table at 41987-42050 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 42051-43008 + Free inodes: 10497-10752 +Group 42: (Blocks 43009-44032) + Block bitmap at 43009 (+0), Inode bitmap at 43010 (+1) + Inode table at 43011-43074 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 43075-44032 + Free inodes: 10753-11008 +Group 43: (Blocks 44033-45056) + Block bitmap at 44033 (+0), Inode bitmap at 44034 (+1) + Inode table at 44035-44098 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 44099-45056 + Free inodes: 11009-11264 +Group 44: (Blocks 45057-46080) + Block bitmap at 45057 (+0), Inode bitmap at 45058 (+1) + Inode table at 45059-45122 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 45123-46080 + Free inodes: 11265-11520 +Group 45: (Blocks 46081-47104) + Block bitmap at 46081 (+0), Inode bitmap at 46082 (+1) + Inode table at 46083-46146 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 46147-47104 + Free inodes: 11521-11776 +Group 46: (Blocks 47105-48128) + Block bitmap at 47105 (+0), Inode bitmap at 47106 (+1) + Inode table at 47107-47170 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 47171-48128 + Free inodes: 11777-12032 +Group 47: (Blocks 48129-49152) + Block bitmap at 48129 (+0), Inode bitmap at 48130 (+1) + Inode table at 48131-48194 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 48195-49152 + Free inodes: 12033-12288 +Group 48: (Blocks 49153-50176) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49218 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 49219-50176 + Free inodes: 12289-12544 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177, Group descriptors at 50178-50179 + Reserved GDT blocks at 50180-50434 + Block bitmap at 50435 (+258), Inode bitmap at 50436 (+259) + Inode table at 50437-50500 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 50501-51200 + Free inodes: 12545-12800 +Group 50: (Blocks 51201-52224) + Block bitmap at 51201 (+0), Inode bitmap at 51202 (+1) + Inode table at 51203-51266 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 51267-52224 + Free inodes: 12801-13056 +Group 51: (Blocks 52225-53248) + Block bitmap at 52225 (+0), Inode bitmap at 52226 (+1) + Inode table at 52227-52290 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 52291-53248 + Free inodes: 13057-13312 +Group 52: (Blocks 53249-54272) + Block bitmap at 53249 (+0), Inode bitmap at 53250 (+1) + Inode table at 53251-53314 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 53315-54272 + Free inodes: 13313-13568 +Group 53: (Blocks 54273-55296) + Block bitmap at 54273 (+0), Inode bitmap at 54274 (+1) + Inode table at 54275-54338 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 54339-55296 + Free inodes: 13569-13824 +Group 54: (Blocks 55297-56320) + Block bitmap at 55297 (+0), Inode bitmap at 55298 (+1) + Inode table at 55299-55362 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 55363-56320 + Free inodes: 13825-14080 +Group 55: (Blocks 56321-57344) + Block bitmap at 56321 (+0), Inode bitmap at 56322 (+1) + Inode table at 56323-56386 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 56387-57344 + Free inodes: 14081-14336 +Group 56: (Blocks 57345-58368) + Block bitmap at 57345 (+0), Inode bitmap at 57346 (+1) + Inode table at 57347-57410 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 57411-58368 + Free inodes: 14337-14592 +Group 57: (Blocks 58369-59392) + Block bitmap at 58369 (+0), Inode bitmap at 58370 (+1) + Inode table at 58371-58434 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 58435-59392 + Free inodes: 14593-14848 +Group 58: (Blocks 59393-60416) + Block bitmap at 59393 (+0), Inode bitmap at 59394 (+1) + Inode table at 59395-59458 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 59459-60416 + Free inodes: 14849-15104 +Group 59: (Blocks 60417-61440) + Block bitmap at 60417 (+0), Inode bitmap at 60418 (+1) + Inode table at 60419-60482 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 60483-61440 + Free inodes: 15105-15360 +Group 60: (Blocks 61441-62464) + Block bitmap at 61441 (+0), Inode bitmap at 61442 (+1) + Inode table at 61443-61506 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 61507-62464 + Free inodes: 15361-15616 +Group 61: (Blocks 62465-63488) + Block bitmap at 62465 (+0), Inode bitmap at 62466 (+1) + Inode table at 62467-62530 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 62531-63488 + Free inodes: 15617-15872 +Group 62: (Blocks 63489-64512) + Block bitmap at 63489 (+0), Inode bitmap at 63490 (+1) + Inode table at 63491-63554 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 63555-64512 + Free inodes: 15873-16128 +Group 63: (Blocks 64513-65535) + Block bitmap at 64513 (+0), Inode bitmap at 64514 (+1) + Inode table at 64515-64578 (+2) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 64579-65535 + Free inodes: 16129-16384 +-------------------------------- +mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 6556 +Free blocks: 58966 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-3 + Reserved GDT blocks at 4-259 + Block bitmap at 260 (+259), Inode bitmap at 261 (+260) + Inode table at 262-325 (+261) + 685 free blocks, 245 free inodes, 2 directories + Free blocks: 340-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1027 + Reserved GDT blocks at 1028-1283 + Block bitmap at 1284 (+259), Inode bitmap at 1285 (+260) + Inode table at 1286-1349 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 1350-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3075 + Reserved GDT blocks at 3076-3331 + Block bitmap at 3332 (+259), Inode bitmap at 3333 (+260) + Inode table at 3334-3397 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 3398-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5123 + Reserved GDT blocks at 5124-5379 + Block bitmap at 5380 (+259), Inode bitmap at 5381 (+260) + Inode table at 5382-5445 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 5446-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7171 + Reserved GDT blocks at 7172-7427 + Block bitmap at 7428 (+259), Inode bitmap at 7429 (+260) + Inode table at 7430-7493 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 7494-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9219 + Reserved GDT blocks at 9220-9475 + Block bitmap at 9476 (+259), Inode bitmap at 9477 (+260) + Inode table at 9478-9541 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 9542-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16384) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16384 + Free inodes: 3841-4096 +Group 16: (Blocks 16385-17408) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16450 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 16451-17408 + Free inodes: 4097-4352 +Group 17: (Blocks 17409-18432) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17474 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 17475-18432 + Free inodes: 4353-4608 +Group 18: (Blocks 18433-19456) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18498 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 18499-19456 + Free inodes: 4609-4864 +Group 19: (Blocks 19457-20480) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19522 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 19523-20480 + Free inodes: 4865-5120 +Group 20: (Blocks 20481-21504) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20546 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 20547-21504 + Free inodes: 5121-5376 +Group 21: (Blocks 21505-22528) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21570 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 21571-22528 + Free inodes: 5377-5632 +Group 22: (Blocks 22529-23552) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22594 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 22595-23552 + Free inodes: 5633-5888 +Group 23: (Blocks 23553-24576) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23618 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 23619-24576 + Free inodes: 5889-6144 +Group 24: (Blocks 24577-25600) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24642 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 24643-25600 + Free inodes: 6145-6400 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601, Group descriptors at 25602-25603 + Reserved GDT blocks at 25604-25859 + Block bitmap at 25860 (+259), Inode bitmap at 25861 (+260) + Inode table at 25862-25925 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 25926-26624 + Free inodes: 6401-6656 +Group 26: (Blocks 26625-27648) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26690 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 26691-27648 + Free inodes: 6657-6912 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649, Group descriptors at 27650-27651 + Reserved GDT blocks at 27652-27907 + Block bitmap at 27908 (+259), Inode bitmap at 27909 (+260) + Inode table at 27910-27973 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 27974-28672 + Free inodes: 6913-7168 +Group 28: (Blocks 28673-29696) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28738 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 28739-29696 + Free inodes: 7169-7424 +Group 29: (Blocks 29697-30720) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29762 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 29763-30720 + Free inodes: 7425-7680 +Group 30: (Blocks 30721-31744) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30786 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 30787-31744 + Free inodes: 7681-7936 +Group 31: (Blocks 31745-32768) + Block bitmap at 31745 (+0), Inode bitmap at 31746 (+1) + Inode table at 31747-31810 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 31811-32768 + Free inodes: 7937-8192 +Group 32: (Blocks 32769-33792) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-32834 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 32835-33792 + Free inodes: 8193-8448 +Group 33: (Blocks 33793-34816) + Block bitmap at 33793 (+0), Inode bitmap at 33794 (+1) + Inode table at 33795-33858 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 33859-34816 + Free inodes: 8449-8704 +Group 34: (Blocks 34817-35840) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34882 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 34883-35840 + Free inodes: 8705-8960 +Group 35: (Blocks 35841-36864) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35906 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 35907-36864 + Free inodes: 8961-9216 +Group 36: (Blocks 36865-37888) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36930 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 36931-37888 + Free inodes: 9217-9472 +Group 37: (Blocks 37889-38912) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37954 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 37955-38912 + Free inodes: 9473-9728 +Group 38: (Blocks 38913-39936) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38978 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 38979-39936 + Free inodes: 9729-9984 +Group 39: (Blocks 39937-40960) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-40002 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 40003-40960 + Free inodes: 9985-10240 +Group 40: (Blocks 40961-41984) + Block bitmap at 40961 (+0), Inode bitmap at 40962 (+1) + Inode table at 40963-41026 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 41027-41984 + Free inodes: 10241-10496 +Group 41: (Blocks 41985-43008) + Block bitmap at 41985 (+0), Inode bitmap at 41986 (+1) + Inode table at 41987-42050 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 42051-43008 + Free inodes: 10497-10752 +Group 42: (Blocks 43009-44032) + Block bitmap at 43009 (+0), Inode bitmap at 43010 (+1) + Inode table at 43011-43074 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 43075-44032 + Free inodes: 10753-11008 +Group 43: (Blocks 44033-45056) + Block bitmap at 44033 (+0), Inode bitmap at 44034 (+1) + Inode table at 44035-44098 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 44099-45056 + Free inodes: 11009-11264 +Group 44: (Blocks 45057-46080) + Block bitmap at 45057 (+0), Inode bitmap at 45058 (+1) + Inode table at 45059-45122 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 45123-46080 + Free inodes: 11265-11520 +Group 45: (Blocks 46081-47104) + Block bitmap at 46081 (+0), Inode bitmap at 46082 (+1) + Inode table at 46083-46146 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 46147-47104 + Free inodes: 11521-11776 +Group 46: (Blocks 47105-48128) + Block bitmap at 47105 (+0), Inode bitmap at 47106 (+1) + Inode table at 47107-47170 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 47171-48128 + Free inodes: 11777-12032 +Group 47: (Blocks 48129-49152) + Block bitmap at 48129 (+0), Inode bitmap at 48130 (+1) + Inode table at 48131-48194 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 48195-49152 + Free inodes: 12033-12288 +Group 48: (Blocks 49153-50176) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49218 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 49219-50176 + Free inodes: 12289-12544 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177, Group descriptors at 50178-50179 + Reserved GDT blocks at 50180-50435 + Block bitmap at 50436 (+259), Inode bitmap at 50437 (+260) + Inode table at 50438-50501 (+261) + 699 free blocks, 256 free inodes, 0 directories + Free blocks: 50502-51200 + Free inodes: 12545-12800 +Group 50: (Blocks 51201-52224) + Block bitmap at 51201 (+0), Inode bitmap at 51202 (+1) + Inode table at 51203-51266 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 51267-52224 + Free inodes: 12801-13056 +Group 51: (Blocks 52225-53248) + Block bitmap at 52225 (+0), Inode bitmap at 52226 (+1) + Inode table at 52227-52290 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 52291-53248 + Free inodes: 13057-13312 +Group 52: (Blocks 53249-54272) + Block bitmap at 53249 (+0), Inode bitmap at 53250 (+1) + Inode table at 53251-53314 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 53315-54272 + Free inodes: 13313-13568 +Group 53: (Blocks 54273-55296) + Block bitmap at 54273 (+0), Inode bitmap at 54274 (+1) + Inode table at 54275-54338 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 54339-55296 + Free inodes: 13569-13824 +Group 54: (Blocks 55297-56320) + Block bitmap at 55297 (+0), Inode bitmap at 55298 (+1) + Inode table at 55299-55362 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 55363-56320 + Free inodes: 13825-14080 +Group 55: (Blocks 56321-57344) + Block bitmap at 56321 (+0), Inode bitmap at 56322 (+1) + Inode table at 56323-56386 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 56387-57344 + Free inodes: 14081-14336 +Group 56: (Blocks 57345-58368) + Block bitmap at 57345 (+0), Inode bitmap at 57346 (+1) + Inode table at 57347-57410 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 57411-58368 + Free inodes: 14337-14592 +Group 57: (Blocks 58369-59392) + Block bitmap at 58369 (+0), Inode bitmap at 58370 (+1) + Inode table at 58371-58434 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 58435-59392 + Free inodes: 14593-14848 +Group 58: (Blocks 59393-60416) + Block bitmap at 59393 (+0), Inode bitmap at 59394 (+1) + Inode table at 59395-59458 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 59459-60416 + Free inodes: 14849-15104 +Group 59: (Blocks 60417-61440) + Block bitmap at 60417 (+0), Inode bitmap at 60418 (+1) + Inode table at 60419-60482 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 60483-61440 + Free inodes: 15105-15360 +Group 60: (Blocks 61441-62464) + Block bitmap at 61441 (+0), Inode bitmap at 61442 (+1) + Inode table at 61443-61506 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 61507-62464 + Free inodes: 15361-15616 +Group 61: (Blocks 62465-63488) + Block bitmap at 62465 (+0), Inode bitmap at 62466 (+1) + Inode table at 62467-62530 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 62531-63488 + Free inodes: 15617-15872 +Group 62: (Blocks 63489-64512) + Block bitmap at 63489 (+0), Inode bitmap at 63490 (+1) + Inode table at 63491-63554 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 63555-64512 + Free inodes: 15873-16128 +Group 63: (Blocks 64513-65535) + Block bitmap at 64513 (+0), Inode bitmap at 64514 (+1) + Inode table at 64515-64578 (+2) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 64579-65535 + Free inodes: 16129-16384 +resize2fs -p test.img 16384 +Resizing the filesystem on test.img to 16384 (1k) blocks. +Begin pass 3 (max = 64) +Scanning inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 16384 (1k) blocks long. + +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: 11/4096 files (0.0% non-contiguous), 2619/16384 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 4096 +Block count: 16384 +Reserved block count: 819 +Free blocks: 13765 +Free inodes: 4085 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 256 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-258 + Block bitmap at 260 (+259), Inode bitmap at 261 (+260) + Inode table at 262-325 (+261) + 686 free blocks, 245 free inodes, 2 directories + Free blocks: 259, 340-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1026 + Reserved GDT blocks at 1027-1282 + Block bitmap at 1284 (+259), Inode bitmap at 1285 (+260) + Inode table at 1286-1349 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 1283, 1350-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3074 + Reserved GDT blocks at 3075-3330 + Block bitmap at 3332 (+259), Inode bitmap at 3333 (+260) + Inode table at 3334-3397 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 3331, 3398-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5122 + Reserved GDT blocks at 5123-5378 + Block bitmap at 5380 (+259), Inode bitmap at 5381 (+260) + Inode table at 5382-5445 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 5379, 5446-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7170 + Reserved GDT blocks at 7171-7426 + Block bitmap at 7428 (+259), Inode bitmap at 7429 (+260) + Inode table at 7430-7493 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 7427, 7494-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9218 + Reserved GDT blocks at 9219-9474 + Block bitmap at 9476 (+259), Inode bitmap at 9477 (+260) + Inode table at 9478-9541 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 9475, 9542-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16383) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 957 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16383 + Free inodes: 3841-4096 +-------------------------------- +resize2fs -p test.img 165536 +Resizing the filesystem on test.img to 165536 (1k) blocks. +Begin pass 1 (max = 146) +Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on test.img is now 165536 (1k) blocks long. + +Filesystem did not have a UUID; generating one. + +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: 11/41472 files (0.0% non-contiguous), 13545/165536 blocks +Exit status is 0 +dumpe2fs test.img +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 41472 +Block count: 165536 +Reserved block count: 8274 +Free blocks: 151991 +Free inodes: 41461 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 251 +Blocks per group: 1024 +Fragments per group: 1024 +Inodes per group: 256 +Inode blocks per group: 64 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-1024) + Primary superblock at 1, Group descriptors at 2-7 + Reserved GDT blocks at 8-258 + Block bitmap at 260 (+259), Inode bitmap at 261 (+260) + Inode table at 262-325 (+261) + 686 free blocks, 245 free inodes, 2 directories + Free blocks: 259, 340-1024 + Free inodes: 12-256 +Group 1: (Blocks 1025-2048) + Backup superblock at 1025, Group descriptors at 1026-1031 + Reserved GDT blocks at 1032-1282 + Block bitmap at 1284 (+259), Inode bitmap at 1285 (+260) + Inode table at 1286-1349 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 1283, 1350-2048 + Free inodes: 257-512 +Group 2: (Blocks 2049-3072) + Block bitmap at 2049 (+0), Inode bitmap at 2050 (+1) + Inode table at 2051-2114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 2115-3072 + Free inodes: 513-768 +Group 3: (Blocks 3073-4096) + Backup superblock at 3073, Group descriptors at 3074-3079 + Reserved GDT blocks at 3080-3330 + Block bitmap at 3332 (+259), Inode bitmap at 3333 (+260) + Inode table at 3334-3397 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 3331, 3398-4096 + Free inodes: 769-1024 +Group 4: (Blocks 4097-5120) + Block bitmap at 4097 (+0), Inode bitmap at 4098 (+1) + Inode table at 4099-4162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 4163-5120 + Free inodes: 1025-1280 +Group 5: (Blocks 5121-6144) + Backup superblock at 5121, Group descriptors at 5122-5127 + Reserved GDT blocks at 5128-5378 + Block bitmap at 5380 (+259), Inode bitmap at 5381 (+260) + Inode table at 5382-5445 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 5379, 5446-6144 + Free inodes: 1281-1536 +Group 6: (Blocks 6145-7168) + Block bitmap at 6145 (+0), Inode bitmap at 6146 (+1) + Inode table at 6147-6210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 6211-7168 + Free inodes: 1537-1792 +Group 7: (Blocks 7169-8192) + Backup superblock at 7169, Group descriptors at 7170-7175 + Reserved GDT blocks at 7176-7426 + Block bitmap at 7428 (+259), Inode bitmap at 7429 (+260) + Inode table at 7430-7493 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 7427, 7494-8192 + Free inodes: 1793-2048 +Group 8: (Blocks 8193-9216) + Block bitmap at 8193 (+0), Inode bitmap at 8194 (+1) + Inode table at 8195-8258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 8259-9216 + Free inodes: 2049-2304 +Group 9: (Blocks 9217-10240) + Backup superblock at 9217, Group descriptors at 9218-9223 + Reserved GDT blocks at 9224-9474 + Block bitmap at 9476 (+259), Inode bitmap at 9477 (+260) + Inode table at 9478-9541 (+261) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 9475, 9542-10240 + Free inodes: 2305-2560 +Group 10: (Blocks 10241-11264) + Block bitmap at 10241 (+0), Inode bitmap at 10242 (+1) + Inode table at 10243-10306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 10307-11264 + Free inodes: 2561-2816 +Group 11: (Blocks 11265-12288) + Block bitmap at 11265 (+0), Inode bitmap at 11266 (+1) + Inode table at 11267-11330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 11331-12288 + Free inodes: 2817-3072 +Group 12: (Blocks 12289-13312) + Block bitmap at 12289 (+0), Inode bitmap at 12290 (+1) + Inode table at 12291-12354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 12355-13312 + Free inodes: 3073-3328 +Group 13: (Blocks 13313-14336) + Block bitmap at 13313 (+0), Inode bitmap at 13314 (+1) + Inode table at 13315-13378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 13379-14336 + Free inodes: 3329-3584 +Group 14: (Blocks 14337-15360) + Block bitmap at 14337 (+0), Inode bitmap at 14338 (+1) + Inode table at 14339-14402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 14403-15360 + Free inodes: 3585-3840 +Group 15: (Blocks 15361-16384) + Block bitmap at 15361 (+0), Inode bitmap at 15362 (+1) + Inode table at 15363-15426 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 15427-16384 + Free inodes: 3841-4096 +Group 16: (Blocks 16385-17408) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16450 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 16451-17408 + Free inodes: 4097-4352 +Group 17: (Blocks 17409-18432) + Block bitmap at 17409 (+0), Inode bitmap at 17410 (+1) + Inode table at 17411-17474 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 17475-18432 + Free inodes: 4353-4608 +Group 18: (Blocks 18433-19456) + Block bitmap at 18433 (+0), Inode bitmap at 18434 (+1) + Inode table at 18435-18498 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 18499-19456 + Free inodes: 4609-4864 +Group 19: (Blocks 19457-20480) + Block bitmap at 19457 (+0), Inode bitmap at 19458 (+1) + Inode table at 19459-19522 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 19523-20480 + Free inodes: 4865-5120 +Group 20: (Blocks 20481-21504) + Block bitmap at 20481 (+0), Inode bitmap at 20482 (+1) + Inode table at 20483-20546 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 20547-21504 + Free inodes: 5121-5376 +Group 21: (Blocks 21505-22528) + Block bitmap at 21505 (+0), Inode bitmap at 21506 (+1) + Inode table at 21507-21570 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 21571-22528 + Free inodes: 5377-5632 +Group 22: (Blocks 22529-23552) + Block bitmap at 22529 (+0), Inode bitmap at 22530 (+1) + Inode table at 22531-22594 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 22595-23552 + Free inodes: 5633-5888 +Group 23: (Blocks 23553-24576) + Block bitmap at 23553 (+0), Inode bitmap at 23554 (+1) + Inode table at 23555-23618 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 23619-24576 + Free inodes: 5889-6144 +Group 24: (Blocks 24577-25600) + Block bitmap at 24577 (+0), Inode bitmap at 24578 (+1) + Inode table at 24579-24642 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 24643-25600 + Free inodes: 6145-6400 +Group 25: (Blocks 25601-26624) + Backup superblock at 25601, Group descriptors at 25602-25607 + Reserved GDT blocks at 25608-25858 + Block bitmap at 25859 (+258), Inode bitmap at 25860 (+259) + Inode table at 25861-25924 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 25925-26624 + Free inodes: 6401-6656 +Group 26: (Blocks 26625-27648) + Block bitmap at 26625 (+0), Inode bitmap at 26626 (+1) + Inode table at 26627-26690 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 26691-27648 + Free inodes: 6657-6912 +Group 27: (Blocks 27649-28672) + Backup superblock at 27649, Group descriptors at 27650-27655 + Reserved GDT blocks at 27656-27906 + Block bitmap at 27907 (+258), Inode bitmap at 27908 (+259) + Inode table at 27909-27972 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 27973-28672 + Free inodes: 6913-7168 +Group 28: (Blocks 28673-29696) + Block bitmap at 28673 (+0), Inode bitmap at 28674 (+1) + Inode table at 28675-28738 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 28739-29696 + Free inodes: 7169-7424 +Group 29: (Blocks 29697-30720) + Block bitmap at 29697 (+0), Inode bitmap at 29698 (+1) + Inode table at 29699-29762 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 29763-30720 + Free inodes: 7425-7680 +Group 30: (Blocks 30721-31744) + Block bitmap at 30721 (+0), Inode bitmap at 30722 (+1) + Inode table at 30723-30786 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 30787-31744 + Free inodes: 7681-7936 +Group 31: (Blocks 31745-32768) + Block bitmap at 31745 (+0), Inode bitmap at 31746 (+1) + Inode table at 31747-31810 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 31811-32768 + Free inodes: 7937-8192 +Group 32: (Blocks 32769-33792) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-32834 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 32835-33792 + Free inodes: 8193-8448 +Group 33: (Blocks 33793-34816) + Block bitmap at 33793 (+0), Inode bitmap at 33794 (+1) + Inode table at 33795-33858 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 33859-34816 + Free inodes: 8449-8704 +Group 34: (Blocks 34817-35840) + Block bitmap at 34817 (+0), Inode bitmap at 34818 (+1) + Inode table at 34819-34882 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 34883-35840 + Free inodes: 8705-8960 +Group 35: (Blocks 35841-36864) + Block bitmap at 35841 (+0), Inode bitmap at 35842 (+1) + Inode table at 35843-35906 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 35907-36864 + Free inodes: 8961-9216 +Group 36: (Blocks 36865-37888) + Block bitmap at 36865 (+0), Inode bitmap at 36866 (+1) + Inode table at 36867-36930 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 36931-37888 + Free inodes: 9217-9472 +Group 37: (Blocks 37889-38912) + Block bitmap at 37889 (+0), Inode bitmap at 37890 (+1) + Inode table at 37891-37954 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 37955-38912 + Free inodes: 9473-9728 +Group 38: (Blocks 38913-39936) + Block bitmap at 38913 (+0), Inode bitmap at 38914 (+1) + Inode table at 38915-38978 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 38979-39936 + Free inodes: 9729-9984 +Group 39: (Blocks 39937-40960) + Block bitmap at 39937 (+0), Inode bitmap at 39938 (+1) + Inode table at 39939-40002 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 40003-40960 + Free inodes: 9985-10240 +Group 40: (Blocks 40961-41984) + Block bitmap at 40961 (+0), Inode bitmap at 40962 (+1) + Inode table at 40963-41026 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 41027-41984 + Free inodes: 10241-10496 +Group 41: (Blocks 41985-43008) + Block bitmap at 41985 (+0), Inode bitmap at 41986 (+1) + Inode table at 41987-42050 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 42051-43008 + Free inodes: 10497-10752 +Group 42: (Blocks 43009-44032) + Block bitmap at 43009 (+0), Inode bitmap at 43010 (+1) + Inode table at 43011-43074 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 43075-44032 + Free inodes: 10753-11008 +Group 43: (Blocks 44033-45056) + Block bitmap at 44033 (+0), Inode bitmap at 44034 (+1) + Inode table at 44035-44098 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 44099-45056 + Free inodes: 11009-11264 +Group 44: (Blocks 45057-46080) + Block bitmap at 45057 (+0), Inode bitmap at 45058 (+1) + Inode table at 45059-45122 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 45123-46080 + Free inodes: 11265-11520 +Group 45: (Blocks 46081-47104) + Block bitmap at 46081 (+0), Inode bitmap at 46082 (+1) + Inode table at 46083-46146 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 46147-47104 + Free inodes: 11521-11776 +Group 46: (Blocks 47105-48128) + Block bitmap at 47105 (+0), Inode bitmap at 47106 (+1) + Inode table at 47107-47170 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 47171-48128 + Free inodes: 11777-12032 +Group 47: (Blocks 48129-49152) + Block bitmap at 48129 (+0), Inode bitmap at 48130 (+1) + Inode table at 48131-48194 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 48195-49152 + Free inodes: 12033-12288 +Group 48: (Blocks 49153-50176) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49218 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 49219-50176 + Free inodes: 12289-12544 +Group 49: (Blocks 50177-51200) + Backup superblock at 50177, Group descriptors at 50178-50183 + Reserved GDT blocks at 50184-50434 + Block bitmap at 50435 (+258), Inode bitmap at 50436 (+259) + Inode table at 50437-50500 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 50501-51200 + Free inodes: 12545-12800 +Group 50: (Blocks 51201-52224) + Block bitmap at 51201 (+0), Inode bitmap at 51202 (+1) + Inode table at 51203-51266 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 51267-52224 + Free inodes: 12801-13056 +Group 51: (Blocks 52225-53248) + Block bitmap at 52225 (+0), Inode bitmap at 52226 (+1) + Inode table at 52227-52290 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 52291-53248 + Free inodes: 13057-13312 +Group 52: (Blocks 53249-54272) + Block bitmap at 53249 (+0), Inode bitmap at 53250 (+1) + Inode table at 53251-53314 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 53315-54272 + Free inodes: 13313-13568 +Group 53: (Blocks 54273-55296) + Block bitmap at 54273 (+0), Inode bitmap at 54274 (+1) + Inode table at 54275-54338 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 54339-55296 + Free inodes: 13569-13824 +Group 54: (Blocks 55297-56320) + Block bitmap at 55297 (+0), Inode bitmap at 55298 (+1) + Inode table at 55299-55362 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 55363-56320 + Free inodes: 13825-14080 +Group 55: (Blocks 56321-57344) + Block bitmap at 56321 (+0), Inode bitmap at 56322 (+1) + Inode table at 56323-56386 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 56387-57344 + Free inodes: 14081-14336 +Group 56: (Blocks 57345-58368) + Block bitmap at 57345 (+0), Inode bitmap at 57346 (+1) + Inode table at 57347-57410 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 57411-58368 + Free inodes: 14337-14592 +Group 57: (Blocks 58369-59392) + Block bitmap at 58369 (+0), Inode bitmap at 58370 (+1) + Inode table at 58371-58434 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 58435-59392 + Free inodes: 14593-14848 +Group 58: (Blocks 59393-60416) + Block bitmap at 59393 (+0), Inode bitmap at 59394 (+1) + Inode table at 59395-59458 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 59459-60416 + Free inodes: 14849-15104 +Group 59: (Blocks 60417-61440) + Block bitmap at 60417 (+0), Inode bitmap at 60418 (+1) + Inode table at 60419-60482 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 60483-61440 + Free inodes: 15105-15360 +Group 60: (Blocks 61441-62464) + Block bitmap at 61441 (+0), Inode bitmap at 61442 (+1) + Inode table at 61443-61506 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 61507-62464 + Free inodes: 15361-15616 +Group 61: (Blocks 62465-63488) + Block bitmap at 62465 (+0), Inode bitmap at 62466 (+1) + Inode table at 62467-62530 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 62531-63488 + Free inodes: 15617-15872 +Group 62: (Blocks 63489-64512) + Block bitmap at 63489 (+0), Inode bitmap at 63490 (+1) + Inode table at 63491-63554 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 63555-64512 + Free inodes: 15873-16128 +Group 63: (Blocks 64513-65536) + Block bitmap at 64513 (+0), Inode bitmap at 64514 (+1) + Inode table at 64515-64578 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 64579-65536 + Free inodes: 16129-16384 +Group 64: (Blocks 65537-66560) + Block bitmap at 65537 (+0), Inode bitmap at 65538 (+1) + Inode table at 65539-65602 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 65603-66560 + Free inodes: 16385-16640 +Group 65: (Blocks 66561-67584) + Block bitmap at 66561 (+0), Inode bitmap at 66562 (+1) + Inode table at 66563-66626 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 66627-67584 + Free inodes: 16641-16896 +Group 66: (Blocks 67585-68608) + Block bitmap at 67585 (+0), Inode bitmap at 67586 (+1) + Inode table at 67587-67650 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 67651-68608 + Free inodes: 16897-17152 +Group 67: (Blocks 68609-69632) + Block bitmap at 68609 (+0), Inode bitmap at 68610 (+1) + Inode table at 68611-68674 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 68675-69632 + Free inodes: 17153-17408 +Group 68: (Blocks 69633-70656) + Block bitmap at 69633 (+0), Inode bitmap at 69634 (+1) + Inode table at 69635-69698 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 69699-70656 + Free inodes: 17409-17664 +Group 69: (Blocks 70657-71680) + Block bitmap at 70657 (+0), Inode bitmap at 70658 (+1) + Inode table at 70659-70722 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 70723-71680 + Free inodes: 17665-17920 +Group 70: (Blocks 71681-72704) + Block bitmap at 71681 (+0), Inode bitmap at 71682 (+1) + Inode table at 71683-71746 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 71747-72704 + Free inodes: 17921-18176 +Group 71: (Blocks 72705-73728) + Block bitmap at 72705 (+0), Inode bitmap at 72706 (+1) + Inode table at 72707-72770 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 72771-73728 + Free inodes: 18177-18432 +Group 72: (Blocks 73729-74752) + Block bitmap at 73729 (+0), Inode bitmap at 73730 (+1) + Inode table at 73731-73794 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 73795-74752 + Free inodes: 18433-18688 +Group 73: (Blocks 74753-75776) + Block bitmap at 74753 (+0), Inode bitmap at 74754 (+1) + Inode table at 74755-74818 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 74819-75776 + Free inodes: 18689-18944 +Group 74: (Blocks 75777-76800) + Block bitmap at 75777 (+0), Inode bitmap at 75778 (+1) + Inode table at 75779-75842 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 75843-76800 + Free inodes: 18945-19200 +Group 75: (Blocks 76801-77824) + Block bitmap at 76801 (+0), Inode bitmap at 76802 (+1) + Inode table at 76803-76866 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 76867-77824 + Free inodes: 19201-19456 +Group 76: (Blocks 77825-78848) + Block bitmap at 77825 (+0), Inode bitmap at 77826 (+1) + Inode table at 77827-77890 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 77891-78848 + Free inodes: 19457-19712 +Group 77: (Blocks 78849-79872) + Block bitmap at 78849 (+0), Inode bitmap at 78850 (+1) + Inode table at 78851-78914 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 78915-79872 + Free inodes: 19713-19968 +Group 78: (Blocks 79873-80896) + Block bitmap at 79873 (+0), Inode bitmap at 79874 (+1) + Inode table at 79875-79938 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 79939-80896 + Free inodes: 19969-20224 +Group 79: (Blocks 80897-81920) + Block bitmap at 80897 (+0), Inode bitmap at 80898 (+1) + Inode table at 80899-80962 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 80963-81920 + Free inodes: 20225-20480 +Group 80: (Blocks 81921-82944) + Block bitmap at 81921 (+0), Inode bitmap at 81922 (+1) + Inode table at 81923-81986 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 81987-82944 + Free inodes: 20481-20736 +Group 81: (Blocks 82945-83968) + Backup superblock at 82945, Group descriptors at 82946-82951 + Reserved GDT blocks at 82952-83202 + Block bitmap at 83203 (+258), Inode bitmap at 83204 (+259) + Inode table at 83205-83268 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 83269-83968 + Free inodes: 20737-20992 +Group 82: (Blocks 83969-84992) + Block bitmap at 83969 (+0), Inode bitmap at 83970 (+1) + Inode table at 83971-84034 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 84035-84992 + Free inodes: 20993-21248 +Group 83: (Blocks 84993-86016) + Block bitmap at 84993 (+0), Inode bitmap at 84994 (+1) + Inode table at 84995-85058 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 85059-86016 + Free inodes: 21249-21504 +Group 84: (Blocks 86017-87040) + Block bitmap at 86017 (+0), Inode bitmap at 86018 (+1) + Inode table at 86019-86082 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 86083-87040 + Free inodes: 21505-21760 +Group 85: (Blocks 87041-88064) + Block bitmap at 87041 (+0), Inode bitmap at 87042 (+1) + Inode table at 87043-87106 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 87107-88064 + Free inodes: 21761-22016 +Group 86: (Blocks 88065-89088) + Block bitmap at 88065 (+0), Inode bitmap at 88066 (+1) + Inode table at 88067-88130 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 88131-89088 + Free inodes: 22017-22272 +Group 87: (Blocks 89089-90112) + Block bitmap at 89089 (+0), Inode bitmap at 89090 (+1) + Inode table at 89091-89154 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 89155-90112 + Free inodes: 22273-22528 +Group 88: (Blocks 90113-91136) + Block bitmap at 90113 (+0), Inode bitmap at 90114 (+1) + Inode table at 90115-90178 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 90179-91136 + Free inodes: 22529-22784 +Group 89: (Blocks 91137-92160) + Block bitmap at 91137 (+0), Inode bitmap at 91138 (+1) + Inode table at 91139-91202 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 91203-92160 + Free inodes: 22785-23040 +Group 90: (Blocks 92161-93184) + Block bitmap at 92161 (+0), Inode bitmap at 92162 (+1) + Inode table at 92163-92226 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 92227-93184 + Free inodes: 23041-23296 +Group 91: (Blocks 93185-94208) + Block bitmap at 93185 (+0), Inode bitmap at 93186 (+1) + Inode table at 93187-93250 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 93251-94208 + Free inodes: 23297-23552 +Group 92: (Blocks 94209-95232) + Block bitmap at 94209 (+0), Inode bitmap at 94210 (+1) + Inode table at 94211-94274 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 94275-95232 + Free inodes: 23553-23808 +Group 93: (Blocks 95233-96256) + Block bitmap at 95233 (+0), Inode bitmap at 95234 (+1) + Inode table at 95235-95298 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 95299-96256 + Free inodes: 23809-24064 +Group 94: (Blocks 96257-97280) + Block bitmap at 96257 (+0), Inode bitmap at 96258 (+1) + Inode table at 96259-96322 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 96323-97280 + Free inodes: 24065-24320 +Group 95: (Blocks 97281-98304) + Block bitmap at 97281 (+0), Inode bitmap at 97282 (+1) + Inode table at 97283-97346 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 97347-98304 + Free inodes: 24321-24576 +Group 96: (Blocks 98305-99328) + Block bitmap at 98305 (+0), Inode bitmap at 98306 (+1) + Inode table at 98307-98370 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 98371-99328 + Free inodes: 24577-24832 +Group 97: (Blocks 99329-100352) + Block bitmap at 99329 (+0), Inode bitmap at 99330 (+1) + Inode table at 99331-99394 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 99395-100352 + Free inodes: 24833-25088 +Group 98: (Blocks 100353-101376) + Block bitmap at 100353 (+0), Inode bitmap at 100354 (+1) + Inode table at 100355-100418 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 100419-101376 + Free inodes: 25089-25344 +Group 99: (Blocks 101377-102400) + Block bitmap at 101377 (+0), Inode bitmap at 101378 (+1) + Inode table at 101379-101442 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 101443-102400 + Free inodes: 25345-25600 +Group 100: (Blocks 102401-103424) + Block bitmap at 102401 (+0), Inode bitmap at 102402 (+1) + Inode table at 102403-102466 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 102467-103424 + Free inodes: 25601-25856 +Group 101: (Blocks 103425-104448) + Block bitmap at 103425 (+0), Inode bitmap at 103426 (+1) + Inode table at 103427-103490 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 103491-104448 + Free inodes: 25857-26112 +Group 102: (Blocks 104449-105472) + Block bitmap at 104449 (+0), Inode bitmap at 104450 (+1) + Inode table at 104451-104514 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 104515-105472 + Free inodes: 26113-26368 +Group 103: (Blocks 105473-106496) + Block bitmap at 105473 (+0), Inode bitmap at 105474 (+1) + Inode table at 105475-105538 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 105539-106496 + Free inodes: 26369-26624 +Group 104: (Blocks 106497-107520) + Block bitmap at 106497 (+0), Inode bitmap at 106498 (+1) + Inode table at 106499-106562 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 106563-107520 + Free inodes: 26625-26880 +Group 105: (Blocks 107521-108544) + Block bitmap at 107521 (+0), Inode bitmap at 107522 (+1) + Inode table at 107523-107586 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 107587-108544 + Free inodes: 26881-27136 +Group 106: (Blocks 108545-109568) + Block bitmap at 108545 (+0), Inode bitmap at 108546 (+1) + Inode table at 108547-108610 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 108611-109568 + Free inodes: 27137-27392 +Group 107: (Blocks 109569-110592) + Block bitmap at 109569 (+0), Inode bitmap at 109570 (+1) + Inode table at 109571-109634 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 109635-110592 + Free inodes: 27393-27648 +Group 108: (Blocks 110593-111616) + Block bitmap at 110593 (+0), Inode bitmap at 110594 (+1) + Inode table at 110595-110658 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 110659-111616 + Free inodes: 27649-27904 +Group 109: (Blocks 111617-112640) + Block bitmap at 111617 (+0), Inode bitmap at 111618 (+1) + Inode table at 111619-111682 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 111683-112640 + Free inodes: 27905-28160 +Group 110: (Blocks 112641-113664) + Block bitmap at 112641 (+0), Inode bitmap at 112642 (+1) + Inode table at 112643-112706 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 112707-113664 + Free inodes: 28161-28416 +Group 111: (Blocks 113665-114688) + Block bitmap at 113665 (+0), Inode bitmap at 113666 (+1) + Inode table at 113667-113730 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 113731-114688 + Free inodes: 28417-28672 +Group 112: (Blocks 114689-115712) + Block bitmap at 114689 (+0), Inode bitmap at 114690 (+1) + Inode table at 114691-114754 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 114755-115712 + Free inodes: 28673-28928 +Group 113: (Blocks 115713-116736) + Block bitmap at 115713 (+0), Inode bitmap at 115714 (+1) + Inode table at 115715-115778 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 115779-116736 + Free inodes: 28929-29184 +Group 114: (Blocks 116737-117760) + Block bitmap at 116737 (+0), Inode bitmap at 116738 (+1) + Inode table at 116739-116802 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 116803-117760 + Free inodes: 29185-29440 +Group 115: (Blocks 117761-118784) + Block bitmap at 117761 (+0), Inode bitmap at 117762 (+1) + Inode table at 117763-117826 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 117827-118784 + Free inodes: 29441-29696 +Group 116: (Blocks 118785-119808) + Block bitmap at 118785 (+0), Inode bitmap at 118786 (+1) + Inode table at 118787-118850 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 118851-119808 + Free inodes: 29697-29952 +Group 117: (Blocks 119809-120832) + Block bitmap at 119809 (+0), Inode bitmap at 119810 (+1) + Inode table at 119811-119874 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 119875-120832 + Free inodes: 29953-30208 +Group 118: (Blocks 120833-121856) + Block bitmap at 120833 (+0), Inode bitmap at 120834 (+1) + Inode table at 120835-120898 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 120899-121856 + Free inodes: 30209-30464 +Group 119: (Blocks 121857-122880) + Block bitmap at 121857 (+0), Inode bitmap at 121858 (+1) + Inode table at 121859-121922 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 121923-122880 + Free inodes: 30465-30720 +Group 120: (Blocks 122881-123904) + Block bitmap at 122881 (+0), Inode bitmap at 122882 (+1) + Inode table at 122883-122946 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 122947-123904 + Free inodes: 30721-30976 +Group 121: (Blocks 123905-124928) + Block bitmap at 123905 (+0), Inode bitmap at 123906 (+1) + Inode table at 123907-123970 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 123971-124928 + Free inodes: 30977-31232 +Group 122: (Blocks 124929-125952) + Block bitmap at 124929 (+0), Inode bitmap at 124930 (+1) + Inode table at 124931-124994 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 124995-125952 + Free inodes: 31233-31488 +Group 123: (Blocks 125953-126976) + Block bitmap at 125953 (+0), Inode bitmap at 125954 (+1) + Inode table at 125955-126018 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 126019-126976 + Free inodes: 31489-31744 +Group 124: (Blocks 126977-128000) + Block bitmap at 126977 (+0), Inode bitmap at 126978 (+1) + Inode table at 126979-127042 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 127043-128000 + Free inodes: 31745-32000 +Group 125: (Blocks 128001-129024) + Backup superblock at 128001, Group descriptors at 128002-128007 + Reserved GDT blocks at 128008-128258 + Block bitmap at 128259 (+258), Inode bitmap at 128260 (+259) + Inode table at 128261-128324 (+260) + 700 free blocks, 256 free inodes, 0 directories + Free blocks: 128325-129024 + Free inodes: 32001-32256 +Group 126: (Blocks 129025-130048) + Block bitmap at 129025 (+0), Inode bitmap at 129026 (+1) + Inode table at 129027-129090 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 129091-130048 + Free inodes: 32257-32512 +Group 127: (Blocks 130049-131072) + Block bitmap at 130049 (+0), Inode bitmap at 130050 (+1) + Inode table at 130051-130114 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 130115-131072 + Free inodes: 32513-32768 +Group 128: (Blocks 131073-132096) + Block bitmap at 131073 (+0), Inode bitmap at 131074 (+1) + Inode table at 131075-131138 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 131139-132096 + Free inodes: 32769-33024 +Group 129: (Blocks 132097-133120) + Block bitmap at 132097 (+0), Inode bitmap at 132098 (+1) + Inode table at 132099-132162 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 132163-133120 + Free inodes: 33025-33280 +Group 130: (Blocks 133121-134144) + Block bitmap at 133121 (+0), Inode bitmap at 133122 (+1) + Inode table at 133123-133186 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 133187-134144 + Free inodes: 33281-33536 +Group 131: (Blocks 134145-135168) + Block bitmap at 134145 (+0), Inode bitmap at 134146 (+1) + Inode table at 134147-134210 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 134211-135168 + Free inodes: 33537-33792 +Group 132: (Blocks 135169-136192) + Block bitmap at 135169 (+0), Inode bitmap at 135170 (+1) + Inode table at 135171-135234 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 135235-136192 + Free inodes: 33793-34048 +Group 133: (Blocks 136193-137216) + Block bitmap at 136193 (+0), Inode bitmap at 136194 (+1) + Inode table at 136195-136258 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 136259-137216 + Free inodes: 34049-34304 +Group 134: (Blocks 137217-138240) + Block bitmap at 137217 (+0), Inode bitmap at 137218 (+1) + Inode table at 137219-137282 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 137283-138240 + Free inodes: 34305-34560 +Group 135: (Blocks 138241-139264) + Block bitmap at 138241 (+0), Inode bitmap at 138242 (+1) + Inode table at 138243-138306 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 138307-139264 + Free inodes: 34561-34816 +Group 136: (Blocks 139265-140288) + Block bitmap at 139265 (+0), Inode bitmap at 139266 (+1) + Inode table at 139267-139330 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 139331-140288 + Free inodes: 34817-35072 +Group 137: (Blocks 140289-141312) + Block bitmap at 140289 (+0), Inode bitmap at 140290 (+1) + Inode table at 140291-140354 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 140355-141312 + Free inodes: 35073-35328 +Group 138: (Blocks 141313-142336) + Block bitmap at 141313 (+0), Inode bitmap at 141314 (+1) + Inode table at 141315-141378 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 141379-142336 + Free inodes: 35329-35584 +Group 139: (Blocks 142337-143360) + Block bitmap at 142337 (+0), Inode bitmap at 142338 (+1) + Inode table at 142339-142402 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 142403-143360 + Free inodes: 35585-35840 +Group 140: (Blocks 143361-144384) + Block bitmap at 143361 (+0), Inode bitmap at 143362 (+1) + Inode table at 143363-143426 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 143427-144384 + Free inodes: 35841-36096 +Group 141: (Blocks 144385-145408) + Block bitmap at 144385 (+0), Inode bitmap at 144386 (+1) + Inode table at 144387-144450 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 144451-145408 + Free inodes: 36097-36352 +Group 142: (Blocks 145409-146432) + Block bitmap at 145409 (+0), Inode bitmap at 145410 (+1) + Inode table at 145411-145474 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 145475-146432 + Free inodes: 36353-36608 +Group 143: (Blocks 146433-147456) + Block bitmap at 146433 (+0), Inode bitmap at 146434 (+1) + Inode table at 146435-146498 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 146499-147456 + Free inodes: 36609-36864 +Group 144: (Blocks 147457-148480) + Block bitmap at 147457 (+0), Inode bitmap at 147458 (+1) + Inode table at 147459-147522 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 147523-148480 + Free inodes: 36865-37120 +Group 145: (Blocks 148481-149504) + Block bitmap at 148481 (+0), Inode bitmap at 148482 (+1) + Inode table at 148483-148546 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 148547-149504 + Free inodes: 37121-37376 +Group 146: (Blocks 149505-150528) + Block bitmap at 149505 (+0), Inode bitmap at 149506 (+1) + Inode table at 149507-149570 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 149571-150528 + Free inodes: 37377-37632 +Group 147: (Blocks 150529-151552) + Block bitmap at 150529 (+0), Inode bitmap at 150530 (+1) + Inode table at 150531-150594 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 150595-151552 + Free inodes: 37633-37888 +Group 148: (Blocks 151553-152576) + Block bitmap at 151553 (+0), Inode bitmap at 151554 (+1) + Inode table at 151555-151618 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 151619-152576 + Free inodes: 37889-38144 +Group 149: (Blocks 152577-153600) + Block bitmap at 152577 (+0), Inode bitmap at 152578 (+1) + Inode table at 152579-152642 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 152643-153600 + Free inodes: 38145-38400 +Group 150: (Blocks 153601-154624) + Block bitmap at 153601 (+0), Inode bitmap at 153602 (+1) + Inode table at 153603-153666 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 153667-154624 + Free inodes: 38401-38656 +Group 151: (Blocks 154625-155648) + Block bitmap at 154625 (+0), Inode bitmap at 154626 (+1) + Inode table at 154627-154690 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 154691-155648 + Free inodes: 38657-38912 +Group 152: (Blocks 155649-156672) + Block bitmap at 155649 (+0), Inode bitmap at 155650 (+1) + Inode table at 155651-155714 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 155715-156672 + Free inodes: 38913-39168 +Group 153: (Blocks 156673-157696) + Block bitmap at 156673 (+0), Inode bitmap at 156674 (+1) + Inode table at 156675-156738 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 156739-157696 + Free inodes: 39169-39424 +Group 154: (Blocks 157697-158720) + Block bitmap at 157697 (+0), Inode bitmap at 157698 (+1) + Inode table at 157699-157762 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 157763-158720 + Free inodes: 39425-39680 +Group 155: (Blocks 158721-159744) + Block bitmap at 158721 (+0), Inode bitmap at 158722 (+1) + Inode table at 158723-158786 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 158787-159744 + Free inodes: 39681-39936 +Group 156: (Blocks 159745-160768) + Block bitmap at 159745 (+0), Inode bitmap at 159746 (+1) + Inode table at 159747-159810 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 159811-160768 + Free inodes: 39937-40192 +Group 157: (Blocks 160769-161792) + Block bitmap at 160769 (+0), Inode bitmap at 160770 (+1) + Inode table at 160771-160834 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 160835-161792 + Free inodes: 40193-40448 +Group 158: (Blocks 161793-162816) + Block bitmap at 161793 (+0), Inode bitmap at 161794 (+1) + Inode table at 161795-161858 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 161859-162816 + Free inodes: 40449-40704 +Group 159: (Blocks 162817-163840) + Block bitmap at 162817 (+0), Inode bitmap at 162818 (+1) + Inode table at 162819-162882 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 162883-163840 + Free inodes: 40705-40960 +Group 160: (Blocks 163841-164864) + Block bitmap at 163841 (+0), Inode bitmap at 163842 (+1) + Inode table at 163843-163906 (+2) + 958 free blocks, 256 free inodes, 0 directories + Free blocks: 163907-164864 + Free inodes: 40961-41216 +Group 161: (Blocks 164865-165535) + Block bitmap at 164865 (+0), Inode bitmap at 164866 (+1) + Inode table at 164867-164930 (+2) + 605 free blocks, 256 free inodes, 0 directories + Free blocks: 164931-165535 + Free inodes: 41217-41472 diff --git a/tests/r_resize_inode/name b/tests/r_resize_inode/name new file mode 100644 index 0000000..53e4e6f --- /dev/null +++ b/tests/r_resize_inode/name @@ -0,0 +1 @@ +filesystem resize with a resize_inode present diff --git a/tests/r_resize_inode/script b/tests/r_resize_inode/script new file mode 100644 index 0000000..d884232 --- /dev/null +++ b/tests/r_resize_inode/script @@ -0,0 +1,95 @@ +if test -x $RESIZE2FS_EXE; then + +FSCK_OPT=-yf +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 > $OUT.new +$MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 16384 >> $OUT.new 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo resize2fs -p test.img 65536 >> $OUT.new +$RESIZE2FS -p $TMPFILE 65536 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo "--------------------------------" >> $OUT.new + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 >> $OUT.new +$MKE2FS -q -F -O resize_inode -o Linux -b 1024 -g 1024 $TMPFILE 65536 >> $OUT.new 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo resize2fs -p test.img 16384 >> $OUT.new +$RESIZE2FS -p $TMPFILE 16384 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 + +echo "--------------------------------" >> $OUT.new + +echo resize2fs -p test.img 165536 >> $OUT.new +$RESIZE2FS -p $TMPFILE 165536 >> $OUT.new 2>&1 + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +$DEBUGFS -R "set_super_value lastcheck 0" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value hash_seed null" -w $TMPFILE >/dev/null 2>&1 +$DEBUGFS -R "set_super_value mkfs_time 0" -w $TMPFILE >/dev/null 2>&1 +$TUNE2FS -c 20 -U clear $TMPFILE >/dev/null 2>&1 + +echo dumpe2fs test.img >> $OUT.new +$DUMPE2FS $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed -e '/Block bitmap.*$/N;s/\n Inode bitmap/, Inode bitmap/g' < $OUT.new > $OUT +rm -f $TMPFILE $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP + +else #if test -x $RESIZE2FS; then + echo "$test_name: $test_description: skipped" +fi diff --git a/tests/run_e2fsck b/tests/run_e2fsck new file mode 100644 index 0000000..e2c6596 --- /dev/null +++ b/tests/run_e2fsck @@ -0,0 +1,112 @@ +if [ "$DESCRIPTION"x != x ]; then + test_description="$DESCRIPTION" +fi +if [ "$IMAGE"x = x ]; then + IMAGE=$test_dir/image.gz +fi + +if [ "$FSCK_OPT"x = x ]; then + FSCK_OPT=-yf +fi + +if [ "$SECOND_FSCK_OPT"x = x ]; then + SECOND_FSCK_OPT=-yf +fi + +if [ "$OUT1"x = x ]; then + OUT1=$test_name.1.log +fi + +if [ "$OUT2"x = x ]; then + OUT2=$test_name.2.log +fi + +if [ "$EXP1"x = x ]; then + if [ -f $test_dir/expect.1.gz ]; then + EXP1=$test_name.1.tmp + gunzip < $test_dir/expect.1.gz > $EXP1 + else + EXP1=$test_dir/expect.1 + fi +fi + +if [ "$EXP2"x = x ]; then + if [ -f $test_dir/expect.2.gz ]; then + EXP2=$test_name.2.tmp + gunzip < $test_dir/expect.2.gz > $EXP2 + else + EXP2=$test_dir/expect.2 + fi +fi + +if [ "$SKIP_GUNZIP" != "true" ] ; then + gunzip < $IMAGE > $TMPFILE +fi + +cp /dev/null $OUT1 + +eval $PREP_CMD + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT1.new 2>&1 +status=$? +echo Exit status is $status >> $OUT1.new +sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1 +rm -f $OUT1.new + +if [ "$ONE_PASS_ONLY" != "true" ]; then + $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 + status=$? + echo Exit status is $status >> $OUT2.new + sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2 + rm -f $OUT2.new +fi + +eval $AFTER_CMD + +if [ "$SKIP_VERIFY" != "true" ] ; then + rm -f $test_name.ok $test_name.failed + cmp -s $OUT1 $EXP1 + status1=$? + if [ "$ONE_PASS_ONLY" != "true" ]; then + cmp -s $OUT2 $EXP2 + status2=$? + else + status2=0 + fi + if [ "$PASS_ZERO" = "true" ]; then + cmp -s $test_name.0.log $test_dir/expect.0 + status3=$? + else + status3=0 + fi + + if [ -z "$test_description" ] ; then + description="$test_name" + else + description="$test_name: $test_description" + fi + + if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then + echo "$description: ok" + touch $test_name.ok + else + echo "$description: failed" + rm -f $test_name.failed + if [ "$PASS_ZERO" = "true" ]; then + diff $DIFF_OPTS $test_dir/expect.0 \ + $test_name.0.log >> $test_name.failed + fi + diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed + if [ "$ONE_PASS_ONLY" != "true" ]; then + diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed + fi + fi + rm -f tmp_expect +fi + +if [ "$SKIP_CLEANUP" != "true" ] ; then + unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 + unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD + unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO +fi + diff --git a/tests/run_mke2fs b/tests/run_mke2fs new file mode 100644 index 0000000..7a47f56 --- /dev/null +++ b/tests/run_mke2fs @@ -0,0 +1,27 @@ +if test -x $DEBUGFS_EXE; then + +if [ "$FS_SIZE"x = x ]; then + FS_SIZE=1024 +fi +OUT1=$test_name.1.log +OUT2=$test_name.2.log +SKIP_GUNZIP=true +ONE_PASS_ONLY=true +MKE2FS_SKIP_PROGRESS=true +MKE2FS_SKIP_CHECK_MSG=true +export MKE2FS_SKIP_PROGRESS MKE2FS_SKIP_CHECK_MSG +> $TMPFILE +PREP_CMD='$MKE2FS -F -o Linux $MKE2FS_OPTS $TMPFILE $FS_SIZE 2>&1 | + sed -f $cmd_dir/filter.sed >> $OUT1; + $DEBUGFS -R features $TMPFILE 2>&1 | + sed -f $cmd_dir/filter.sed >> $OUT1' +AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT1' +. $cmd_dir/run_e2fsck + +else #if test -x $DEBUGFS_EXE; then + rm -f $test_name.ok $test_name.failed + echo "skipped (no debugfs)" +fi + +unset DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS \ + MKE2FS_DEVICE_SECTSIZE diff --git a/tests/scripts/gen-test-data b/tests/scripts/gen-test-data new file mode 100755 index 0000000..0cbd928 --- /dev/null +++ b/tests/scripts/gen-test-data @@ -0,0 +1,23 @@ +#!/bin/sh + +t1="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. " +t2="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. " +t3="Licensed Product under the copyright owner that is not possible to put the Notice in a manner which does not specify a version number of this document is to say, a work based on the Program (including Contributions) may always be distributed subject to the Licensed Product. Intellectual Property Matters. Third Party Claims. If you develop a new version of the Derivative Works, in at least six (6) months after a subsequent version of this section has the right to acquire, license, develop, have others develop for it, market and/or distribute the Program (or a work based on infringement of intellectual property laws of the Package, in its Contribution, if any, specified by the terms of this Agreement more than your cost of all necessary servicing, repair, or correction. In no event and under no obligation to respond to any patent claims licensable by a copyright notice appear in all copies of it that are distributed by the terms applicable to software that is included in any Digital Font Program, which may be used to render or display fonts. Program shall mean a computer system. " + +export LANG=C +export LC_ALL=C + +t="$t1$t2$t3" +len=${#t} + +c=131072 + +while test $c -gt 0 ; do + if test $c -gt $len ; then + echo -n "$t" + c=$(($c - $len)) + else + echo -n "$t" | cut -c -$(($c - 1)) + c=0 + fi +done diff --git a/tests/scripts/mkdup b/tests/scripts/mkdup new file mode 100755 index 0000000..c48a9f0 --- /dev/null +++ b/tests/scripts/mkdup @@ -0,0 +1,49 @@ +#!/bin/sh +OPTS="-O bigalloc -C 8192" +SIZE=4096 +IMG=/tmp/foo.img +TMP=$(mktemp) +SIZE_A=15000 +SIZE_B=5000 +SIZE_C=20000 + +DEBUGFS=./debugfs/debugfs +MKE2FS=./misc/mke2fs +FSCK=./e2fsck/e2fsck + +dd if=/dev/zero of=$IMG bs=1k count=$SIZE +echo $MKE2FS -F -t ext4 -L test $OPTS test.img $SIZE +$MKE2FS -F -t ext4 -L test $OPTS $IMG $SIZE +dd if=/dev/zero of=$TMP bs=$SIZE_A count=1 >& /dev/null +echo Writing $SIZE_A bytes to a +$DEBUGFS -w -R "write $TMP a" $IMG +BLKS=$(./debugfs/debugfs -R "blocks a" $IMG) +cp /dev/null $TMP +echo "Releasing blocks $BLKS" +for i in $BLKS ; do echo "freeb $i" >> $TMP; done +$DEBUGFS -w $IMG < $TMP >& /dev/null + +echo Writing $SIZE_B bytes to b +dd if=/dev/zero of=$TMP bs=$SIZE_B count=1 >& /dev/null +$DEBUGFS -w -R "write $TMP b" $IMG +if [ -n "$SIZE_C" ]; then + BLKS=$(./debugfs/debugfs -R "blocks b" $IMG) + cp /dev/null $TMP + echo "Releasing blocks $BLKS" + for i in $BLKS ; do echo "freeb $i" >> $TMP; done + $DEBUGFS -w $IMG < $TMP >& /dev/null + + echo Writing $SIZE_C bytes to c + dd if=/dev/zero of=$TMP bs=$SIZE_C count=1 >& /dev/null + $DEBUGFS -w -R "write $TMP c" $IMG +fi +echo "set_inode_field a mtime 201107040000" > $TMP +echo "set_inode_field b mtime 201107050000" >> $TMP +if [ -n "$SIZE_C" ]; then + echo "set_inode_field c mtime 201107060000" >> $TMP +fi +$DEBUGFS -w $IMG < $TMP >& /dev/null + +$FSCK -fy $IMG +rm $TMP + diff --git a/tests/scripts/repair-test b/tests/scripts/repair-test new file mode 100755 index 0000000..c164e6e --- /dev/null +++ b/tests/scripts/repair-test @@ -0,0 +1,9 @@ +#!/bin/sh +for T in "$*"; do + [ -f "$T.failed" -a -d "$T" ] || + { echo "usage: $0 <test_to_repair>"; exit 1; } + + cp $T.1.log $T/expect.1 + cp $T.2.log $T/expect.2 + ./test_one $T +done diff --git a/tests/scripts/resize_test b/tests/scripts/resize_test new file mode 100755 index 0000000..a000c85 --- /dev/null +++ b/tests/scripts/resize_test @@ -0,0 +1,183 @@ +#!/bin/sh + +# old distros are missing "truncate", emulate it with "dd" if necessary +do_truncate() +{ + [ "$1" = "-s" ] && size=$2 && shift 2 + + if ! truncate -s $size $1 >> $LOG 2>&1 ; then + dd if=/dev/zero of=$1 bs=1 count=0 seek=$size >> $LOG 2>&1 + fi +} + +resize_test () { +DBG_FLAGS=63 + +echo $test_description starting > $LOG +rm -f $TMPFILE +touch $TMPFILE + +# Verify that the $TMP filesystem handles $SIZE_2 sparse files. +# If that fails, try the local filesystem instead. +if do_truncate -s $SIZE_2 $TMPFILE 2> /dev/null; then + echo "using $TMPFILE" >> $LOG +else + rm $TMPFILE + export TMPFILE=$(mktemp ./$test_name.tmp.XXXXXX) + touch $TMPFILE + echo "using $TMPFILE" >> $LOG + if ! do_truncate -s $SIZE_2 $TMPFILE >> $LOG 2>&1; then + rm $TMPFILE + return 111 + fi +fi +> $TMPFILE + +echo $MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 >> $LOG +$MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 >> $LOG + +OUT_TMP=$(mktemp ${TMPDIR:-/tmp}/csum-tmp.XXXXXX) + +date > $OUT_TMP +cat $E2FSCK >> $OUT_TMP +echo $CRCSUM $OUT_TMP >> $LOG 2>&1 +CSUM_1=$($CRCSUM $OUT_TMP) +echo Checksum is $CSUM_1 >> $LOG + +echo Setting up file system >> $LOG +$DEBUGFS -w $TMPFILE >> $LOG 2>&1 << EOF +mkdir test +cd test +write $OUT_TMP e2fsck +ls /test +stat /test/e2fsck +quit +EOF +echo " " >> $LOG + +rm -f $OUT_TMP + +echo $FSCK -fy $TMPFILE >> $LOG 2>&1 +$FSCK -fy $TMPFILE >> $LOG 2>&1 + +chmod u-w $TMPFILE +echo $RESIZE2FS -P $TMPFILE >> $LOG 2>&1 +if ! $RESIZE2FS -P $TMPFILE >> $LOG 2>&1 +then + return 1 +fi +chmod u+w $TMPFILE + +echo $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS $TMPFILE $SIZE_2 >> $LOG 2>&1 +if ! $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS $TMPFILE $SIZE_2 >> $LOG 2>&1 +then + return 1 +fi + +echo $FSCK -fy $TMPFILE >> $LOG 2>&1 +if ! $FSCK -fy $TMPFILE >> $LOG 2>&1 +then + $DUMPE2FS $TMPFILE >> $LOG + return 1 +fi + +echo $DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 +$DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 + +echo $CRCSUM $OUT_TMP >> $LOG 2>&1 +CSUM_2=$($CRCSUM $OUT_TMP) +echo Checksum is $CSUM_2 >> $LOG + +if test "$CSUM_1" != "$CSUM_2" +then + return 1 +fi + +# Uncomment to grab extra debugging image +# +#mv $TMPFILE /tmp/foo.img +#return 0 + +echo $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +if ! $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +then + return 1 +fi + +echo $FSCK -fy $TMPFILE >> $LOG 2>&1 +if ! $FSCK -fy $TMPFILE >> $LOG 2>&1 +then + $DUMPE2FS $TMPFILE >> $LOG + return 1 +fi + +echo $DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 +$DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 + +echo $CRCSUM $OUT_TMP >> $LOG 2>&1 +CSUM_2=$($CRCSUM $OUT_TMP) +echo Checksum is $CSUM_2 >> $LOG + +if test "$CSUM_1" != "$CSUM_2" +then + return 1 +fi + +echo $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +if ! $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +then + return 1 +fi + +echo $FSCK -fy $TMPFILE >> $LOG 2>&1 +if ! $FSCK -fy $TMPFILE >> $LOG 2>&1 +then + $DUMPE2FS $TMPFILE >> $LOG + return 1 +fi + +echo $DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 +$DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 + +echo $CRCSUM $OUT_TMP >> $LOG 2>&1 +CSUM_2=$($CRCSUM $OUT_TMP) +echo Checksum is $CSUM_2 >> $LOG + +if test "$CSUM_1" != "$CSUM_2" +then + return 1 +fi + +echo $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +if ! $RESIZE2FS $RESIZE2FS_OPTS -d $DBG_FLAGS -M $TMPFILE $SIZE_2 >> $LOG 2>&1 +then + return 1 +fi + +echo $FSCK -fy $TMPFILE >> $LOG 2>&1 +if ! $FSCK -fy $TMPFILE >> $LOG 2>&1 +then + $DUMPE2FS $TMPFILE >> $LOG + return 1 +fi + +echo $DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 +$DEBUGFS -R "dump /test/e2fsck $OUT_TMP" $TMPFILE >> $LOG 2>&1 + +echo $CRCSUM $OUT_TMP >> $LOG 2>&1 +CSUM_2=$($CRCSUM $OUT_TMP) +echo Checksum is $CSUM_2 >> $LOG + +rm $OUT_TMP +unset OUT_TMP + +rm -f $TMPFILE + +if test "$CSUM_1" != "$CSUM_2" +then + return 1 +fi + +return 0 + +} diff --git a/tests/t_change_uuid/expect b/tests/t_change_uuid/expect new file mode 100644 index 0000000..0a9b20e --- /dev/null +++ b/tests/t_change_uuid/expect @@ -0,0 +1,7 @@ +create fs without metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 diff --git a/tests/t_change_uuid/script b/tests/t_change_uuid/script new file mode 100755 index 0000000..d568f46 --- /dev/null +++ b/tests/t_change_uuid/script @@ -0,0 +1,34 @@ +test_description="change uuid on a pre-metadata-csum" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without metadata_csum" >> $OUT +$MKE2FS -O ^metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_change_uuid_mcsum/expect b/tests/t_change_uuid_mcsum/expect new file mode 100644 index 0000000..fb26e72 --- /dev/null +++ b/tests/t_change_uuid_mcsum/expect @@ -0,0 +1,7 @@ +create fs with metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 diff --git a/tests/t_change_uuid_mcsum/script b/tests/t_change_uuid_mcsum/script new file mode 100755 index 0000000..4ec5776 --- /dev/null +++ b/tests/t_change_uuid_mcsum/script @@ -0,0 +1,34 @@ +test_description="change uuid on a metadata-csum" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs with metadata_csum" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_change_uuid_mcsum_mounted/expect b/tests/t_change_uuid_mcsum_mounted/expect new file mode 100644 index 0000000..e10e9a9 --- /dev/null +++ b/tests/t_change_uuid_mcsum_mounted/expect @@ -0,0 +1,7 @@ +create fs with metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +change UUID +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c diff --git a/tests/t_change_uuid_mcsum_mounted/script b/tests/t_change_uuid_mcsum_mounted/script new file mode 100755 index 0000000..f94bfbb --- /dev/null +++ b/tests/t_change_uuid_mcsum_mounted/script @@ -0,0 +1,34 @@ +test_description="change uuid on a metadata-csum" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs with metadata_csum" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_change_uuid_mcsum_seed_mounted/expect b/tests/t_change_uuid_mcsum_seed_mounted/expect new file mode 100644 index 0000000..b2d2d91 --- /dev/null +++ b/tests/t_change_uuid_mcsum_seed_mounted/expect @@ -0,0 +1,21 @@ +create fs with metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +change UUID +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 diff --git a/tests/t_change_uuid_mcsum_seed_mounted/script b/tests/t_change_uuid_mcsum_seed_mounted/script new file mode 100755 index 0000000..19fdbed --- /dev/null +++ b/tests/t_change_uuid_mcsum_seed_mounted/script @@ -0,0 +1,52 @@ +test_description="change meta-csum uuid with mcsum-seed" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs with metadata_csum" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum seed" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O metadata_csuM_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_change_uuid_mounted/expect b/tests/t_change_uuid_mounted/expect new file mode 100644 index 0000000..0a9b20e --- /dev/null +++ b/tests/t_change_uuid_mounted/expect @@ -0,0 +1,7 @@ +create fs without metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 diff --git a/tests/t_change_uuid_mounted/script b/tests/t_change_uuid_mounted/script new file mode 100755 index 0000000..150f451 --- /dev/null +++ b/tests/t_change_uuid_mounted/script @@ -0,0 +1,34 @@ +test_description="change uuid on a mounted pre-metadata-csum" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without metadata_csum" >> $OUT +$MKE2FS -O ^metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_dangerous/expect b/tests/t_dangerous/expect new file mode 100644 index 0000000..31aaf4f --- /dev/null +++ b/tests/t_dangerous/expect @@ -0,0 +1,120 @@ +tune2fs dangerous prompts test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 445 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +tune2fs -O metadata_csum test.img + +This operation requires a freshly checked filesystem. + +Please run e2fsck -f on the filesystem. + +Exit status is 1 +tune2fs -O metadata_csum test.img +Exit status is 0 +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 445 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O metadata_csum test.img +Enabling checksums could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) +Exit status is 1 +tune2fs -I 512 test.img +Resizing inodes could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) +Exit status is 1 + +Change in FS metadata: +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 + +Exit status is 0 +tune2fs -O metadata_csum test.img +Enabling checksums could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) +This operation requires a freshly checked filesystem. + +Please run e2fsck -fD on the filesystem. + +Exit status is 0 +test_filesys was not cleanly unmounted, check forced. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +tune2fs -I 512 test.img +Resizing inodes could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) Setting inode size 512 +Exit status is 0 +tune2fs -U f0f0f0f0-f0f0-f0f0-f0f0-f0f0f0f0f0f0 test.img +Setting the UUID on this filesystem could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) Exit status is 0 +Backing up journal inode block information. + + +Change in FS metadata: +@@ -1,3 +1,3 @@ +-Filesystem UUID: 6fc3daa4-180d-4f2b-a6f2-f7a5efb79bcf +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit sparse_super large_file huge_file uninit_bg dir_nlink extra_isize +-Inode size: 256 ++Filesystem UUID: f0f0f0f0-f0f0-f0f0-f0f0-f0f0f0f0f0f0 ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit sparse_super large_file huge_file dir_nlink extra_isize metadata_csum ++Inode size: 512 +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 + +Exit status is 0 + +Testing with metadata checksum enabled +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 445 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -U random test.img +Setting the UUID on this filesystem could take some time. +Proceed anyway (or wait 5 seconds to proceed) ? (y,N) +Exit status is 1 diff --git a/tests/t_dangerous/name b/tests/t_dangerous/name new file mode 100644 index 0000000..c9a1030 --- /dev/null +++ b/tests/t_dangerous/name @@ -0,0 +1 @@ +dangerous tune2fs operation prompts diff --git a/tests/t_dangerous/script b/tests/t_dangerous/script new file mode 100644 index 0000000..a6d3dc4 --- /dev/null +++ b/tests/t_dangerous/script @@ -0,0 +1,155 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,^flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 32M + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } + ext4m = { + features = has_journal,extent,huge_file,^flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 32M + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs dangerous prompts test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux -U 6fc3daa4-180d-4f2b-a6f2-f7a5efb79bcf $TMPFILE 524288 >> $OUT 2>&1 + +# trigger a filesystem check +$DEBUGFS -w -R 'ssv mtime now' $TMPFILE > /dev/null 2>&1 +$DEBUGFS -w -R 'ssv lastcheck 20000' $TMPFILE > /dev/null 2>&1 + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +$TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check fs +$FSCK -f -y -N test_filesys $TMPFILE > /dev/null 2>&1 + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +$TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux -U 6fc3daa4-180d-4f2b-a6f2-f7a5efb79bcf $TMPFILE 524288 >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -f -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +echo 'n' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# change inode size +echo "tune2fs -I 512 test.img" >> $OUT +echo 'n' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -I 512 $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +$DUMPE2FS $TMPFILE 2> /dev/null | egrep '^(Filesystem features:|Filesystem UUID:|Inode size:)' > $OUT.before + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +echo 'y' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# change inode size +echo "tune2fs -I 512 test.img" >> $OUT +echo 'y' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -I 512 $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# change uuid +echo "tune2fs -U f0f0f0f0-f0f0-f0f0-f0f0-f0f0f0f0f0f0 test.img" >> $OUT +echo 'y' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -U f0f0f0f0-f0f0-f0f0-f0f0-f0f0f0f0f0f0 $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | egrep '^(Filesystem features:|Filesystem UUID:|Inode size:)' > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +echo " " >> $OUT +echo "Testing with metadata checksum enabled" >> $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4m -o Linux -U 6fc3daa4-180d-4f2b-a6f2-f7a5efb79bcf $TMPFILE 524288 >> $OUT 2>&1 +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -f -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# change uuid +echo "tune2fs -U random test.img" >> $OUT +echo 'n' | TUNE2FS_FORCE_PROMPT=1 $TUNE2FS -U random $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after $CONF + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_disable_changed_csum_seed/expect b/tests/t_disable_changed_csum_seed/expect new file mode 100644 index 0000000..e00f367 --- /dev/null +++ b/tests/t_disable_changed_csum_seed/expect @@ -0,0 +1,17 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +turn off csum_seed +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 diff --git a/tests/t_disable_changed_csum_seed/script b/tests/t_disable_changed_csum_seed/script new file mode 100755 index 0000000..449689a --- /dev/null +++ b/tests/t_disable_changed_csum_seed/script @@ -0,0 +1,47 @@ +test_description="tune2fs disable csum seed after uuid change" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn off csum_seed" >> $OUT +$TUNE2FS -O ^metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_disable_changed_csum_seed_mounted/expect b/tests/t_disable_changed_csum_seed_mounted/expect new file mode 100644 index 0000000..288494b --- /dev/null +++ b/tests/t_disable_changed_csum_seed_mounted/expect @@ -0,0 +1,19 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change UUID +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +turn off csum_seed +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 +Checksum seed: 0x3ba62721 diff --git a/tests/t_disable_changed_csum_seed_mounted/script b/tests/t_disable_changed_csum_seed_mounted/script new file mode 100755 index 0000000..ea2184f --- /dev/null +++ b/tests/t_disable_changed_csum_seed_mounted/script @@ -0,0 +1,47 @@ +test_description="mounted tune2fs disable csum+uuid" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change UUID" >> $OUT +$TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn off csum_seed" >> $OUT +EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O ^metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_disable_csum_seed/expect b/tests/t_disable_csum_seed/expect new file mode 100644 index 0000000..e6c50fe --- /dev/null +++ b/tests/t_disable_csum_seed/expect @@ -0,0 +1,14 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +turn off csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c diff --git a/tests/t_disable_csum_seed/script b/tests/t_disable_csum_seed/script new file mode 100755 index 0000000..e762ad4 --- /dev/null +++ b/tests/t_disable_csum_seed/script @@ -0,0 +1,43 @@ +test_description="disable csum seed via tune2fs" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn off csum_seed" >> $OUT +$TUNE2FS -O ^metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_disable_mcsum/expect b/tests/t_disable_mcsum/expect new file mode 100644 index 0000000..bfa21b8 --- /dev/null +++ b/tests/t_disable_mcsum/expect @@ -0,0 +1,45 @@ +tune2fs ^metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O ^metadata_csum test.img +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -34,7 +34,6 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks +-Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +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 + +Exit status is 0 diff --git a/tests/t_disable_mcsum/name b/tests/t_disable_mcsum/name new file mode 100644 index 0000000..cf9dc8d --- /dev/null +++ b/tests/t_disable_mcsum/name @@ -0,0 +1 @@ +disable metadata_csum diff --git a/tests/t_disable_mcsum/script b/tests/t_disable_mcsum/script new file mode 100644 index 0000000..117969d --- /dev/null +++ b/tests/t_disable_mcsum/script @@ -0,0 +1,67 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs ^metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# remove mcsum +echo "tune2fs -O ^metadata_csum test.img" >> $OUT +$TUNE2FS -O ^metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_disable_mcsum_noinitbg/expect b/tests/t_disable_mcsum_noinitbg/expect new file mode 100644 index 0000000..fe61fcb --- /dev/null +++ b/tests/t_disable_mcsum_noinitbg/expect @@ -0,0 +1,68 @@ +tune2fs ^metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O ^metadata_csum,^uninit_bg test.img +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -34,7 +34,6 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks +-Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +@@ -50,18 +49,18 @@ + Block bitmap at 262 (+261) + Inode bitmap at 278 (+277) + Inode table at 294-549 (+293) +- 21 free blocks, 536 free inodes, 2 directories, 536 unused inodes ++ 21 free blocks, 536 free inodes, 2 directories + Free blocks: 4413-4433 + Free inodes: 489-1024 +-Group 1: (Blocks 8193-16384) [INODE_UNINIT] ++Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8197 + Reserved GDT blocks at 8198-8453 + Block bitmap at 263 (bg #0 + 262) + Inode bitmap at 279 (bg #0 + 278) + Inode table at 550-805 (bg #0 + 549) +- 0 free blocks, 1024 free inodes, 0 directories, 1024 unused inodes ++ 0 free blocks, 1024 free inodes, 0 directories + Free blocks: + Free inodes: 1025-2048 +-Group 2: (Blocks 16385-24576) [INODE_UNINIT] ++Group 2: (Blocks 16385-24576) + Block bitmap at 264 (bg #0 + 263) + Inode bitmap at 280 (bg #0 + 279) +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 + +Exit status is 0 diff --git a/tests/t_disable_mcsum_noinitbg/name b/tests/t_disable_mcsum_noinitbg/name new file mode 100644 index 0000000..4b906be --- /dev/null +++ b/tests/t_disable_mcsum_noinitbg/name @@ -0,0 +1 @@ +disable metadata_csum and uninit_bg diff --git a/tests/t_disable_mcsum_noinitbg/script b/tests/t_disable_mcsum_noinitbg/script new file mode 100644 index 0000000..bc2bad7 --- /dev/null +++ b/tests/t_disable_mcsum_noinitbg/script @@ -0,0 +1,67 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs ^metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# remove mcsum +echo "tune2fs -O ^metadata_csum,^uninit_bg test.img" >> $OUT +$TUNE2FS -O ^metadata_csum,^uninit_bg $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_disable_mcsum_yesinitbg/expect b/tests/t_disable_mcsum_yesinitbg/expect new file mode 100644 index 0000000..b906248 --- /dev/null +++ b/tests/t_disable_mcsum_yesinitbg/expect @@ -0,0 +1,45 @@ +tune2fs ^metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O ^metadata_csum,uninit_bg test.img +Exit status is 0 +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -34,7 +34,6 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks +-Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +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 + +Exit status is 0 diff --git a/tests/t_disable_mcsum_yesinitbg/name b/tests/t_disable_mcsum_yesinitbg/name new file mode 100644 index 0000000..880de1c --- /dev/null +++ b/tests/t_disable_mcsum_yesinitbg/name @@ -0,0 +1 @@ +disable metadata_csum and enable uninit_bg diff --git a/tests/t_disable_mcsum_yesinitbg/script b/tests/t_disable_mcsum_yesinitbg/script new file mode 100644 index 0000000..8fadc57 --- /dev/null +++ b/tests/t_disable_mcsum_yesinitbg/script @@ -0,0 +1,67 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit,metadata_csum + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs ^metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux $TMPFILE 524288 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# remove mcsum +echo "tune2fs -O ^metadata_csum,uninit_bg test.img" >> $OUT +$TUNE2FS -O ^metadata_csum,uninit_bg $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_disable_meta_csum_and_seed/expect b/tests/t_disable_meta_csum_and_seed/expect new file mode 100644 index 0000000..a1c9cca --- /dev/null +++ b/tests/t_disable_meta_csum_and_seed/expect @@ -0,0 +1,14 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +turn off metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c diff --git a/tests/t_disable_meta_csum_and_seed/script b/tests/t_disable_meta_csum_and_seed/script new file mode 100755 index 0000000..52d7f62 --- /dev/null +++ b/tests/t_disable_meta_csum_and_seed/script @@ -0,0 +1,44 @@ +test_description="disable csum seed and csums via tune2fs" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn off metadata_csum" >> $OUT +$TUNE2FS -O ^metadata_csum $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | grep 'metadata_csum' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_enable_csum_seed/expect b/tests/t_enable_csum_seed/expect new file mode 100644 index 0000000..07d9a4f --- /dev/null +++ b/tests/t_enable_csum_seed/expect @@ -0,0 +1,12 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change uuid +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 diff --git a/tests/t_enable_csum_seed/script b/tests/t_enable_csum_seed/script new file mode 100755 index 0000000..78ccbeb --- /dev/null +++ b/tests/t_enable_csum_seed/script @@ -0,0 +1,38 @@ +test_description="enable csum seed via tune2fs" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change uuid" >> $OUT +$TUNE2FS -U 1dd136c6-e47a-4833-9bf5-519f8aacabe4 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_enable_mcsum/expect b/tests/t_enable_mcsum/expect new file mode 100644 index 0000000..fcb0ed1 --- /dev/null +++ b/tests/t_enable_mcsum/expect @@ -0,0 +1,80 @@ +tune2fs metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O metadata_csum test.img + +This operation requires a freshly checked filesystem. + +Please run e2fsck -fD on the filesystem. + +Exit status is 0 +test_filesys was not cleanly unmounted, check forced. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -11,7 +11,7 @@ + Block count: 524288 + Reserved block count: 26214 + Overhead clusters: 35246 +-Free blocks: 571 ++Free blocks: 568 + Free inodes: 65048 + First block: 1 + Block size: 1024 +@@ -34,6 +34,7 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks ++Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +@@ -49,8 +50,8 @@ + Block bitmap at 262 (+261) + Inode bitmap at 278 (+277) + Inode table at 294-549 (+293) +- 21 free blocks, 536 free inodes, 2 directories, 536 unused inodes +- Free blocks: 4413-4433 ++ 18 free blocks, 536 free inodes, 2 directories, 536 unused inodes ++ Free blocks: 4413, 4417-4433 + Free inodes: 489-1024 + Group 1: (Blocks 8193-16384) [INODE_UNINIT] + Backup superblock at 8193, Group descriptors at 8194-8197 +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 + +Exit status is 0 diff --git a/tests/t_enable_mcsum/name b/tests/t_enable_mcsum/name new file mode 100644 index 0000000..22f295a --- /dev/null +++ b/tests/t_enable_mcsum/name @@ -0,0 +1 @@ +enable metadata_csum diff --git a/tests/t_enable_mcsum/script b/tests/t_enable_mcsum/script new file mode 100644 index 0000000..3a5409b --- /dev/null +++ b/tests/t_enable_mcsum/script @@ -0,0 +1,70 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -o Linux -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +$TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_enable_mcsum_ext3/expect b/tests/t_enable_mcsum_ext3/expect new file mode 100644 index 0000000..3bd2ccf --- /dev/null +++ b/tests/t_enable_mcsum_ext3/expect @@ -0,0 +1,75 @@ +tune2fs metadata_csum test +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +mke2fs: Operation not supported for inodes containing extents while creating huge files +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O metadata_csum test.img +Extents are not enabled. The file extent tree can be checksummed, whereas block maps cannot. Not enabling extents reduces the coverage of metadata checksumming. Re-run with -O extent to rectify. +64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Run resize2fs -b to rectify. +Exit status is 0 + +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file metadata_csum + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -30,6 +30,7 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks ++Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +@@ -39,7 +40,7 @@ + Journal start: 0 + + +-Group 0: (Blocks 1-8192) ++Group 0: (Blocks 1-8192) [ITABLE_ZEROED] + Primary superblock at 1, Group descriptors at 2-3 + Reserved GDT blocks at 4-259 + Block bitmap at 260 (+259) +@@ -48,7 +49,7 @@ + 0 free blocks, 1013 free inodes, 2 directories + Free blocks: + Free inodes: 12-1024 +-Group 1: (Blocks 8193-16384) ++Group 1: (Blocks 8193-16384) [ITABLE_ZEROED] + Backup superblock at 8193, Group descriptors at 8194-8195 + Reserved GDT blocks at 8196-8451 + Block bitmap at 8452 (+259) +@@ -57,6 +58,6 @@ + 0 free blocks, 1024 free inodes, 0 directories + Free blocks: + Free inodes: 1025-2048 +-Group 2: (Blocks 16385-24576) ++Group 2: (Blocks 16385-24576) [ITABLE_ZEROED] + Block bitmap at 16385 (+0) + Inode bitmap at 16386 (+1) +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 + +Exit status is 0 diff --git a/tests/t_enable_mcsum_ext3/name b/tests/t_enable_mcsum_ext3/name new file mode 100644 index 0000000..d9a29c8 --- /dev/null +++ b/tests/t_enable_mcsum_ext3/name @@ -0,0 +1 @@ +enable metadata_csum on ext3 fs diff --git a/tests/t_enable_mcsum_ext3/script b/tests/t_enable_mcsum_ext3/script new file mode 100644 index 0000000..c008c0a --- /dev/null +++ b/tests/t_enable_mcsum_ext3/script @@ -0,0 +1,70 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,^extent,^huge_file,^flex_bg,^uninit_bg,^dir_nlink,^extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,^64bit + blocksize = 1024 + inode_size = 128 + make_hugefiles = true + hugefiles_dir = / + num_hugefiles = 10 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -o Linux -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +$TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_enable_mcsum_initbg/expect b/tests/t_enable_mcsum_initbg/expect new file mode 100644 index 0000000..987141f --- /dev/null +++ b/tests/t_enable_mcsum_initbg/expect @@ -0,0 +1,100 @@ +tune2fs metadata_csum test +Creating filesystem with 524288 1k blocks and 65536 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 477 huge file(s) with 1024 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -O metadata_csum test.img + +This operation requires a freshly checked filesystem. + +Please run e2fsck -fD on the filesystem. + +Exit status is 0 +test_filesys was not cleanly unmounted, check forced. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -2,7 +2,7 @@ + Last mounted on: <not available> + Filesystem magic number: 0xEF53 + Filesystem revision #: 1 (dynamic) +-Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize ++Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum + Default mount options: user_xattr acl + Filesystem state: clean + Errors behavior: Continue +@@ -11,7 +11,7 @@ + Block count: 524288 + Reserved block count: 26214 + Overhead clusters: 35246 +-Free blocks: 571 ++Free blocks: 568 + Free inodes: 65048 + First block: 1 + Block size: 1024 +@@ -34,6 +34,7 @@ + Journal inode: 8 + Default directory hash: half_md4 + Journal backup: inode blocks ++Checksum type: crc32c + Journal features: (none) + Total journal size: 16M + Total journal blocks: 16384 +@@ -43,24 +44,24 @@ + Journal start: 0 + + +-Group 0: (Blocks 1-8192) ++Group 0: (Blocks 1-8192) [ITABLE_ZEROED] + Primary superblock at 1, Group descriptors at 2-5 + Reserved GDT blocks at 6-261 + Block bitmap at 262 (+261) + Inode bitmap at 278 (+277) + Inode table at 294-549 (+293) +- 21 free blocks, 536 free inodes, 2 directories +- Free blocks: 4413-4433 ++ 18 free blocks, 536 free inodes, 2 directories, 536 unused inodes ++ Free blocks: 4413, 4417-4433 + Free inodes: 489-1024 +-Group 1: (Blocks 8193-16384) ++Group 1: (Blocks 8193-16384) [INODE_UNINIT, ITABLE_ZEROED] + Backup superblock at 8193, Group descriptors at 8194-8197 + Reserved GDT blocks at 8198-8453 + Block bitmap at 263 (bg #0 + 262) + Inode bitmap at 279 (bg #0 + 278) + Inode table at 550-805 (bg #0 + 549) +- 0 free blocks, 1024 free inodes, 0 directories ++ 0 free blocks, 1024 free inodes, 0 directories, 1024 unused inodes + Free blocks: + Free inodes: 1025-2048 +-Group 2: (Blocks 16385-24576) ++Group 2: (Blocks 16385-24576) [INODE_UNINIT, ITABLE_ZEROED] + Block bitmap at 264 (bg #0 + 263) + Inode bitmap at 280 (bg #0 + 279) +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 + +Exit status is 0 diff --git a/tests/t_enable_mcsum_initbg/name b/tests/t_enable_mcsum_initbg/name new file mode 100644 index 0000000..291eb6b --- /dev/null +++ b/tests/t_enable_mcsum_initbg/name @@ -0,0 +1 @@ +enable metadata_csum when ^uninit_bg diff --git a/tests/t_enable_mcsum_initbg/script b/tests/t_enable_mcsum_initbg/script new file mode 100644 index 0000000..975b0f3 --- /dev/null +++ b/tests/t_enable_mcsum_initbg/script @@ -0,0 +1,70 @@ +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,^uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "tune2fs metadata_csum test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -o Linux -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.before +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# add mcsum +echo "tune2fs -O metadata_csum test.img" >> $OUT +$TUNE2FS -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# check +$FSCK -yD -N test_filesys $TMPFILE >> $OUT 2>&1 + +# dump and check +$DUMPE2FS $TMPFILE 2> /dev/null | grep '^Group 0:' -B99 -A20 | sed -f $cmd_dir/filter.sed > $OUT.after +echo "Change in FS metadata:" >> $OUT +diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE $OUT.before $OUT.after + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_ext_jnl_fail/expect b/tests/t_ext_jnl_fail/expect new file mode 100644 index 0000000..db0aecb --- /dev/null +++ b/tests/t_ext_jnl_fail/expect @@ -0,0 +1,6 @@ +Creating filesystem with 4096 1k blocks and 0 inodes +Superblock backups stored on blocks: + +Zeroing journal device: +tune2fs external journal +Cannot modify a journal device. diff --git a/tests/t_ext_jnl_fail/name b/tests/t_ext_jnl_fail/name new file mode 100644 index 0000000..2fe7d04 --- /dev/null +++ b/tests/t_ext_jnl_fail/name @@ -0,0 +1 @@ +tune2fs fail external journal diff --git a/tests/t_ext_jnl_fail/script b/tests/t_ext_jnl_fail/script new file mode 100644 index 0000000..2831416 --- /dev/null +++ b/tests/t_ext_jnl_fail/script @@ -0,0 +1,30 @@ +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 1024 -O journal_dev,metadata_csum -T ext4 $TMPFILE 4096 > $OUT 2>&1 +echo "tune2fs external journal" >> $OUT +$TUNE2FS -i 0 $TMPFILE >> $OUT 2>&1 +rm -f $TMPFILE + +sed -f $cmd_dir/filter.sed < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/t_ext_jnl_rm/script b/tests/t_ext_jnl_rm/script new file mode 100644 index 0000000..b2af80c --- /dev/null +++ b/tests/t_ext_jnl_rm/script @@ -0,0 +1,26 @@ +test_description="remove missing external journal device" +OUT=$test_name.log + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE >> $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 + +echo "debugfs add journal device/UUID" >> $OUT +$DEBUGFS -w -f - $TMPFILE <<- EOF >> $OUT 2>&1 + feature has_journal + ssv journal_dev 0x9999 + ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a33 +EOF + +echo "tune2fs -f -O ^has_journal $TMPFILE" >> $OUT +$TUNE2FS -f -O ^has_journal $TMPFILE >> $OUT 2>&1 +$DUMPE2FS -h $TMPFILE >> $OUT 2>&1 +if [ "$(grep 'Journal UUID:' $OUT)" ]; then + mv $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +else + echo "$test_name: $test_description: ok" + mv $test_name.log $test_name.ok +fi +rm -f $TMPFILE diff --git a/tests/t_format_csum_seed/expect b/tests/t_format_csum_seed/expect new file mode 100644 index 0000000..39e6d6a --- /dev/null +++ b/tests/t_format_csum_seed/expect @@ -0,0 +1,10 @@ +create fs with csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change uuid +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 diff --git a/tests/t_format_csum_seed/script b/tests/t_format_csum_seed/script new file mode 100755 index 0000000..3038785 --- /dev/null +++ b/tests/t_format_csum_seed/script @@ -0,0 +1,34 @@ +test_description="format with csum_seed" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs with csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "change uuid" >> $OUT +$TUNE2FS -U 1dd136c6-e47a-4833-9bf5-519f8aacabe4 $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + diff --git a/tests/t_iexpand_full/expect b/tests/t_iexpand_full/expect new file mode 100644 index 0000000..f99ab4b --- /dev/null +++ b/tests/t_iexpand_full/expect @@ -0,0 +1,39 @@ +tune2fs test +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 6368 huge file(s) with 117 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -I 256 test.img +Setting inode size 256 +Exit status is 0 +Change in FS metadata: +@@ -14 +14 @@ +-Free blocks: 12301 ++Free blocks: 12 +@@ -23 +23 @@ +-Inode blocks per group: 128 ++Inode blocks per group: 256 +@@ -29 +29 @@ +-Inode size: 128 ++Inode size: 256 +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 + +Exit status is 0 diff --git a/tests/t_iexpand_full/name b/tests/t_iexpand_full/name new file mode 100644 index 0000000..2241b34 --- /dev/null +++ b/tests/t_iexpand_full/name @@ -0,0 +1 @@ +expand inodes on a totally full filesystem diff --git a/tests/t_iexpand_full/script b/tests/t_iexpand_full/script new file mode 100644 index 0000000..2d347c2 --- /dev/null +++ b/tests/t_iexpand_full/script @@ -0,0 +1,83 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +if [ $(uname -s) = "Darwin" ]; then + # creates a 3GB filesystem + echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +#gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg,metadata_csum,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 12000K + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 117K + zero_hugefiles = false + } +ENDL + +echo "tune2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux -I 128 $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2>&1 | sed -f $cmd_dir/filter.sed -e '/^Checksum:.*/d' >> $OUT.before 2> /dev/null +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# convert it +echo "tune2fs -I 256 test.img" >> $OUT +dd if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=3221225471 2> /dev/null +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2>&1 | sed -f $cmd_dir/filter.sed -e '/^Checksum:.*/d' >> $OUT.after 2> /dev/null +echo "Change in FS metadata:" >> $OUT +diff -U 0 $OUT.before $OUT.after | sed -e '/^---.*/d' -e '/^+++.*/d' >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_iexpand_mcsum/expect b/tests/t_iexpand_mcsum/expect new file mode 100644 index 0000000..354b117 --- /dev/null +++ b/tests/t_iexpand_mcsum/expect @@ -0,0 +1,57 @@ +tune2fs test +128-byte inodes cannot handle dates beyond 2038 and are deprecated +Creating filesystem with 786432 1k blocks and 98304 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Creating 6334 huge file(s) with 117 blocks each: done +Writing superblocks and filesystem accounting information: done + +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 + +Exit status is 0 +tune2fs -I 256 -O metadata_csum test.img +Setting inode size 256 + +This operation requires a freshly checked filesystem. + +Please run e2fsck -fD on the filesystem. + +Exit status is 0 +Backing up journal inode block information. + +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Pass 5: Checking group summary information + + + +Change in FS metadata: +@@ -5 +5 @@ +-Filesystem features: has_journal ext_attr dir_index filetype extent 64bit sparse_super large_file huge_file uninit_bg dir_nlink extra_isize ++Filesystem features: has_journal ext_attr dir_index filetype extent 64bit sparse_super large_file huge_file dir_nlink extra_isize metadata_csum +@@ -22 +22 @@ +-Inode blocks per group: 128 ++Inode blocks per group: 256 +@@ -28 +28 @@ +-Inode size: 128 ++Inode size: 256 +@@ -31,0 +32 @@ ++Checksum type: crc32c +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 + +Exit status is 0 diff --git a/tests/t_iexpand_mcsum/name b/tests/t_iexpand_mcsum/name new file mode 100644 index 0000000..e767715 --- /dev/null +++ b/tests/t_iexpand_mcsum/name @@ -0,0 +1 @@ +expand inodes and turn on metadata_csum diff --git a/tests/t_iexpand_mcsum/script b/tests/t_iexpand_mcsum/script new file mode 100644 index 0000000..9ee75cf --- /dev/null +++ b/tests/t_iexpand_mcsum/script @@ -0,0 +1,84 @@ +if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" + return 0 +fi + +if [ $(uname -s) = "Darwin" ]; then + # creates a 3GB filesystem + echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" + return 0 +fi + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +#gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,^resize_inode,^meta_bg,^flex_bg,^metadata_csum,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 16000K + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 117K + zero_hugefiles = false + } +ENDL + +echo "tune2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h -o Linux -I 128 $TMPFILE 786432 >> $OUT 2>&1 +rm -f $CONF + +# dump and check +($DUMPE2FS -h $TMPFILE | grep -v '^Free blocks:'; $DUMPE2FS -g $TMPFILE) 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT.before 2> /dev/null +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# convert it +echo "tune2fs -I 256 -O metadata_csum test.img" >> $OUT +dd if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=3221225471 2> /dev/null +$TUNE2FS -I 256 -O metadata_csum $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT +$FSCK -N test_filesys -y -f -D $TMPFILE >> $OUT 2>&1 + +# dump and check +($DUMPE2FS -h $TMPFILE | grep -v '^Free blocks:'; $DUMPE2FS -g $TMPFILE) 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT.after 2> /dev/null +echo "Change in FS metadata:" >> $OUT +diff -U 0 $OUT.before $OUT.after | sed -e '/^---.*/d' -e '/^+++.*/d' >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e 's/test_filesys:.*//g' < $OUT > $OUT.new +mv $OUT.new $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $OUT.before $OUT.after + +unset IMAGE FSCK_OPT OUT EXP CONF diff --git a/tests/t_mmp_1on/name b/tests/t_mmp_1on/name new file mode 100644 index 0000000..62e16b2 --- /dev/null +++ b/tests/t_mmp_1on/name @@ -0,0 +1 @@ +enable MMP using tune2fs diff --git a/tests/t_mmp_1on/script b/tests/t_mmp_1on/script new file mode 100644 index 0000000..733395e --- /dev/null +++ b/tests/t_mmp_1on/script @@ -0,0 +1,29 @@ +FSCK_OPT=-yf + +$MKE2FS -q -F -o Linux -b 4096 $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -O mmp -E mmp_update_interval=1 $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O mmp failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with MMP enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_mmp_2off/name b/tests/t_mmp_2off/name new file mode 100644 index 0000000..d7cac51 --- /dev/null +++ b/tests/t_mmp_2off/name @@ -0,0 +1 @@ +disable MMP using tune2fs diff --git a/tests/t_mmp_2off/script b/tests/t_mmp_2off/script new file mode 100644 index 0000000..1cd0719 --- /dev/null +++ b/tests/t_mmp_2off/script @@ -0,0 +1,29 @@ +FSCK_OPT=-yf + +$MKE2FS -q -F -o Linux -b 4096 -O mmp $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -O ^mmp $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O ^mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck after MMP disable failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_mmp_fail/is_slow_test b/tests/t_mmp_fail/is_slow_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/t_mmp_fail/is_slow_test diff --git a/tests/t_mmp_fail/name b/tests/t_mmp_fail/name new file mode 100644 index 0000000..e872dda --- /dev/null +++ b/tests/t_mmp_fail/name @@ -0,0 +1 @@ +error running tune2fs with MMP diff --git a/tests/t_mmp_fail/script b/tests/t_mmp_fail/script new file mode 100644 index 0000000..5fa6a84 --- /dev/null +++ b/tests/t_mmp_fail/script @@ -0,0 +1,44 @@ +FSCK_OPT=-yf + +$MKE2FS -q -F -o Linux -I 128 -b 1024 -O mmp $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O mmp failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -O project $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" == 0 ] ; then + echo "'tune2fs -O project' succeeded on small inode" > $test_name.failed + echo "$test_name: $test_description: failed" + return 1 +fi +$TUNE2FS -o bad_option $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" == 0 ] ; then + echo "'tune2fs -o bad_option' succeeded" > $test_name.failed + echo "$test_name: $test_description: failed" + return 1 +fi +$E2MMPSTATUS -i $TMPFILE >> $test_name.log 2>&1 +$E2MMPSTATUS $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "$TUNE2FS left MMP block in bad state" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck after MMP disable failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_project_1on/name b/tests/t_project_1on/name new file mode 100644 index 0000000..6b2dd29 --- /dev/null +++ b/tests/t_project_1on/name @@ -0,0 +1 @@ +enable project using tune2fs -O option diff --git a/tests/t_project_1on/script b/tests/t_project_1on/script new file mode 100644 index 0000000..606963f --- /dev/null +++ b/tests/t_project_1on/script @@ -0,0 +1,41 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -I 256 -b 4096 $TMPFILE 10000 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +dd if=/dev/zero of=$TMPFILE.2 bs=1048576 count=1 >> $test_name.log 2>&1 +cat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1 + write $TMPFILE.2 file1 + set_inode_field file1 projid 500 +EOF +rm -f $TMPFILE.2 + +$TUNE2FS -O project $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O project failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with project enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_project_2off/name b/tests/t_project_2off/name new file mode 100644 index 0000000..293717d --- /dev/null +++ b/tests/t_project_2off/name @@ -0,0 +1 @@ +disable project using tune2fs diff --git a/tests/t_project_2off/script b/tests/t_project_2off/script new file mode 100644 index 0000000..98696b4 --- /dev/null +++ b/tests/t_project_2off/script @@ -0,0 +1,35 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -I 256 -b 4096 -O quota,project $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O quota,project failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -O ^project $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O ^project failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with project enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +rm -f $TMPFILE diff --git a/tests/t_project_3on/name b/tests/t_project_3on/name new file mode 100644 index 0000000..9a10680 --- /dev/null +++ b/tests/t_project_3on/name @@ -0,0 +1 @@ +enable project using tune2fs -Q option diff --git a/tests/t_project_3on/script b/tests/t_project_3on/script new file mode 100644 index 0000000..5eaaa15 --- /dev/null +++ b/tests/t_project_3on/script @@ -0,0 +1,41 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -I 256 -b 4096 $TMPFILE 10000 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +dd if=/dev/zero of=$TMPFILE.2 bs=1048576 count=1 >> $test_name.log 2>&1 +cat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1 + write $TMPFILE.2 file1 + set_inode_field file1 projid 500 +EOF +rm -f $TMPFILE.2 + +$TUNE2FS -Q prj $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -Q project failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with project enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_project_4off/name b/tests/t_project_4off/name new file mode 100644 index 0000000..5ef6430 --- /dev/null +++ b/tests/t_project_4off/name @@ -0,0 +1 @@ +disable project using tune2fs -Q option diff --git a/tests/t_project_4off/script b/tests/t_project_4off/script new file mode 100644 index 0000000..29de6bc --- /dev/null +++ b/tests/t_project_4off/script @@ -0,0 +1,35 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -I 256 -b 4096 -O quota,project $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O quota,project failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -Q ^prj $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O ^project failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with project enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +rm -f $TMPFILE diff --git a/tests/t_quota_1on/name b/tests/t_quota_1on/name new file mode 100644 index 0000000..f92e2d5 --- /dev/null +++ b/tests/t_quota_1on/name @@ -0,0 +1 @@ +enable quota using tune2fs diff --git a/tests/t_quota_1on/script b/tests/t_quota_1on/script new file mode 100644 index 0000000..3704d7a --- /dev/null +++ b/tests/t_quota_1on/script @@ -0,0 +1,42 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -b 4096 $TMPFILE 10000 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +dd if=/dev/zero of=$TMPFILE.2 bs=1048576 count=1 >> $test_name.log 2>&1 +cat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1 + write $TMPFILE.2 file1 + set_inode_field file1 uid 500 + set_inode_field file1 gid 500 +EOF +rm -f $TMPFILE.2 + +$TUNE2FS -O quota $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O quota failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with quota enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_quota_2off/name b/tests/t_quota_2off/name new file mode 100644 index 0000000..bb0ec98 --- /dev/null +++ b/tests/t_quota_2off/name @@ -0,0 +1 @@ +disable quota using tune2fs diff --git a/tests/t_quota_2off/script b/tests/t_quota_2off/script new file mode 100644 index 0000000..b170c59 --- /dev/null +++ b/tests/t_quota_2off/script @@ -0,0 +1,35 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -b 4096 -O quota $TMPFILE 100 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs -O quota failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$TUNE2FS -O ^quota $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "tune2fs -O ^quota failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with quota enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +rm -f $TMPFILE diff --git a/tests/t_quota_add/name b/tests/t_quota_add/name new file mode 100644 index 0000000..43a4bfd --- /dev/null +++ b/tests/t_quota_add/name @@ -0,0 +1 @@ +add several quota types using tune2fs and check computed usage diff --git a/tests/t_quota_add/script b/tests/t_quota_add/script new file mode 100644 index 0000000..c26c37a --- /dev/null +++ b/tests/t_quota_add/script @@ -0,0 +1,46 @@ +FSCK_OPT=-yf + +if [ "$QUOTA" != "y" ]; then + echo "$test_name: $test_description: skipped" + return 0 +fi + +$MKE2FS -q -F -o Linux -b 4096 -O quota -E quotatype=prjquota $TMPFILE 10000 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +for type in usrquota grpquota; do + $TUNE2FS -Q $type $TMPFILE >> $test_name.log 2>&1 + status=$? + if [ "$status" != 0 ] ; then + echo "tune2fs -O quota failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status + fi +done + +UUSAGE=$($DEBUGFS 2>/dev/null -R "lq user" $TMPFILE | grep "^ *0 ") +for type in group project; do + TUSAGE=$($DEBUGFS 2>/dev/null -R "lq $type" $TMPFILE | grep "^ *0 ") + if [ "$TUSAGE" != "$UUSAGE" ]; then + echo "user and $type quota entries are different" >$test_name.failed + echo "$test_name: $test_description: failed" + return 1 + fi +done + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with quota enabled failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/t_replay_and_set/expect b/tests/t_replay_and_set/expect new file mode 100644 index 0000000..3e19d92 --- /dev/null +++ b/tests/t_replay_and_set/expect @@ -0,0 +1,38 @@ +64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -O 64bit to rectify. +Creating filesystem with 65536 4k blocks and 16384 inodes +Superblock backups stored on blocks: + 32768 + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +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: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 0 +debugfs write journal +set the label on a dirty-journal fs +Recovering journal. +fsck the whole mess +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 +Block bitmap differences: +(0--1050) +(32768--36880) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks +Exit status is 1 diff --git a/tests/t_replay_and_set/name b/tests/t_replay_and_set/name new file mode 100644 index 0000000..4e4759e --- /dev/null +++ b/tests/t_replay_and_set/name @@ -0,0 +1 @@ +recover journal and clear features diff --git a/tests/t_replay_and_set/script b/tests/t_replay_and_set/script new file mode 100644 index 0000000..3b033a8 --- /dev/null +++ b/tests/t_replay_and_set/script @@ -0,0 +1,51 @@ +if ! test -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs)" + return 0 +fi + +FSCK_OPT=-fy +OUT=$test_name.log +if [ -f $test_dir/expect.gz ]; then + EXP=$test_name.tmp + gunzip < $test_dir/expect.gz > $EXP1 +else + EXP=$test_dir/expect +fi + +$MKE2FS -F -o Linux -b 4096 -O has_journal,metadata_csum -T ext4 $TMPFILE 65536 > $OUT.new 2>&1 + +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new + +bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')" + +echo "debugfs write journal" >> $OUT.new +echo "jo" > $TMPFILE.cmd +echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd +echo "jc" >> $TMPFILE.cmd +$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null + +echo "set the label on a dirty-journal fs" >> $OUT.new +$TUNE2FS -L testing $TMPFILE >> $OUT.new 2>&1 + +echo "fsck the whole mess" >> $OUT.new +$FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1 +status=$? +echo Exit status is $status >> $OUT.new +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT +rm -f $TMPFILE $TMPFILE.cmd $OUT.new + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed + rm -f $test_name.tmp +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/t_uninit_bg_rm/expect b/tests/t_uninit_bg_rm/expect new file mode 100644 index 0000000..68f8b51 --- /dev/null +++ b/tests/t_uninit_bg_rm/expect @@ -0,0 +1,21 @@ +mke2fs -q -t ext4 -F -o Linux -b 1024 test.img 1G +tune2fs -f -O ^uninit_bg test.img + +fsck -yf -N test_filesys test.img +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: 11/65536 files (0.0% non-contiguous), 35910/1048576 blocks + +mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 test.img 10G +tune2fs -f -O ^uninit_bg test.img + +fsck -yf -N test_filesys test.img +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: 11/655360 files (0.0% non-contiguous), 232632/10485760 blocks diff --git a/tests/t_uninit_bg_rm/script b/tests/t_uninit_bg_rm/script new file mode 100644 index 0000000..66eb21c --- /dev/null +++ b/tests/t_uninit_bg_rm/script @@ -0,0 +1,55 @@ +test_description="remove uninit_bg" +OUT=$test_name.log +FSCK_OPT=-yf +EXP=$test_dir/expect + +os=$(uname -s) +if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then + # creates a 10GB filesystem + echo "$test_name: $test_description: skipped for $os" + return 0 +fi + +cp /dev/null $TMPFILE + +echo mke2fs -q -t ext4 -F -o Linux -b 1024 test.img 1G > $OUT.new +$MKE2FS -q -t ext4 -F -o Linux -b 1024 $TMPFILE 1G >> $OUT.new 2>&1 + +echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new +$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1 + +echo " " >> $OUT.new +echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + +echo " " >> $OUT.new +cp /dev/null $TMPFILE +echo mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 test.img 10G >> $OUT.new +$MKE2FS -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 $TMPFILE 10G >> $OUT.new 2>&1 + +echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new +$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1 + +echo " " >> $OUT.new +echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 +sed -f $cmd_dir/filter.sed < $OUT.new > $OUT + +rm -f $TMPFILE $OUT.new + +# +# Do the verification +# + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +unset IMAGE FSCK_OPT OUT EXP diff --git a/tests/t_write_subdirectory/name b/tests/t_write_subdirectory/name new file mode 100644 index 0000000..740c409 --- /dev/null +++ b/tests/t_write_subdirectory/name @@ -0,0 +1 @@ +debugfs write creates file in subdirectory diff --git a/tests/t_write_subdirectory/script b/tests/t_write_subdirectory/script new file mode 100644 index 0000000..bb354f8 --- /dev/null +++ b/tests/t_write_subdirectory/script @@ -0,0 +1,29 @@ +FSCK_OPT=-nf + +$MKE2FS -q -F -o Linux -I 256 -b 4096 $TMPFILE 10000 > $test_name.log 2>&1 +status=$? +if [ "$status" != 0 ] ; then + echo "mke2fs failed" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi + +touch $TMPFILE.1 +cat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1 + mkdir aaa + mkdir aaa/bbb + write $TMPFILE.1 aaa/bbb/ccc +EOF +rm -f $TMPFILE.1 + +$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1 +status=$? +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "e2fsck with failed with $status" > $test_name.failed + echo "$test_name: $test_description: failed" + return $status +fi +rm -f $TMPFILE diff --git a/tests/test_config b/tests/test_config new file mode 100644 index 0000000..9dc762c --- /dev/null +++ b/tests/test_config @@ -0,0 +1,48 @@ +# +# Test configuration +# + +unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME PAGER +FSCK="$USE_VALGRIND ../e2fsck/e2fsck" +MKE2FS="$USE_VALGRIND ../misc/mke2fs" +DUMPE2FS="$USE_VALGRIND ../misc/dumpe2fs" +TUNE2FS="$USE_VALGRIND ../misc/tune2fs" +CHATTR="$USE_VALGRIND../misc/chattr" +LSATTR="$USE_VALGRIND ../misc/lsattr" +E2IMAGE="$USE_VALGRIND ../misc/e2image" +E2IMAGE_EXE="../misc/e2image" +DEBUGFS="$USE_VALGRIND ../debugfs/debugfs" +DEBUGFS_EXE="../debugfs/debugfs" +TEST_BITS="test_data.tmp" +RESIZE2FS_EXE="../resize/resize2fs" +RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE" +E2UNDO_EXE="../misc/e2undo" +E2UNDO="$USE_VALGRIND $E2UNDO_EXE" +E2MMPSTATUS="$USE_VALGRIND ../misc/dumpe2fs -m" +TEST_REL=../tests/progs/test_rel +TEST_ICOUNT=../tests/progs/test_icount +CRCSUM=../tests/progs/crcsum +CLEAN_OUTPUT="sed -f $cmd_dir/filter.sed" +LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${LD_LIBRARY_PATH} +DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${DYLD_LIBRARY_PATH} +export LD_LIBRARY_PATH +export DYLD_LIBRARY_PATH +TZ=GMT0 +export TZ +LC_ALL=C +export LC_ALL +E2FSCK_CONFIG=/dev/null +export E2FSCK_CONFIG +MKE2FS_CONFIG=./mke2fs.conf +export MKE2FS_CONFIG +BLKID_FILE=/dev/null +export BLKID_FILE +unset MKE2FS_FIRST_META_BG +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 diff --git a/tests/test_one.in b/tests/test_one.in new file mode 100644 index 0000000..78499ad --- /dev/null +++ b/tests/test_one.in @@ -0,0 +1,92 @@ +#!/bin/sh +# run a single regression test + +export DD + +LC_ALL=C +export LC_ALL + +case "$1" in + --valgrind) + export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls" + shift; + ;; + --valgrind-leakcheck) + export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log" + shift; + ;; + --skip-slow-tests) + SKIP_SLOW_TESTS=yes + shift; + ;; +esac + +case "$1" in + *.failed|*.new|*.ok|*.log|*.tmp|*.slow) exit 0 ;; +esac + +test_dir=$1 +cmd_dir=$SRCDIR + +if test "$TEST_CONFIG"x = x; then + TEST_CONFIG=$SRCDIR/test_config +fi + +. $TEST_CONFIG + +test_name=`echo $test_dir | sed -e 's;.*/;;'` + +if [ -f $test_dir ] ; then + exit 0; +fi +if [ ! -d $test_dir ] ; then + echo "The test '$test_name' does not exist." + exit 0; +fi +if [ -z "`ls $test_dir`" ]; then + exit 0 +fi +if [ -f $test_dir/name ]; then + test_description=`cat $test_dir/name` +else + test_description= +fi + +if [ -n "$SKIP_SLOW_TESTS" -a -f $test_dir/is_slow_test ]; then + echo "$test_name: $test_description: skipped (slow test)" + exit 0 +fi + +rm -f $test_name.ok $test_name.failed $test_name.log $test_name.slow +#echo -e -n "$test_name: $test_description:\r" + +TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX) +[ "$SKIP_UNLINK" != "true" ] && trap 'rm -f $TMPFILE ; exit' 0 1 2 15 + +start=$SECONDS +if [ -f $test_dir/script ]; then + . $test_dir/script +else + test_base=`echo $test_name | sed -e 's/_.*//'` + default_script=$SRCDIR/defaults/${test_base}_script + if [ -f $default_script ]; then + . $SRCDIR/defaults/${test_base}_script + else + echo "$test_name: Missing test script $default_script!" + fi +fi +elapsed=$((SECONDS - start)) +if [ $elapsed -gt 60 -a ! -f $test_dir/is_slow_test ]; then + echo "$test_name: *** took $elapsed seconds to finish ***" | + tee $test_name.slow + echo "$test_name: consider adding $test_dir/is_slow_test" +fi + +if [ -n "$PRINT_FAILED" -a -f $test_name.failed ] ; then + cat $test_name.failed +fi + +if [ "$SKIP_UNLINK" != "true" ] ; then + rm -f $TMPFILE +fi + diff --git a/tests/test_post b/tests/test_post new file mode 100755 index 0000000..1251266 --- /dev/null +++ b/tests/test_post @@ -0,0 +1,17 @@ +#!/bin/sh +# report stats about test scripts that were run + +num_ok=`ls *.ok 2>/dev/null | wc -l` +num_failed=`ls *.failed 2>/dev/null | wc -l` + +echo "$num_ok tests succeeded $num_failed tests failed" + +test "$num_failed" -eq 0 && exit 0 + +echo -n "Tests failed: " +for fname in $(ls *.failed); do + echo -n "${fname%%.failed} " +done +echo "" + +exit 1 diff --git a/tests/test_script.in b/tests/test_script.in new file mode 100644 index 0000000..442999d --- /dev/null +++ b/tests/test_script.in @@ -0,0 +1,52 @@ +#!/bin/sh +# Run all or specified test scripts +# + +case "$1" in + --valgrind) + export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls" + shift + ;; + --valgrind-leakcheck) + export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log" + shift + ;; + --failed) + DO_FAILED=yes + shift + ;; +esac + +TESTS= + +if test -n "$DO_FAILED"; then + FAILED=$(find . -maxdepth 1 -name \*.failed) + if test -z "$FAILED" ; then + echo " " + echo "No (more) failed tests!" + echo " " + fi + for fname in $FAILED ; do + TESTS="$TESTS $SRCDIR/${fname%%.failed}" + done +fi + +for i; do + case $i in + [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;; + *) TESTS="$TESTS $SRCDIR/$i" ;; + esac +done + +if test "$TESTS"x = x ; then + if test -n "$DO_FAILED"; then + exit 0 + fi + TESTS=`ls -d $SRCDIR/[a-zA-Z]_*` +fi + +for test_dir in $TESTS; do + ./test_one $test_dir +done + +$SRCDIR/test_post diff --git a/tests/u_bounce_io/expect.1 b/tests/u_bounce_io/expect.1 new file mode 100644 index 0000000..e1d1845 --- /dev/null +++ b/tests/u_bounce_io/expect.1 @@ -0,0 +1,108 @@ +Creating filesystem with 65536 1k blocks and 16384 inodes +Superblock backups stored on blocks: + 8193, 24577, 40961, 57345 + +Allocating group tables: done +Writing inode tables: done +Writing superblocks and filesystem accounting information: done + +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +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: 11/16384 files (0.0% non-contiguous), 5412/65536 blocks +Exit status is 0 +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: ext_attr resize_inode dir_index filetype sparse_super +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 16384 +Block count: 65536 +Reserved block count: 3276 +Overhead clusters: 5398 +Free blocks: 60124 +Free inodes: 16373 +First block: 1 +Block size: 1024 +Fragment size: 1024 +Reserved GDT blocks: 255 +Blocks per group: 8192 +Fragments per group: 8192 +Inodes per group: 2048 +Inode blocks per group: 512 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Default directory hash: half_md4 + + +Group 0: (Blocks 1-8192) + Primary superblock at 1, Group descriptors at 2-2 + Reserved GDT blocks at 3-257 + Block bitmap at 258 (+257), Inode bitmap at 259 (+258) + Inode table at 260-771 (+259) + 7407 free blocks, 2037 free inodes, 2 directories + Free blocks: 786-8192 + Free inodes: 12-2048 +Group 1: (Blocks 8193-16384) + Backup superblock at 8193, Group descriptors at 8194-8194 + Reserved GDT blocks at 8195-8449 + Block bitmap at 8450 (+257), Inode bitmap at 8451 (+258) + Inode table at 8452-8963 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 8964-16384 + Free inodes: 2049-4096 +Group 2: (Blocks 16385-24576) + Block bitmap at 16385 (+0), Inode bitmap at 16386 (+1) + Inode table at 16387-16898 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 16899-24576 + Free inodes: 4097-6144 +Group 3: (Blocks 24577-32768) + Backup superblock at 24577, Group descriptors at 24578-24578 + Reserved GDT blocks at 24579-24833 + Block bitmap at 24834 (+257), Inode bitmap at 24835 (+258) + Inode table at 24836-25347 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 25348-32768 + Free inodes: 6145-8192 +Group 4: (Blocks 32769-40960) + Block bitmap at 32769 (+0), Inode bitmap at 32770 (+1) + Inode table at 32771-33282 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 33283-40960 + Free inodes: 8193-10240 +Group 5: (Blocks 40961-49152) + Backup superblock at 40961, Group descriptors at 40962-40962 + Reserved GDT blocks at 40963-41217 + Block bitmap at 41218 (+257), Inode bitmap at 41219 (+258) + Inode table at 41220-41731 (+259) + 7421 free blocks, 2048 free inodes, 0 directories + Free blocks: 41732-49152 + Free inodes: 10241-12288 +Group 6: (Blocks 49153-57344) + Block bitmap at 49153 (+0), Inode bitmap at 49154 (+1) + Inode table at 49155-49666 (+2) + 7678 free blocks, 2048 free inodes, 0 directories + Free blocks: 49667-57344 + Free inodes: 12289-14336 +Group 7: (Blocks 57345-65535) + Backup superblock at 57345, Group descriptors at 57346-57346 + Reserved GDT blocks at 57347-57601 + Block bitmap at 57602 (+257), Inode bitmap at 57603 (+258) + Inode table at 57604-58115 (+259) + 7420 free blocks, 2048 free inodes, 0 directories + Free blocks: 58116-65535 + Free inodes: 14337-16384 diff --git a/tests/u_bounce_io/script b/tests/u_bounce_io/script new file mode 100644 index 0000000..5dd6329 --- /dev/null +++ b/tests/u_bounce_io/script @@ -0,0 +1,9 @@ +DESCRIPTION="bounce I/O in unix_io" +DUMPE2FS_IGNORE_80COL=1 +export DUMPE2FS_IGNORE_80COL +UNIX_IO_FORCE_BOUNCE=yes +export UNIX_IO_FORCE_BOUNCE +FS_SIZE=65536 +. $cmd_dir/run_mke2fs +unset DUMPE2FS_IGNORE_80COL +unset UNIX_IO_FORCE_BOUNCE diff --git a/tests/u_compound_bad_rollback/script b/tests/u_compound_bad_rollback/script new file mode 100644 index 0000000..f54da7f --- /dev/null +++ b/tests/u_compound_bad_rollback/script @@ -0,0 +1,62 @@ +test_description="e2undo with mke2fs/tune2fs/resize2fs/e2fsck -z" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +echo compound e2undo rollback test > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 $TMPFILE 256 >> $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 $TMPFILE 256 >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc2 >> $OUT + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.2 $TMPFILE 512 >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc3 >> $OUT + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc0_2 >> $OUT + +echo roll back tune2fs >> $OUT +$E2UNDO $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc1_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo tune2fs $crc1_2 >> $OUT + +echo roll back resize2fs >> $OUT +$E2UNDO $TDB_FILE.2 $TMPFILE >> $OUT 2>&1 +crc2_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo resize2fs $crc2_2 >> $OUT + +echo roll back e2fsck >> $OUT +$E2UNDO $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc3_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck $crc3_2 >> $OUT + +if [ $crc4 = $crc0_2 ] && [ $crc4 = $crc1_2 ] && [ $crc4 = $crc2_2 ] && [ $crc3 = $crc3_2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TDB_FILE.2 $TDB_FILE.3 $TMPFILE +fi diff --git a/tests/u_compound_rollback/script b/tests/u_compound_rollback/script new file mode 100644 index 0000000..0c1fbcc --- /dev/null +++ b/tests/u_compound_rollback/script @@ -0,0 +1,62 @@ +test_description="e2undo with mke2fs/tune2fs/resize2fs/e2fsck -z" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +echo compound e2undo rollback test > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 $TMPFILE 256 >> $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 $TMPFILE 256 >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc2 >> $OUT + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.2 $TMPFILE 512 >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc3 >> $OUT + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT + +echo roll back e2fsck >> $OUT +$E2UNDO $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc3_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck $crc3_2 >> $OUT + +echo roll back resize2fs >> $OUT +$E2UNDO $TDB_FILE.2 $TMPFILE >> $OUT 2>&1 +crc2_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo resize2fs $crc2_2 >> $OUT + +echo roll back tune2fs >> $OUT +$E2UNDO $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc1_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo tune2fs $crc1_2 >> $OUT + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc0_2 >> $OUT + +if [ $crc0 = $crc0_2 ] && [ $crc1 = $crc1_2 ] && [ $crc2 = $crc2_2 ] && [ $crc3 = $crc3_2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TDB_FILE.2 $TDB_FILE.3 $TMPFILE +fi diff --git a/tests/u_corrupt_blk_csum/script b/tests/u_corrupt_blk_csum/script new file mode 100644 index 0000000..ee16552 --- /dev/null +++ b/tests/u_corrupt_blk_csum/script @@ -0,0 +1,38 @@ +test_description="corrupt e2undo block data" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +undo_blks=$(( $(stat -c '%s' $TDB_FILE 2>/dev/null || stat -f '%z' $TDB_FILE 2>/dev/null) / 1024 )) +dd if=/dev/zero of=$TDB_FILE bs=1024 count=1 seek=$((undo_blks - 2)) conv=notrunc > /dev/null 2>&1 + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +res=$? +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $res -ne 0 ] && [ $crc2 = $crc1 ] && [ $crc2 != $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_corrupt_blk_csum_force/script b/tests/u_corrupt_blk_csum_force/script new file mode 100644 index 0000000..ba82726 --- /dev/null +++ b/tests/u_corrupt_blk_csum_force/script @@ -0,0 +1,38 @@ +test_description="force replay of corrupt e2undo block data" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +undo_blks=$(( $(stat -c '%s' $TDB_FILE 2>/dev/null || stat -f '%z' $TDB_FILE 2>/dev/null) / 1024 )) +dd if=/dev/zero of=$TDB_FILE bs=1024 count=1 seek=$((undo_blks - 2)) conv=notrunc > /dev/null 2>&1 + +$E2UNDO -f $TDB_FILE $TMPFILE >> $OUT 2>&1 +res=$? +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc2 != $crc1 ] && [ $crc2 != $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_corrupt_hdr_csum/script b/tests/u_corrupt_hdr_csum/script new file mode 100644 index 0000000..32c38c8 --- /dev/null +++ b/tests/u_corrupt_hdr_csum/script @@ -0,0 +1,37 @@ +test_description="corrupt e2undo header" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +dd if=/dev/zero of=$TDB_FILE bs=256 count=1 seek=1 conv=notrunc > /dev/null 2>&1 + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +res=$? +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $res -ne 0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_corrupt_key_csum/script b/tests/u_corrupt_key_csum/script new file mode 100644 index 0000000..d07556b --- /dev/null +++ b/tests/u_corrupt_key_csum/script @@ -0,0 +1,37 @@ +test_description="corrupt e2undo key data" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +undo_blks=$(( $(stat -c '%s' $TDB_FILE 2>/dev/null || stat -f '%z' $TDB_FILE 2>/dev/null) / 1024 )) +dd if=/dev/zero of=$TDB_FILE bs=1024 count=1 seek=$((undo_blks - 1)) conv=notrunc > /dev/null 2>&1 + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 != $crc1 ] && [ $crc1 = $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_debugfs_opt/script b/tests/u_debugfs_opt/script new file mode 100644 index 0000000..b5a65ec --- /dev/null +++ b/tests/u_debugfs_opt/script @@ -0,0 +1,34 @@ +test_description="e2undo with debugfs -z" +if ! test -x $E2UNDO_EXE -o ! -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped (no debugfs/e2undo)" + return 0 +fi + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before debugfs $crc0 >> $OUT + +echo using debugfs to test e2undo >> $OUT +$DEBUGFS -w -z $TDB_FILE -R 'zap -p 0x55 0' $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after debugfs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE diff --git a/tests/u_direct_io/expect b/tests/u_direct_io/expect new file mode 100644 index 0000000..830cbd7 --- /dev/null +++ b/tests/u_direct_io/expect @@ -0,0 +1,63 @@ +mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP +Creating filesystem with 32768 4k blocks and 32768 inodes + +Allocating group tables: done +Writing inode tables: done +Creating journal (4096 blocks): done +Writing superblocks and filesystem accounting information: done + +debugfs -D -R stats $LOOP +Filesystem volume name: <none> +Last mounted on: <not available> +Filesystem magic number: 0xEF53 +Filesystem revision #: 1 (dynamic) +Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file dir_nlink extra_isize +Default mount options: (none) +Filesystem state: clean +Errors behavior: Continue +Filesystem OS type: Linux +Inode count: 32768 +Block count: 32768 +Reserved block count: 1638 +Overhead clusters: 6155 +Free blocks: 26607 +Free inodes: 32757 +First block: 0 +Block size: 4096 +Fragment size: 4096 +Reserved GDT blocks: 7 +Blocks per group: 32768 +Fragments per group: 32768 +Inodes per group: 32768 +Inode blocks per group: 2048 +Flex block group size: 16 +Mount count: 0 +Check interval: 15552000 (6 months) +Reserved blocks uid: 0 +Reserved blocks gid: 0 +First inode: 11 +Inode size: 256 +Required extra isize: 32 +Desired extra isize: 32 +Journal inode: 8 +Default directory hash: half_md4 +Journal backup: inode blocks +Directories: 2 + Group 0: block bitmap at 9, inode bitmap at 25, inode table at 41 + 26607 free blocks, 32757 free inodes, 2 used directories +e2fsck -fn -N test_filesys $LOOP +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: 11/32768 files (9.1% non-contiguous), 6161/32768 blocks +Exit status is 0 +e2fsck -fn -N test_filesys $TMPFILE +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: 11/32768 files (9.1% non-contiguous), 6161/32768 blocks +Exit status is 0 diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script new file mode 100644 index 0000000..b4f0775 --- /dev/null +++ b/tests/u_direct_io/script @@ -0,0 +1,49 @@ +DESCRIPTION="direct I/O in unix_io" +OUT=$test_name.log +if test "$(id -u)" -ne 0 ; then + echo "$test_name: $DESCRIPTION: skipped (not root)" +elif ! command -v losetup >/dev/null ; then + echo "$test_name: $DESCRIPTION: skipped (no losetup)" +elif test ! -x $DEBUGFS_EXE; then + echo "$test_name: $DESCRIPTION: skipped (no debugfs)" +else + dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1 + LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE) + if [ ! -b "$LOOP" ]; then + echo "$test_name: $DESCRIPTION: skipped (no loop devices)" + rm -f $TMPFILE + exit 0 + fi + echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT + $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \ + sed -f $cmd_dir/filter.sed >> $OUT + + echo debugfs -D -R stats \$LOOP >> $OUT + $DEBUGFS -D -R stats $LOOP 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT + + echo e2fsck -fn -N test_filesys \$LOOP > $OUT.new + $FSCK -fn -N test_filesys $LOOP >> $OUT.new 2>&1 + echo Exit status is $? >> $OUT.new + sed -f $cmd_dir/filter.sed $OUT.new >> $OUT + rm -f $OUT.new + + losetup -d $LOOP + + echo e2fsck -fn -N test_filesys \$TMPFILE > $OUT.new + $FSCK -fn -N test_filesys $TMPFILE >> $OUT.new 2>&1 + echo Exit status is $? >> $OUT.new + sed -f $cmd_dir/filter.sed $OUT.new >> $OUT + rm -f $OUT.new + + cmp -s $test_name.log $test_dir/expect + + if [ "$?" -eq 0 ]; then + echo "$test_name: $DESCRIPTION: ok" + touch $test_name.ok + else + echo "$test_name: $DESCRIPTION: failed" + diff $DIFF_OPTS $test_dir/expect $test_name.log >> $test_name.failed + fi +fi + +unset LOOP diff --git a/tests/u_dryrun/script b/tests/u_dryrun/script new file mode 100644 index 0000000..b90ef47 --- /dev/null +++ b/tests/u_dryrun/script @@ -0,0 +1,32 @@ +test_description="e2undo dry run" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +$E2UNDO -n $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc1 = $crc2 ] && [ $crc1 != $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_e2fsck_opt/script b/tests/u_e2fsck_opt/script new file mode 100644 index 0000000..d61cd2b --- /dev/null +++ b/tests/u_e2fsck_opt/script @@ -0,0 +1,32 @@ +test_description="e2undo with e2fsck -z" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/e2fsck-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before e2fsck $crc0 >> $OUT + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_errorout/script b/tests/u_errorout/script new file mode 100644 index 0000000..20c53de --- /dev/null +++ b/tests/u_errorout/script @@ -0,0 +1,49 @@ +test_description="e2undo a failed command" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +echo check that we cant append a bad undo file > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +CONF=$TMPFILE.conf +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = ^has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 4096 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1K + zero_hugefiles = false + } +ENDL + +echo mke2fs -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 $TMPFILE 524288 >> $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 1024 -z $TDB_FILE.0 -d /etc/ $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc2 >> $OUT + +if [ $crc0 != $crc1 ] && [ $crc1 != $crc2 ] && [ $crc0 = $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TMPFILE $CONF +fi diff --git a/tests/u_force/script b/tests/u_force/script new file mode 100644 index 0000000..ef39e24 --- /dev/null +++ b/tests/u_force/script @@ -0,0 +1,40 @@ +test_description="e2undo force" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +dd if=/dev/zero of=$TDB_FILE bs=4 count=1 seek=127 conv=notrunc 2> /dev/null + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +$E2UNDO -f $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo -f $crc3 >> $OUT + +MUST_FSCK=$($DUMPE2FS $TMPFILE 2> /dev/null | grep 'Filesystem state:.*not clean' -c ) + +if [ $MUST_FSCK -eq 1 ] && [ $crc0 != $crc3 ] && [ $crc1 = $crc2 ] && [ $crc2 != $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_force_dryrun/script b/tests/u_force_dryrun/script new file mode 100644 index 0000000..92d7624 --- /dev/null +++ b/tests/u_force_dryrun/script @@ -0,0 +1,38 @@ +test_description="force dry-run replay of corrupt e2undo block data" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +undo_blks=$(( $(stat -c '%s' $TDB_FILE 2>/dev/null || stat -f '%z' $TDB_FILE 2>/dev/null) / 1024 )) +dd if=/dev/zero of=$TDB_FILE bs=1024 count=1 seek=$((undo_blks - 2)) conv=notrunc > /dev/null 2>&1 + +$E2UNDO -f -n $TDB_FILE $TMPFILE >> $OUT 2>&1 +res=$? +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc2 = $crc1 ] && [ $crc2 != $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_incomplete/script b/tests/u_incomplete/script new file mode 100644 index 0000000..7bc7858 --- /dev/null +++ b/tests/u_incomplete/script @@ -0,0 +1,38 @@ +test_description="e2undo with incomplete undo file" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +UNDO_IO_SIMULATE_UNFINISHED=1 $TUNE2FS -O metadata_csum -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +$FSCK -y $TMPFILE >> $OUT 2>&1 +fsck_res=$? +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after fsck $crc3 >> $OUT +echo fsck result $fsck_res >> $OUT + +if [ $crc0 != $crc2 ] && [ $crc1 != $crc2 ] && [ $crc0 != $crc1 ] && [ $fsck_res -eq 1 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_mke2fs/script b/tests/u_mke2fs/script new file mode 100644 index 0000000..f1041a9 --- /dev/null +++ b/tests/u_mke2fs/script @@ -0,0 +1,34 @@ +test_description="e2undo with mke2fs" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/mke2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 test.img > $OUT +$MKE2FS -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc >> $OUT + +echo using mke2fs to test e2undo >> $OUT +$MKE2FS -q -F -o Linux -I 256 -O uninit_bg -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +new_crc=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $new_crc >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +new_crc=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $new_crc >> $OUT + +if [ $crc = $new_crc ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_mke2fs_opt/script b/tests/u_mke2fs_opt/script new file mode 100644 index 0000000..db62ab2 --- /dev/null +++ b/tests/u_mke2fs_opt/script @@ -0,0 +1,32 @@ +test_description="e2undo with mke2fs -z" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/mke2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -F -o Linux -I 128 -b 1024 test.img > $OUT +$MKE2FS -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +echo using mke2fs to test e2undo >> $OUT +$MKE2FS -q -F -o Linux -T ext4 -E lazy_itable_init=1 -b 1024 -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_mke2fs_opt_oddsize/script b/tests/u_mke2fs_opt_oddsize/script new file mode 100644 index 0000000..23e0b9e --- /dev/null +++ b/tests/u_mke2fs_opt_oddsize/script @@ -0,0 +1,31 @@ +test_description="e2undo with mke2fs -z and non-32k-aligned bdev size" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/mke2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +yes "abc123abc123abc" | dd bs=1k count=8 >> $TMPFILE 2> /dev/null + +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 > $OUT + +echo using mke2fs to test e2undo >> $OUT +$MKE2FS -q -F -o Linux -T ext4 -E lazy_itable_init=1 -b 1024 -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_mke2fs_opt_offset/script b/tests/u_mke2fs_opt_offset/script new file mode 100644 index 0000000..4b34b7a --- /dev/null +++ b/tests/u_mke2fs_opt_offset/script @@ -0,0 +1,104 @@ +test_description="e2undo and mke2fs with offset option" +OUT="$test_name.log" +TDB_FILE="$TMPFILE.e2undo" + +E2UNDO_FEATURE_COMPAT_OFFSET=1 + +trap "rm -f $TDB_FILE" EXIT INT QUIT + +test_e2undo_mke2fs_off() { + OFF=$1 + + rm -f "$TDB_FILE" + echo "testing e2undo and mke2fs with the -E offset=$OFF option" >> "$OUT" + # prepare $TMPFILE + yes a | $DD of="$TMPFILE" bs="$OFF" count=1 iflag=fullblock \ + > /dev/null 2>>"$OUT" + yes b | $DD bs=1k count=1024 iflag=fullblock >> "$TMPFILE" 2>>"$OUT" + yes c | $DD bs=1k count=3 iflag=fullblock >> "$TMPFILE" 2>>"$OUT" + + crc_exp=`$CRCSUM "$TMPFILE"` + $MKE2FS -F -z "$TDB_FILE" -b 1024 -E offset="$OFF" "$TMPFILE" 1024 \ + >> "$OUT" 2>&1 + + # supplement test with offset specific data + supplement_test_$OFF + + # dump undo header (just to ease debugging in case of a failure) + echo "undo header:" >> "$OUT" + $E2UNDO -h "$TDB_FILE" "$TMPFILE" >> "$OUT" 2>&1 + + # offset is stored in the undo header + $E2UNDO "$TDB_FILE" "$TMPFILE" >> "$OUT" 2>&1 + crc_act=`$CRCSUM "$TMPFILE"` + + # also test the key extension code path: the key for the fs block 960 + # (tdb block 30) is extended by the fs block 992 (tdb block 31) + # => we have exactly 3 key blocks instead of 4 + num_keys_exp=3 + num_keys_act=`$E2UNDO -h "$TDB_FILE" "$TMPFILE" | grep "^nr keys:" \ + | cut -f2` + + offset_exp=$OFF + offset_act=`$E2UNDO -h "$TDB_FILE" "$TMPFILE" | grep "^fs offset:" \ + | cut -f2` + compat_exp=$E2UNDO_FEATURE_COMPAT_OFFSET + compat_act=`$E2UNDO -h "$TDB_FILE" "$TMPFILE" | grep "^compat:" | cut -f3` + + if [ "$crc_exp" != "$crc_act" -o \ + "$num_keys_exp" != "$num_keys_act" -o \ + "$offset_exp" != "$offset_act" -o \ + $(($compat_act & $E2UNDO_FEATURE_COMPAT_OFFSET)) -ne $compat_exp ] + then + echo "mke2fs called with offset: $OFF" >> "$test_name.failed" + echo "crc_exp: $crc_exp" >> "$test_name.failed" + echo "crc_act: $crc_act" >> "$test_name.failed" + echo "num_keys_exp: $num_keys_exp" >> "$test_name.failed" + echo "num_keys_act: $num_keys_act" >> "$test_name.failed" + echo "offset_exp: $offset_exp" >> "$test_name.failed" + echo "offset_act: $offset_act" >> "$test_name.failed" + echo "compat_exp: $compat_exp" >> "$test_name.failed" + echo "compat_act: $compat_act" >> "$test_name.failed" + echo >> "$test_name.failed" + fi +} + +supplement_test_2048() { + # modify the two subsequent 1k blocks (1026 and 1027) after the fs end: + # e2undo will overwrite these modified blocks with the old + # data again (this might be considered as a bug (for now, + # this testcase just documents this behavior)) + SEEK_BLOCKS=$(((2048 + 1024 * 1024) / 1024)) + yes d | $DD of="$TMPFILE" bs=1k count=2 seek="$SEEK_BLOCKS" \ + iflag=fullblock > /dev/null 2>>"$OUT" +} + +supplement_test_96255() { + # nothing to supplement + : +} + +# test even offset < tdb_data_size +# with an offset of 2048 the old code wrote an incorrect undo file, +# for example, the computations for fs block 0 were wrong: +# * backing_blk_num was set to ULLONG_MAX - 1 instead of 0 +# * data was read from the beginning of the file instead of offset 2048 +# * data_ptr was set to read_ptr - 2048 +# for details, see the old undo_write_tdb code in undo_io.c +test_e2undo_mke2fs_off 2048 + +# test odd offset > tdb_data_size: 32768 * 3 - 2 * 1024 - 1 +# a somewhat arbitrary value, for example, during the backup of +# fs block 0 such an offset resulted in: +# * the largest "in fs block offset" (96255 % 1024 == 1023) +# * a wrong value for data_size (actual bytes read: 31745) +# * an invalid address for data_ptr +# for details, see the old undo_write_tdb code in undo_io.c +test_e2undo_mke2fs_off 96255 + +if [ -e "$test_name.failed" ]; then + echo "$test_name: $test_description: failed" +else + echo "$test_name: $test_description: ok" + touch "$test_name.ok" +fi diff --git a/tests/u_not_undo/script b/tests/u_not_undo/script new file mode 100644 index 0000000..2f07d1b --- /dev/null +++ b/tests/u_not_undo/script @@ -0,0 +1,28 @@ +test_description="e2undo a non-undo file" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +dd if=/dev/zero of=$TDB_FILE bs=1k count=512 > /dev/null 2>&1 + +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before e2undo $crc0 > $OUT + +od -tx1 -Ad -c < $TDB_FILE >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc3 >> $OUT + +if [ $crc3 = $crc0 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_offset/script b/tests/u_offset/script new file mode 100644 index 0000000..c3e03b7 --- /dev/null +++ b/tests/u_offset/script @@ -0,0 +1,138 @@ +test_description="e2undo with the offset option (-o offset)" +OUT="$test_name.log" +TMPFILE2="${TMPFILE}_2" +TDB_FILE="$TMPFILE.e2undo" + +E2UNDO_FEATURE_COMPAT_OFFSET=1 + +trap "rm -f $TMPFILE2 $TDB_FILE" EXIT INT QUIT + +read_header_entry() { + # $2 is just used as a dummy - it is never used by e2undo + # when dumping the header + $E2UNDO -h "$1" "$2" | grep "^$3:" +} + +read_header_offset() { + read_header_entry "$TDB_FILE" "$TMPFILE" "fs offset" | cut -f2 +} + +read_header_compat() { + read_header_entry "$TDB_FILE" "$TMPFILE" "compat" | cut -f3 +} + +e2undo_offset_assert() { + if [ "$crc_exp" != "$crc_act" -o \ + "$offset_exp" != "$offset_act" -o \ + $(($compat_act & $E2UNDO_FEATURE_COMPAT_OFFSET)) -ne $compat_exp ] + then + echo "$1" >> "$test_name.failed" + echo "crc_exp: $crc_exp" >> "$test_name.failed" + echo "crc_act: $crc_act" >> "$test_name.failed" + echo "offset_exp: $offset_exp" >> "$test_name.failed" + echo "offset_act: $offset_act" >> "$test_name.failed" + echo "compat_exp: $compat_exp" >> "$test_name.failed" + echo "compat_act: $compat_act" >> "$test_name.failed" + fi +} + +init_fs() { + echo "#" >> "$OUT" + echo "# init fs for $1" >> "$OUT" + echo "#" >> "$OUT" + rm -f "$TDB_FILE" + dd if=/dev/zero of="$TMPFILE" bs=1k count=1024 > /dev/null 2>&1 + $MKE2FS -F -z "$TDB_FILE" -b 1024 -E offset=524288 "$TMPFILE" 512 \ + >> "$OUT" 2>&1 +} + +# +# test absence of the "-o N" option +# +test_e2undo_offset_no_option() { + init_fs "test_e2undo_offset_no_option" + + $E2UNDO "$TDB_FILE" "$TMPFILE" >> "$OUT" 2>&1 + + crc_exp=`dd if=/dev/zero bs=1k count=1024 2>/dev/null | $CRCSUM` + crc_act=`$CRCSUM "$TMPFILE"` + offset_exp=524288 + offset_act=`read_header_offset` + compat_exp=$E2UNDO_FEATURE_COMPAT_OFFSET + compat_act=`read_header_compat` + e2undo_offset_assert "test_e2undo_offset_no_option" +} + +# +# test removal of the offset feature in the undo header +# +test_e2undo_offset_no_option_remove_offset_header() { + init_fs "test_e2undo_offset_no_option_remove_offset_header" + dd if="$TMPFILE" of="$TMPFILE2" bs=1k count=512 skip=512 \ + > /dev/null 2>&1 + # offset feature will be removed from the undo header + $TUNE2FS -z "$TDB_FILE" -C 42 "$TMPFILE2" >> "$OUT" 2>&1 + + $E2UNDO "$TDB_FILE" "$TMPFILE2" >> "$OUT" 2>&1 + + crc_exp=`dd if=/dev/zero bs=1k count=512 2>/dev/null | $CRCSUM` + crc_act=`$CRCSUM "$TMPFILE2"` + offset_exp= + offset_act=`read_header_offset` + compat_exp=0 + compat_act=`read_header_compat` + e2undo_offset_assert "test_e2undo_offset_no_option_remove_offset_header" +} + +# +# test "-o 4096" +# +test_e2undo_offset_4096() { + init_fs "test_e2undo_offset_4096" + dd if=/dev/zero of="$TMPFILE2" bs=1k count=4 > /dev/null 2>&1 + dd if="$TMPFILE" of="$TMPFILE2" bs=1k count=512 skip=512 seek=4 \ + > /dev/null 2>&1 + + $E2UNDO -o 4096 "$TDB_FILE" "$TMPFILE2" >> "$OUT" 2>&1 + + crc_exp=`dd if=/dev/zero bs=1k count=516 2>/dev/null | $CRCSUM` + crc_act=`$CRCSUM "$TMPFILE2"` + # the same as in test_e2undo_offset_no_option + offset_exp=524288 + offset_act=`read_header_offset` + compat_exp=$E2UNDO_FEATURE_COMPAT_OFFSET + compat_act=`read_header_compat` + e2undo_offset_assert "test_e2undo_offset_4096" +} + +# +# test "-o 0" +# +test_e2undo_offset_0() { + init_fs "test_e2undo_offset_0" + dd if="$TMPFILE" of="$TMPFILE2" bs=1k count=512 skip=512 \ + > /dev/null 2>&1 + + $E2UNDO -o 0 "$TDB_FILE" "$TMPFILE2" >> "$OUT" 2>&1 + + crc_exp=`dd if=/dev/zero bs=1k count=512 2>/dev/null | $CRCSUM` + crc_act=`$CRCSUM "$TMPFILE2"` + # the same as in test_e2undo_offset_no_option + offset_exp=524288 + offset_act=`read_header_offset` + compat_exp=$E2UNDO_FEATURE_COMPAT_OFFSET + compat_act=`read_header_compat` + e2undo_offset_assert "test_e2undo_offset_0" +} + +test_e2undo_offset_no_option +test_e2undo_offset_no_option_remove_offset_header +test_e2undo_offset_4096 +test_e2undo_offset_0 + +if [ -e "$test_name.failed" ]; then + echo "$test_name: $test_description: failed" +else + echo "$test_name: $test_description: ok" + touch "$test_name.ok" +fi diff --git a/tests/u_onefile_bad/script b/tests/u_onefile_bad/script new file mode 100644 index 0000000..60c9a2e --- /dev/null +++ b/tests/u_onefile_bad/script @@ -0,0 +1,115 @@ +test_description="check that we cant append a bad undo file" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 +fail=0 + +echo check that we cant append a bad undo file > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +CONF=$TMPFILE.conf +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 4096 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo mke2fs -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE 524288 >> $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.1 -b $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo corrupt $TDB_FILE.1 >> $OUT +dd if=/dev/zero of=$TDB_FILE.1 bs=4096 count=1 skip=1 2> /dev/null + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc3 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back e2fsck/tune2fs/resize2fs >> $OUT +$E2UNDO $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc1_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck/tune2fs/resize2fs $crc1_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc0_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +if [ $fail -eq 0 ] && [ $crc0 != $crc1 ] && [ $crc1 != $crc2 ] && [ $crc2 = $crc3 ] && [ $crc3 = $crc4 ] && [ $crc1_2 = $crc2 ] && [ $crc0_2 = $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TMPFILE $CONF +fi diff --git a/tests/u_resize2fs_opt/script b/tests/u_resize2fs_opt/script new file mode 100644 index 0000000..fe1e04d --- /dev/null +++ b/tests/u_resize2fs_opt/script @@ -0,0 +1,32 @@ +test_description="e2undo with resize2fs -z" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE 256 > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE 256 >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before resize2fs $crc0 >> $OUT + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE $TMPFILE 512 >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_revert_64bitmcsum_onefile/script b/tests/u_revert_64bitmcsum_onefile/script new file mode 100644 index 0000000..6249ff2 --- /dev/null +++ b/tests/u_revert_64bitmcsum_onefile/script @@ -0,0 +1,112 @@ +test_description="convert fs to 64bit,mcsum and revert undo file" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 +fail=0 + +echo convert fs to 64bit,metadata_csum and revert both changes as one undo file > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +CONF=$TMPFILE.conf +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 4096 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo mke2fs -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE 524288 >> $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.1 -b $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc3 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back e2fsck/tune2fs/resize2fs >> $OUT +$E2UNDO $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc1_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck/tune2fs/resize2fs $crc1_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc0_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ -n "${features}" ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have any features set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 && fail=1 + +if [ $fail -eq 0 ] && [ $crc0 = $crc0_2 ] && [ $crc1 = $crc1_2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TMPFILE $CONF +fi diff --git a/tests/u_revert_all_onefile/script b/tests/u_revert_all_onefile/script new file mode 100644 index 0000000..6911ec6 --- /dev/null +++ b/tests/u_revert_all_onefile/script @@ -0,0 +1,100 @@ +test_description="convert 64bit,mcsum and revert undo file" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 +fail=0 + +echo convert fs to 64bit,metadata_csum and revert both changes as one undo file > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +CONF=$TMPFILE.conf +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 4096 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo mke2fs -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE 524288 >> $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.0 -b $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc3 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back e2fsck/tune2fs/resize2fs/mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck/tune2fs/resize2fs/mke2fs $crc1_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ -n "${features}" ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have any features set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 && fail=1 + +if [ $fail -eq 0 ] && [ $crc0 = $crc0_2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TMPFILE $CONF +fi diff --git a/tests/u_revert_upgrade_to_64bitmcsum/script b/tests/u_revert_upgrade_to_64bitmcsum/script new file mode 100644 index 0000000..6599b05 --- /dev/null +++ b/tests/u_revert_upgrade_to_64bitmcsum/script @@ -0,0 +1,136 @@ +test_description="convert 64bit,mcsum and revert both" +if test -x $RESIZE2FS_EXE -a -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/resize2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 +fail=0 + +echo convert fs to 64bit,metadata_csum and revert both changes > $OUT + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before mke2fs $crc0 >> $OUT + +CONF=$TMPFILE.conf +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 4096 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo mke2fs -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE 524288 >> $OUT +MKE2FS_CONFIG=$CONF $MKE2FS -q -F -o Linux -T ext4h -O ^metadata_csum,^64bit -E lazy_itable_init=1 -b 4096 -z $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after mke2fs $crc1 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using resize2fs to test e2undo >> $OUT +$RESIZE2FS -z $TDB_FILE.1 -b $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after resize2fs $crc2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE.2 $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc3 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc4 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back e2fsck >> $OUT +$E2UNDO $TDB_FILE.3 $TMPFILE >> $OUT 2>&1 +crc3_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo e2fsck $crc3_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -lt 1 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit and metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back tune2fs >> $OUT +$E2UNDO $TDB_FILE.2 $TMPFILE >> $OUT 2>&1 +crc2_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo tune2fs $crc2_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -lt 1 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should have 64bit but not metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back resize2fs >> $OUT +$E2UNDO $TDB_FILE.1 $TMPFILE >> $OUT 2>&1 +crc1_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo resize2fs $crc1_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ "$(echo "${features}" | grep "metadata_csum" -c)" -gt 0 ] || [ "$(echo "${features}" | grep 64bit -c)" -gt 0 ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have 64bit or metadata_csum set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 || fail=1 + +echo roll back mke2fs >> $OUT +$E2UNDO $TDB_FILE.0 $TMPFILE >> $OUT 2>&1 +crc0_2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo mke2fs $crc0_2 >> $OUT +features="$($DUMPE2FS -h $TMPFILE 2> /dev/null | grep 'Filesystem features:')" +if [ -n "${features}" ]; then + echo "FS features: ${features}" >> $OUT + echo "Should not have any features set" >> $OUT + fail=1 +fi +$FSCK -f -n $TMPFILE >> $OUT 2>&1 && fail=1 + +if [ $fail -eq 0 ] && [ $crc0 = $crc0_2 ] && [ $crc1 = $crc1_2 ] && [ $crc2 = $crc2_2 ] && [ $crc3 = $crc3_2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE.0 $TDB_FILE.1 $TDB_FILE.2 $TDB_FILE.3 $TMPFILE $CONF +fi diff --git a/tests/u_tune2fs/script b/tests/u_tune2fs/script new file mode 100644 index 0000000..aa5f379 --- /dev/null +++ b/tests/u_tune2fs/script @@ -0,0 +1,34 @@ +test_description="e2undo with tune2fs" +if test -x $E2UNDO_EXE; then + +E2FSPROGS_UNDO_DIR=${TMPDIR:-/tmp} +export E2FSPROGS_UNDO_DIR +TDB_FILE=$E2FSPROGS_UNDO_DIR/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1 +crc=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -I 256 $TMPFILE >> $OUT 2>&1 +new_crc=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $new_crc >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +new_crc=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $new_crc >> $OUT + +if [ $crc = $new_crc ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_tune2fs_opt/script b/tests/u_tune2fs_opt/script new file mode 100644 index 0000000..c4810b9 --- /dev/null +++ b/tests/u_tune2fs_opt/script @@ -0,0 +1,32 @@ +test_description="e2undo with tune2fs -z" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi diff --git a/tests/u_undo_undo/script b/tests/u_undo_undo/script new file mode 100644 index 0000000..726a453 --- /dev/null +++ b/tests/u_undo_undo/script @@ -0,0 +1,54 @@ +test_description="undo e2undo" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/e2fsck-$(basename $TMPFILE).e2undo +TDB_FILE2=${TMPDIR:-/tmp}/e2undo-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE $TDB_FILE2 >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before e2fsck $crc0 >> $OUT + +echo using e2fsck to test e2undo >> $OUT +$FSCK -f -y -D -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2fsck $crc1 >> $OUT + +echo e2undo the e2fsck >> $OUT +$E2UNDO -z $TDB_FILE2 $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc2 >> $OUT + +echo e2undo the e2undo >> $OUT +$E2UNDO $TDB_FILE2 $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc3 >> $OUT + +echo e2undo the e2undo the e2undo >> $OUT +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc4=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc4 >> $OUT + +$E2UNDO -h $TDB_FILE $TMPFILE >> $OUT 2>&1 +$E2UNDO -h $TDB_FILE2 $TMPFILE >> $OUT 2>&1 + +$E2UNDO -z $TDB_FILE2 $TDB_FILE2 $TMPFILE >> $OUT 2>&1 + +crc5=`$CRCSUM $TMPFILE` +echo $CRCSUM after failed e2undo $crc5 >> $OUT + +echo $crc0 $crc1 $crc2 $crc3 $crc4 $crc5 >> $OUT + +if [ $crc0 = $crc2 ] && [ $crc2 = $crc4 ] && [ $crc5 = $crc4 ] && [ $crc1 = $crc3 ] && [ $crc1 != $crc2 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TDB_FILE2 $TMPFILE +fi diff --git a/tests/u_wrong_fs/script b/tests/u_wrong_fs/script new file mode 100644 index 0000000..dbf0d6b --- /dev/null +++ b/tests/u_wrong_fs/script @@ -0,0 +1,36 @@ +test_description="e2undo on the wrong fs" +if test -x $E2UNDO_EXE; then + +TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo +OUT=$test_name.log +rm -f $TDB_FILE >/dev/null 2>&1 + +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 + +echo mke2fs -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE > $OUT +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc0=`$CRCSUM $TMPFILE` +echo $CRCSUM before tune2fs $crc0 >> $OUT + +echo using tune2fs to test e2undo >> $OUT +$TUNE2FS -O metadata_csum -z $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc1=`$CRCSUM $TMPFILE` +echo $CRCSUM after tune2fs $crc1 >> $OUT + +$MKE2FS -q -F -o Linux -T ext4 -O ^metadata_csum,64bit -E lazy_itable_init=1 -b 1024 $TMPFILE >> $OUT 2>&1 +crc2=`$CRCSUM $TMPFILE` +echo $CRCSUM after re-mke2fs $crc2 >> $OUT + +$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 +crc3=`$CRCSUM $TMPFILE` +echo $CRCSUM after e2undo $crc3 >> $OUT + +if [ $crc3 = $crc2 ] && [ $crc2 != $crc1 ]; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + ln -f $test_name.log $test_name.failed + echo "$test_name: $test_description: failed" +fi +rm -f $TDB_FILE $TMPFILE +fi |