[Ocfs2-tools-devel] [PATCH 11/11] Ocfs2-tools: Fix bug for EXTENT_EB_INVALID corruptor.

Joel Becker Joel.Becker at oracle.com
Tue Jun 9 00:28:13 PDT 2009


On Tue, Jun 09, 2009 at 02:39:52PM +0800, Tristan Ye wrote:
> The fswreck EXTENT_EB_INVALID corrupter actually does EB_GEN.
> But the wrong fsck choice can make this not exercise the EXTENT_EB_INVALID.
> The corrupter for EXTENT_EB_INVALID should instead have an extent
> record pointing to an invalid block, perhaps block no of inode itself.

	I changed my mind.  Pointing at itself is corrupting the inode,
not the extent block.  While this tests finding a block that's not a
valid extent block, I think it's a little confusing.
	EB_INVALID really triggers on the magic.  Why not garbage up the
magic?

> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
> ---
>  fswreck/extent.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/fswreck/extent.c b/fswreck/extent.c
> index c0550b8..49e2ab2 100644
> --- a/fswreck/extent.c
> +++ b/fswreck/extent.c
> @@ -164,7 +164,6 @@ static void damage_extent_block(ocfs2_filesys *fs, uint64_t blkno,
>  			break;
>  		case EB_GEN:
>  		case EB_GEN_FIX:
> -		case EXTENT_EB_INVALID:
>  			oldno = eb->h_fs_generation;
>  			eb->h_fs_generation = 0x1234;
>  			if (type == EB_GEN)
> @@ -177,6 +176,15 @@ static void damage_extent_block(ocfs2_filesys *fs, uint64_t blkno,
>  				"generation number from 0x%x to 0x%x\n",
>  				blkno, oldno, eb->h_fs_generation);
>  			break;
> +		case EXTENT_EB_INVALID:
			memset(eb->h_signature, 'a', sizeof(eb->h_signature));
			fprintf(stdout, "Corrupt the signature of extent block "
				"%"PRIu64"\n",
				eb->h_blkno);
			break;

	Sorry for all the different ideas.  Thanks for coding it up!

Joel

-- 

"In the long run...we'll all be dead."
                                        -Unknown

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list