浏览代码

xfs: undo block reservation correctly in xfs_trans_reserve()

"blocks" should be added back to fdblocks at undo time, not taken
away, i.e. the minus sign should not be used.

This is a regression introduced by commit 0d485ada404b ("xfs: use
generic percpu counters for free block counter"). And it's found by
code inspection, I didn't it in real world, so there's no
reproducer.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan 9 年之前
父节点
当前提交
a27f6ef4e6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/xfs/xfs_trans.c

+ 1 - 1
fs/xfs/xfs_trans.c

@@ -217,7 +217,7 @@ undo_log:
 
 
 undo_blocks:
 undo_blocks:
 	if (blocks > 0) {
 	if (blocks > 0) {
-		xfs_mod_fdblocks(tp->t_mountp, -((int64_t)blocks), rsvd);
+		xfs_mod_fdblocks(tp->t_mountp, (int64_t)blocks, rsvd);
 		tp->t_blk_res = 0;
 		tp->t_blk_res = 0;
 	}
 	}