All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add regression test for clearing an xattr block
@ 2008-04-11 15:57 Eric Sandeen
  2008-04-14  3:27 ` Andreas Dilger
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2008-04-11 15:57 UTC (permalink / raw
  To: ext4 development

[-- Attachment #1: Type: text/plain, Size: 2197 bytes --]

I got burned by the bug at:
http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=86bc90f4f11df090f86dc764a4ea2d6dd5c13ffe

so figured maybe a testcase was in order... 
20/20 hindsight I guess!

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 tests/f_clear_xattr_block/expect.1 |   22 ++++++++++++++++++++++
 tests/f_clear_xattr_block/expect.2 |    7 +++++++
 tests/f_clear_xattr_block/name     |    1 +
 3 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 tests/f_clear_xattr_block/expect.1
 create mode 100644 tests/f_clear_xattr_block/expect.2
 create mode 100644 tests/f_clear_xattr_block/name

diff --git a/tests/f_clear_xattr_block/expect.1 b/tests/f_clear_xattr_block/expect.1
new file mode 100644
index 0000000..f9db73d
--- /dev/null
+++ b/tests/f_clear_xattr_block/expect.1
@@ -0,0 +1,22 @@
+Pass 1: Checking inodes, blocks, and sizes
+Inode 12 has a bad extended attribute block 1112.  Clear? yes
+
+Inode 12, i_blocks is 2, should be 0.  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:  -1112
+Fix? yes
+
+Free blocks count wrong for group #0 (7079, counted=7080).
+Fix? yes
+
+Free blocks count wrong (7079, counted=7080).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 12/256 files (8.3% non-contiguous), 1112/8192 blocks
+Exit status is 1
diff --git a/tests/f_clear_xattr_block/expect.2 b/tests/f_clear_xattr_block/expect.2
new file mode 100644
index 0000000..3312a76
--- /dev/null
+++ b/tests/f_clear_xattr_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: 12/256 files (8.3% non-contiguous), 1112/8192 blocks
+Exit status is 0
diff --git a/tests/f_clear_xattr_block/name b/tests/f_clear_xattr_block/name
new file mode 100644
index 0000000..9848acc
--- /dev/null
+++ b/tests/f_clear_xattr_block/name
@@ -0,0 +1 @@
+clearing xattr block with bad header magic
-- 1.5.4.1


[-- Attachment #2: image.gz --]
[-- Type: application/x-gzip, Size: 23712 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add regression test for clearing an xattr block
  2008-04-11 15:57 [PATCH] Add regression test for clearing an xattr block Eric Sandeen
@ 2008-04-14  3:27 ` Andreas Dilger
  2008-04-14 13:46   ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2008-04-14  3:27 UTC (permalink / raw
  To: Eric Sandeen; +Cc: ext4 development

On Apr 11, 2008  10:57 -0500, Eric Sandeen wrote:
> I got burned by the bug at:
> http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=86bc90f4f11df090f86dc764a4ea2d6dd5c13ffe
> 
> so figured maybe a testcase was in order... 
> 20/20 hindsight I guess!

Is the "ea_checks" patch and respective test in the upstream e2fsprogs?
We had added additional checks to e2fsck for xattr blocks/large inodes.

The test output looks like below - there are a number of different types
of EA corruption, though the error message is always the same.  The patch
was in the series I previously sent "e2fsprogs-ea_check.patch", and the
patch + test image are in the tarball at
http://downloads.lustre.org/people/adilger/e2fsprogs-1.40.5-patches.tar.gz
though I could re-send one or both to the list if desired.

=================================
+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


Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add regression test for clearing an xattr block
  2008-04-14  3:27 ` Andreas Dilger
@ 2008-04-14 13:46   ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2008-04-14 13:46 UTC (permalink / raw
  To: Andreas Dilger; +Cc: ext4 development

Andreas Dilger wrote:
> On Apr 11, 2008  10:57 -0500, Eric Sandeen wrote:
>> I got burned by the bug at:
>> http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=86bc90f4f11df090f86dc764a4ea2d6dd5c13ffe
>>
>> so figured maybe a testcase was in order... 
>> 20/20 hindsight I guess!
> 
> Is the "ea_checks" patch and respective test in the upstream e2fsprogs?
> We had added additional checks to e2fsck for xattr blocks/large inodes.

Ah, it is in git, I had missed that.  Looks like it does cover the case
I sent and much more, so... never mind.

Thanks,
-Eric


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-14 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-11 15:57 [PATCH] Add regression test for clearing an xattr block Eric Sandeen
2008-04-14  3:27 ` Andreas Dilger
2008-04-14 13:46   ` Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.