@@ -595,6 +595,9 @@ xfs_defer_capture(
dfc->dfc_tpflags = tp->t_flags & XFS_TRANS_LOWMODE;
dfc->dfc_blkres = tp->t_blk_res - tp->t_blk_res_used;
tp->t_blk_res = tp->t_blk_res_used;
+ 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;
xfs_defer_reset(tp);
/*
@@ -77,6 +77,7 @@ struct xfs_defer_capture {
struct list_head dfc_dfops;
unsigned int dfc_tpflags;
unsigned int dfc_blkres;
+ struct xfs_trans_res dfc_tres;
};
/*
@@ -2504,8 +2504,8 @@ xlog_finish_defer_ops(
int error = 0;
list_for_each_entry_safe(dfc, next, capture_list, dfc_list) {
- error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0,
- 0, XFS_TRANS_RESERVE, &tp);
+ error = xfs_trans_alloc(mp, &dfc->dfc_tres, 0, 0,
+ XFS_TRANS_RESERVE, &tp);
if (error)
return error;