]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: flush delayed refs when trying to reserve data space
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:32 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:54 +0000 (12:06 +0200)
commit66407f3b535e5a6f4ba742173b82a393bc8d2d25
tree8b26df777d0b48822dff2203965ffad334ae27b8
parent0f42017b2fb5fab405c00180ab0b500e768b84a1
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>
fs/btrfs/space-info.c