Skip to content

Commit

Permalink
btrfs: release metadata before running delayed refs
Browse files Browse the repository at this point in the history
We want to release the unused reservation we have since it refills the
delayed refs reserve, which will make everything go smoother when
running the delayed refs if we're short on our reservation.

CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Josef Bacik authored and David Sterba committed Oct 15, 2018
1 parent 5239834 commit f45c752
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
return ret;
}

btrfs_trans_release_metadata(trans);
trans->block_rsv = NULL;

/* make a pass through all the delayed refs we have so far
* any runnings procs may add more while we are here
*/
Expand All @@ -1941,9 +1944,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
return ret;
}

btrfs_trans_release_metadata(trans);
trans->block_rsv = NULL;

cur_trans = trans->transaction;

/*
Expand Down

0 comments on commit f45c752

Please sign in to comment.