[Ocfs2-tools-devel] [PATCH 1/2 v4] fsck: supporting fixing inode alloc group desc

Eric Ren zren at suse.com
Fri Feb 23 01:55:22 PST 2018


Hi,

>>> +    /*
>>> +     * Currently we could only fix the situation that there is one gd
>>> +     * in each chain, because we can hardly rebuild the gd far from
>>> +     * chain header. The key problem is that we can not trust gd
>>> +     * anymore as they have been corrupted. So we must relay on
>>> +     * the ocfs2_chain_list struct to restore all gds.
>>> +     */
>> As talked in v3 as below:
>>
>> ===
>>
>>> I still think it's not proper to silently assume that there is only one gd in each chain.
>>> So, could we give warning for user's attention by check how many
>>> gds the allocator has?  If number of gds > the number of chain recs, give some warnings?
>>> Eric
>> Agree, we could give user a choice whether fixing this problem if
>> gds > the number of chain recs.
>>
>> ===
>>
>> I cannot see where you enforce this?
> I add some comment in log to notice user so that they can choose
> whether fixing this problem.
>
> "Note that we could only fix the"
> "situation that there is one gd in each chain",

I saw it, but I mean we should check and warn users if

"if gds > the number of chain recs.".

Eric

>
> thanks,
> Jun
>> Eric
>>
>>> +    for (i = 0; i < cl->cl_next_free_rec; i++) {
>>> +        rec = &cl->cl_recs[i];
>>> +        blkno = rec->c_blkno;
>>> +        bits = rec->c_total;
>>> +
>>> +        ret = ocfs2_read_group_desc(ost->ost_fs, blkno,
>>> +                (char *)&bgs[corrupted_bgs]);
>>> +        if ((ret == OCFS2_ET_BAD_GROUP_DESC_MAGIC) ||
>>> +            (!ret && bgs[corrupted_bgs].bg_generation != ost->ost_fs_generation)) {
>>> +            if (!prompt(ost, PY, PR_GROUP_EXPECTED_DESC,
>>> +                "Block %"PRIu64" should be a group "
>>> +                "descriptor for the bitmap chain allocator "
>>> +                "but it was corrupted.  Reinitialize it as "
>>> +                "a group desc and link it into the bitmap "
>>> +                "allocator? Note that we could only fix the "
>>> +                "situation that there is one gd in each chain",
>>> +                blkno))
>>> +                continue;
>>> +




More information about the Ocfs2-tools-devel mailing list