aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-01-29 12:02:27 -0500
committerJosef Bacik <josef@toxicpanda.com>2020-02-14 10:04:07 -0500
commitc3f0207fff2b98d3d393b0bcacff32d5d661893a (patch)
tree7c49b863d35d41ef1ce4f62d174c0b53cf14fec0
parentfe7d0b1e3db7ecce4b6c94203495738032d78a3f (diff)
downloadbtrfs-next-c3f0207fff2b98d3d393b0bcacff32d5d661893a.tar.gz
btrfs: flush delayed refs when trying to reserve data space
We can end up with free'd extents in the delayed refs, and thus may_commit_transaction() may not think we have enough pinned space to commit the transaction and we'll ENOSPC early. Handle this by running the delayed refs in order to make sure pinned is uptodate before we try to commit the transaction. Tested-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
-rw-r--r--fs/btrfs/space-info.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index a4487259b59ac7..564dec9f15e821 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -952,6 +952,7 @@ static const enum btrfs_flush_state evict_flush_states[] = {
static const enum btrfs_flush_state data_flush_states[] = {
FLUSH_DELALLOC_WAIT,
RUN_DELAYED_IPUTS,
+ FLUSH_DELAYED_REFS,
COMMIT_TRANS,
};