[Ocfs2-tools-devel] [PATCH] fsck.ocfs2: Set i_error properly fix_journals_func.
Tao Ma
tao.ma at oracle.com
Mon Oct 27 19:28:49 PDT 2008
Joel Becker wrote:
> On Mon, Oct 27, 2008 at 03:52:40PM +0800, Tao Ma wrote:
>> In fix_journals_func, when we reformat the journal,
>> the i_error should be reset to the return value.
>
> This is not quite right.
>
>> diff --git a/fsck.ocfs2/journal.c b/fsck.ocfs2/journal.c
>> index d571d3c..e53fa1a 100644
>> --- a/fsck.ocfs2/journal.c
>> +++ b/fsck.ocfs2/journal.c
>> @@ -825,10 +825,10 @@ static errcode_t fix_journals_func(o2fsck_state *ost,
>> err = ocfs2_make_journal(fs, ci->ci_blkno,
>> jc->jc_max_clusters,
>> &jc->jc_max_features);
>> - }
>>
>> - ji->i_error = err;
>> - goto out;
>> + ji->i_error = err;
>> + goto out;
>> + }
>> }
>
> The 'goto out' must happen regardless of the answer to prompt().
> Thus, it should read:
>
> if (prompt(...)) {
> err = ocfs2_make_journal(...);
> ji->i_error = err;
> }
> goto out;
> }
aha, I don't know clearly we should go out regardless of the answer.
thanks. I will regenerate the patch and commit.
Regards,
Tao
More information about the Ocfs2-tools-devel
mailing list