[Ocfs2-tools-devel] [PATCH] fsck.ocfs2: Set i_error properly fix_journals_func.

Joel Becker Joel.Becker at oracle.com
Mon Oct 27 18:39:34 PDT 2008


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;
	}


Joel

-- 

"Too much walking shoes worn thin.
 Too much trippin' and my soul's worn thin.
 Time to catch a ride it leaves today
 Her name is what it means.
 Too much walking shoes worn thin."

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