On Wed, Aug 26, 2015 at 03:11:46PM -0700, Andrew Morton wrote: > From: Xue jiufei <xuejiu...@huawei.com> > Subject: ocfs2: do not set fs read-only if rec[0] is empty while committing > truncate > > While appending an extent to a file, it will call these functions: > ocfs2_insert_extent > > -> call ocfs2_grow_tree() if there's no free rec > -> ocfs2_add_branch add a new branch to extent tree, > now rec[0] in the leaf of rightmost path is empty > -> ocfs2_do_insert_extent > -> ocfs2_rotate_tree_right > -> ocfs2_extend_rotate_transaction > -> jbd2_journal_restart if jbd2_journal_extend fail > -> ocfs2_insert_path > -> ocfs2_extend_trans > -> jbd2_journal_restart if jbd2_journal_extend fail > -> ocfs2_insert_at_leaf > -> ocfs2_et_update_clusters > Function jbd2_journal_restart() may be called and it may happened that > buffers dirtied in ocfs2_add_branch() are committed > while buffers dirtied in ocfs2_insert_at_leaf() and > ocfs2_et_update_clusters() are not. > So an empty rec[0] is left in rightmost path which will cause > read-only filesystem when call ocfs2_commit_truncate() > with the error message: "Inode %lu has an empty extent record". > > This is not a serious problem, so remove the rightmost path when call > ocfs2_commit_truncate(). > > Signed-off-by: joyce.xue <xuejiu...@huawei.com> > Cc: Mark Fasheh <mfas...@suse.com> > Cc: Joel Becker <jl...@evilplan.org> > Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Reviewed-by: Mark Fasheh <mfas...@suse.de> -- Mark Fasheh _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel