Xue jiufei d0c97d52f5 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 <xuejiufei@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-04 16:54:41 -07:00
..
2015-06-30 19:44:57 -07:00
2015-06-23 18:02:01 -04:00
2015-06-23 18:01:59 -04:00
2015-09-03 12:57:48 -07:00
2015-08-07 13:58:05 +02:00
2015-06-25 17:00:42 -07:00
2015-08-16 12:35:44 -07:00
2015-08-13 12:32:04 -06:00
2015-04-21 16:16:02 -04:00
2015-08-13 12:32:04 -06:00
2015-08-13 12:32:04 -06:00
2015-09-04 16:54:41 -07:00
2015-08-11 10:01:24 +02:00
2015-04-11 22:29:40 -04:00
2014-11-19 13:01:20 -05:00
2015-07-09 11:42:21 -07:00
2015-08-13 12:32:04 -06:00
2015-07-23 20:59:40 +02:00
2015-08-12 15:28:45 -05:00
2015-07-23 20:59:40 +02:00
2015-08-13 12:32:04 -06:00
2015-08-04 23:23:50 -04:00
2014-08-26 09:35:56 +02:00