提交 a27f6ef4 编写于 作者: E Eryu Guan 提交者: Dave Chinner

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 0d485ada ("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: NEryu Guan <eguan@redhat.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 ea78d808
......@@ -217,7 +217,7 @@ xfs_trans_reserve(
undo_blocks:
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册