aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3a129c42658e..9fcb8c97083b 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5939,10 +5939,15 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
5939 * the middle of a transaction commit. We also don't need the delalloc 5939 * the middle of a transaction commit. We also don't need the delalloc
5940 * mutex since we won't race with anybody. We need this mostly to make 5940 * mutex since we won't race with anybody. We need this mostly to make
5941 * lockdep shut its filthy mouth. 5941 * lockdep shut its filthy mouth.
5942 *
5943 * If we have a transaction open (can happen if we call truncate_block
5944 * from truncate), then we need FLUSH_LIMIT so we don't deadlock.
5942 */ 5945 */
5943 if (btrfs_is_free_space_inode(inode)) { 5946 if (btrfs_is_free_space_inode(inode)) {
5944 flush = BTRFS_RESERVE_NO_FLUSH; 5947 flush = BTRFS_RESERVE_NO_FLUSH;
5945 delalloc_lock = false; 5948 delalloc_lock = false;
5949 } else if (current->journal_info) {
5950 flush = BTRFS_RESERVE_FLUSH_LIMIT;
5946 } 5951 }
5947 5952
5948 if (flush != BTRFS_RESERVE_NO_FLUSH && 5953 if (flush != BTRFS_RESERVE_NO_FLUSH &&