Commit ce576f1c authored by Namjae Jeon's avatar Namjae Jeon Committed by Dave Chinner

xfs: remove XFS_TRANS_RESERVE in collapse range

There is no need to dip into reserve pool. Reserve pool is used for much
more important things. And xfs_trans_reserve will never return ENOSPC
because punch hole is already done. If we get ENOSPC, collapse range
will be simply failed.

Cc: Brian Foster <bfoster@redhat.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarAshish Sangwan <a.sangwan@samsung.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent d6d211db
...@@ -1519,7 +1519,6 @@ xfs_collapse_file_space( ...@@ -1519,7 +1519,6 @@ xfs_collapse_file_space(
while (!error && !done) { while (!error && !done) {
tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
tp->t_flags |= XFS_TRANS_RESERVE;
/* /*
* We would need to reserve permanent block for transaction. * We would need to reserve permanent block for transaction.
* This will come into picture when after shifting extent into * This will come into picture when after shifting extent into
...@@ -1529,7 +1528,6 @@ xfs_collapse_file_space( ...@@ -1529,7 +1528,6 @@ xfs_collapse_file_space(
error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write,
XFS_DIOSTRAT_SPACE_RES(mp, 0), 0); XFS_DIOSTRAT_SPACE_RES(mp, 0), 0);
if (error) { if (error) {
ASSERT(error == ENOSPC || XFS_FORCED_SHUTDOWN(mp));
xfs_trans_cancel(tp, 0); xfs_trans_cancel(tp, 0);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment