diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-07-21 16:22:32 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-10-07 12:06:54 +0200 |
commit | cb3e3930459972dbafc274bcde3fdc1462429391 (patch) | |
tree | 8b26df777d0b48822dff2203965ffad334ae27b8 /fs/btrfs/space-info.c | |
parent | btrfs: run delayed iputs before committing the transaction for data (diff) | |
download | linux-cb3e3930459972dbafc274bcde3fdc1462429391.tar.xz linux-cb3e3930459972dbafc274bcde3fdc1462429391.zip |
btrfs: flush delayed refs when trying to reserve data space
We can end up with freed 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>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.c')
-rw-r--r-- | fs/btrfs/space-info.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 6d82c444ceff..8496518297f3 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -1023,6 +1023,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, }; |