From 76d1914303275912d70dd4f01fff1cc552a244f8 Mon Sep 17 00:00:00 2001 From: Tahsin Erdogan Date: Tue, 4 Jul 2017 23:53:59 -0400 Subject: [PATCH] e2fsck: add test for ea_inode feature f_ea_inode test covers the following scenarios: - a file that contains old Lustre-style valid ea_inode references in inode body and xattr block - a file that contains new style valid ea_inode references in inode body and xattr block - a file with an extended attribute that references an invalid inode number (e_value_inum > s_inodes_count) - an ea entry with bad e_hash and points to an inode that does not have EA_INODE flag set - an ea entry with bad e_hash but points to a valid ea_inode - an ea entry with valid e_hash that points to an inode that is missing EA_INODE flag Signed-off-by: Tahsin Erdogan Signed-off-by: Theodore Ts'o --- tests/f_ea_inode/expect.1 | 31 +++++++++++++++++++++++++++++++ tests/f_ea_inode/expect.2 | 7 +++++++ tests/f_ea_inode/image.gz | Bin 0 -> 1389 bytes 3 files changed, 38 insertions(+) create mode 100644 tests/f_ea_inode/expect.1 create mode 100644 tests/f_ea_inode/expect.2 create mode 100644 tests/f_ea_inode/image.gz diff --git a/tests/f_ea_inode/expect.1 b/tests/f_ea_inode/expect.1 new file mode 100644 index 000000000..aaa0bead9 --- /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 000000000..f9276fba3 --- /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 new file mode 100644 index 0000000000000000000000000000000000000000..68a397580d2ecca9fa30e33528a286419c757c7e GIT binary patch literal 1389 zc-qC2{a4a=6vw~I)`M2G<2*f}kh8Efou#81LrN=BThJmON-@i3hNxv?o59zeRx?|& zGIh+InT!s(741Dlgh%yUt^e^YJQMKgx#I*Svtu z2=s|z0Cp&-XXZUIC{vk!M%dU`XJJnb8^$lzM zqqE+Js-=0Om2S9p+?!U$R*F1ch1V+D3O2fy2bvOI#d-~Q;3IQ^GbQ;5DU6yYTm zm$-yw<*;tGc!j6BXYr`_2t2MdX9^OgPGz`2iSfT+3XDrf- z5y>JfGQ5Y@$I?*F!-lXbTjNTtbXVz2lL*sm)3t)PRW!8 zvVn5GHbqlsKqy2in(LeTRW8oP`L)G=mp7H;wuU&s-!NJFtYSyz3jU4RmG}u#*k(L7 ze3;PJnPGXMc?pDA(;Tkxzaz+_Y;c)H&LCos*sC?A+UtDv)END3XykVnD-)s2a}+1!25s*~dxpB> zV0Z+?6F0Fc{2N?~XiiQzcMPN4IFi-U+}hPNCaZrr!@s1b6WDy$Y;>SxW3Hf&qW-m! zh>jkt@EtE%-E(WDU_bY_uH|b(>oyhDECe#h-fXHc16U|BfR7+3jo2=!5-xy45m=~C z&;TC#SCcF|E_1UL62UcvGE-q}`9ryg@O)f^iT2-@;wW>K*+1F1W!3Z8EL|Hc+daR7 zO2{bAVM?qMX^$nZl}i?2mcC%6>ere2L1PKwzwYd!kw&YJ~F4X2bGx_a-!k5b@$wS7w**qHbL6w&J0tN~CbO>4u{R0%K Bf!qK9 literal 0 Hc-jL100001 -- 2.47.2