浏览代码

UBIFS: re-calculate min_idx_size after the commit

When we commit, but before we try to write anything to the flash
media, @c->min_idx_size is inaccurate, because we do not re-calculate
it after the commit. Do not forget to do this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Artem Bityutskiy 16 年之前
父节点
当前提交
650ed50f42
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/ubifs/tnc_commit.c

+ 2 - 0
fs/ubifs/tnc_commit.c

@@ -802,8 +802,10 @@ int ubifs_tnc_start_commit(struct ubifs_info *c, struct ubifs_zbranch *zroot)
 	 * budgeting subsystem to assume the index is already committed,
 	 * budgeting subsystem to assume the index is already committed,
 	 * even though it is not.
 	 * even though it is not.
 	 */
 	 */
+	ubifs_assert(c->min_idx_lebs == ubifs_calc_min_idx_lebs(c));
 	c->old_idx_sz = c->calc_idx_sz;
 	c->old_idx_sz = c->calc_idx_sz;
 	c->budg_uncommitted_idx = 0;
 	c->budg_uncommitted_idx = 0;
+	c->min_idx_lebs = ubifs_calc_min_idx_lebs(c);
 	spin_unlock(&c->space_lock);
 	spin_unlock(&c->space_lock);
 	mutex_unlock(&c->tnc_mutex);
 	mutex_unlock(&c->tnc_mutex);