xfs
[Top] [All Lists]

RE: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usagetra

To: "Christoph Hellwig" <hch@xxxxxxxxxxxxx>
Subject: RE: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usagetracking
From: "Alex Elder" <aelder@xxxxxxx>
Date: Wed, 21 Oct 2009 15:22:37 -0500
Cc: "Barry Naujok" <bnaujok@xxxxxxx>, <xfs@xxxxxxxxxxx>
In-reply-to: <20090902175841.711310240@xxxxxxxxxxxxxxxxxxxxxx>
Thread-index: Acor+TIpuRNgSQQpRPiY6phVJ/G2Cgmku3Hg
Thread-topic: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usagetracking
Christoph Hellwig wrote:
> Currently the code to allocate, free and reset the block usage bitmaps
> is a complete mess.  This patch reorganizes it into logical helpers.
> 
> Details:
> 
>  - the current incore_init code is called just before phase2 is called,
>    which then marks the log and the AG headers used.
>  - we get rid of incore_init init, and replace it with direct calls to the
>    unchanched incore_ino_init/incore_ext_init functions and our new init_bmaps
>    which does all the allocations for the block usage tracking, aswell
>    as a call to reset_bmaps to initialize it to the default values.
>  - reset_bmaps is also called from early phase4 code to reset all state
>    instead of opencoding it.
>  - there is a new free_bmaps helper which we call to free our block usage
>    bitmaps when we don't need them anymore after phase5.  The current
>    code frees some of it a bit early in phase5, but needs to take of it
>    in phase6 in case we didn't call phase5 due to nomodify mode, and leaks
>    it if we don't call phase 6, which might happen in case of a bad inode
>    allocation btree.


Looks good.             -Alex


> Signed-off-by: Barry Naujok <bnaujok@xxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Alex Elder <aelder@xxxxxxx>


> Index: xfsprogs-dev/repair/phase4.c
> ===================================================================
> --- xfsprogs-dev.orig/repair/phase4.c 2009-08-21 01:59:26.000000000 +0000
> +++ xfsprogs-dev/repair/phase4.c      2009-08-21 02:41:44.000000000 +0000
> @@ -355,19 +355,7 @@ phase4(xfs_mount_t *mp)

. . .

<Prev in Thread] Current Thread [Next in Thread>
  • RE: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usagetracking, Alex Elder <=