[Ocfs2-tools-devel] [PATCH] libocfs2: Prevent journals from being truncated below their minimum size.

Sunil Mushran Sunil.Mushran at oracle.com
Tue Jul 8 17:09:29 PDT 2008


Joel Becker wrote:
> The function ocfs2_make_journal() is the major API for sizing a journal.
> It is used both to grow and shrink journals.
>
> When shrinking a journal, it currently truncates the file before calling
> ocfs2_format_journal().  Only then is the new size checked against the
> miniumum.  If it is too small, ocfs2_make_journal() aborts.  This leaves
> the journal with too small an allocation.
>
> The fix is to have ocfs2_make_journal() do a quick size check up front.
> This prevents a journal from being left in an invalid state.
>
> Signed-off-by: Joel Becker <joel.becker at oracle.com>
>   
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>



More information about the Ocfs2-tools-devel mailing list