[Ocfs2-tools-devel] [PATCH 1/1] fsck.ocfs2: Reinitialize bitmap when we reset fs_blocks.
Joel Becker
Joel.Becker at oracle.com
Mon Jul 28 11:02:35 PDT 2008
On Mon, Jul 28, 2008 at 09:21:03AM +0800, Tao Ma wrote:
> In fsck.ocfs2, when we find fs_blocks in super block isn't the
> same as the number stored in global_bitmap, we choose to trust
> global_bitmap. In this case, we have to reinitialize the bitmap
> also since they are all fs_blocks based. This bug blocks the test
> case of fsck-test.sh in ocfs2-test.
> --- a/fsck.ocfs2/include/fsck.h
> +++ b/fsck.ocfs2/include/fsck.h
> @@ -73,6 +73,10 @@ typedef struct _o2fsck_state {
> ost_fix_fs_gen:1;
> } o2fsck_state;
>
> +void o2fsck_state_bitmap_free(o2fsck_state *ost);
> +errcode_t o2fsck_state_bitmap_new(ocfs2_filesys *fs, o2fsck_state *ost);
> +void mark_magical_clusters(o2fsck_state *ost);
Rather than exporting three functions, why not make a single
function "o2fsck_state_reinit()" that does the free()s and then calls
o2fsck_init()?
Then, when you go to update fs_blocks, you just call
o2fsck_state_reinit() and check it's error.
Joel
--
Viro's Razor:
Any race condition, no matter how unlikely, will occur just
often enough to bite you.
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