From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Add regression tests to e2fsck to examine how it deals with inode table blocks which (a) have been zero'd; (b) have been one'd; (c) have corrupt inodes with obvious problems; and (d) have inodes with non-obvious problems. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- tests/f_bad_inode_csum/expect.1 | 126 +++++++++++++++++++++++++++++++++++++++ tests/f_bad_inode_csum/expect.2 | 7 ++ tests/f_bad_inode_csum/image.gz | Bin tests/f_bad_inode_csum/name | 1 4 files changed, 134 insertions(+) create mode 100644 tests/f_bad_inode_csum/expect.1 create mode 100644 tests/f_bad_inode_csum/expect.2 create mode 100644 tests/f_bad_inode_csum/image.gz create mode 100644 tests/f_bad_inode_csum/name 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 new file mode 100644 index 0000000000000000000000000000000000000000..221920b04ad0b18949bd75680159390e7b05586a GIT binary patch literal 4613 zcmeHI`%_bQ7N=!ex?>B|c3ijRk-Ah_RuLpsKpuDP?n*6>v{0m!M-~)WMMxoHlmNFK zJEBsImPdFLsDnl!0;YgKfZQt8j0DU`44^<#K@t-}0_27Fa_@J)4F1~b{sCm>COPMP z?m3_HIp=#Xt>g`d(S@<tR~_dkx#eT&bxsSWH@|q}*x4FQW##*w-{!n`=IM0S7oY9D zy<zJcn;WCg=59Pwa{hdFQ^E;xTFu_d&r@PDGxyt{iSvGriWqD6uCC3hZy#*h#Zk6q zM$650YI@#TEiY{YS7TiYG52L?f{QeveD#XNO!&vWW{I1dDbqAR2{?vi;Zw3&S7F$H z3gx4VhSBPrU2#)W^oFeF>8I=gvo33-*5zmjee*Hq22l2IQh2mY$Cso%H!CWWMf!)1 zrlN)Eh%OY_=acZnsx{&zvIn6{4_z7-syS^Q)aln~Pgc@ml__s!8&6G{?8{&YUtlVn zQ&dRb*Ui46CqzDq-L&~e2ZusNAJH5BrPFRB2#6==_z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uNUatvF^ z)RC(#S})?1DOHBqhFV@OQbIKq;L?mz^9S+)Bpsh8rF>jBA=bu;m*aa72{Ht~Qc3}& zM(2=<77-|Q^7UALu2rnHy1}2kHa3QxSoz69X%FGFrH>6*x_pH2h4rvJ5#Tu|ge_4M zie?sA-6%GlY<rPlP}|x^hz34Eatg_rX{v<LqrK3fZv!{sx&Pd_$iwksRE$}u5;hMd z6AkJD>9msBM{g0M;}Lr7L;JE;Cjy=sa7&H|z>m0z8FCZVk^FR=78qzV8B<P@8s95x zhfhW)<!<f-SO|r)KonpU$N64--##twD_GM%{uxC@6_SdnvIrCAZ#SV@DdiZ=Tz*D? z&1)6a6$C*88wo~Daz2Qwref#j0L@+bVh{r{YY#bWj{@}JCbhx*FC94skBaz18`js$ zUas+dIpwj#I3w7{Mq4pHc&~)oxt18+D*%^~?@1aWu~3^1<7j^v0Qa@Q@k8n#))pT7 zn*zwJFTmvtz6wnipqSS|Al!Z8Sk;RP)kbwO6bwvH&LCDbQj5muNZ<PwaIX+rN9VhV z@!tIS0@@vluUEeX-$CWs$6x#XSJ8T8U4eB4))iP+U|oTA1^yoeevyr^UU2|EqYe%q GIQ$Pa(@%{6 literal 0 HcmV?d00001 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) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html