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

Mark Fasheh mfasheh at suse.com
Tue Jul 8 21:11:18 PDT 2008


On Tue, Jul 08, 2008 at 04:57:00PM -0700, 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: Mark Fasheh <mfasheh at suse.com>

--
Mark Fasheh



More information about the Ocfs2-tools-devel mailing list