summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_defer.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-09-14 15:26:42 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-10-10 10:57:54 -0700
commit719f91e92a644814f60230f9435f58a4d41e13de (patch)
tree7797bb4aff0f6312ec748455535e01e6352cb49f /fs/xfs/libxfs/xfs_defer.c
parentfd4b722753f94109887c79a6f433c1c9856f2c88 (diff)
xfs: xfs_defer_capture should absorb remaining transaction reservationfix-recovery-intent-chaining_2020-10-10
When xfs_defer_capture extracts the deferred ops and transaction state from a transaction, it should record the transaction reservation type from the old transaction so that when we continue the dfops chain, we still use the same reservation parameters. This avoids a potential failure vector by ensuring that we never ask for more log reservation space than we would have asked for had the system not gone down. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_defer.c')
-rw-r--r--fs/xfs/libxfs/xfs_defer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index 85d70f1edc1c..c53443252389 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -577,6 +577,11 @@ xfs_defer_capture(
dfc->dfc_blkres = tp->t_blk_res - tp->t_blk_res_used;
tp->t_blk_res = tp->t_blk_res_used;
+ /* Preserve the transaction reservation type. */
+ dfc->dfc_tres.tr_logres = tp->t_log_res;
+ dfc->dfc_tres.tr_logcount = tp->t_log_count;
+ dfc->dfc_tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
+
return dfc;
}