aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 67ae5555a30a..7294abce6ef2 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -860,8 +860,15 @@ xfs_iomap_write_unwritten(
860 * set up a transaction to convert the range of extents 860 * set up a transaction to convert the range of extents
861 * from unwritten to real. Do allocations in a loop until 861 * from unwritten to real. Do allocations in a loop until
862 * we have covered the range passed in. 862 * we have covered the range passed in.
863 *
864 * Note that we open code the transaction allocation here
865 * to pass KM_NOFS--we can't risk to recursing back into
866 * the filesystem here as we might be asked to write out
867 * the same inode that we complete here and might deadlock
868 * on the iolock.
863 */ 869 */
864 tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE); 870 xfs_wait_for_freeze(mp, SB_FREEZE_TRANS);
871 tp = _xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE, KM_NOFS);
865 tp->t_flags |= XFS_TRANS_RESERVE; 872 tp->t_flags |= XFS_TRANS_RESERVE;
866 error = xfs_trans_reserve(tp, resblks, 873 error = xfs_trans_reserve(tp, resblks,
867 XFS_WRITE_LOG_RES(mp), 0, 874 XFS_WRITE_LOG_RES(mp), 0,