]> asedeno.scripts.mit.edu Git - linux.git/commit
btrfs: fix may_commit_transaction to deal with no partial filling
authorJosef Bacik <josef@toxicpanda.com>
Thu, 22 Aug 2019 19:11:00 +0000 (15:11 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:18 +0000 (14:59 +0200)
commit00c0135eb8b8172de48e1accbb09ebfa3aa8bf25
treeefed93f9a10b2b5e0ca67d2622b025e7a501947d
parent2341ccd1bf05b3d844c10ad224cd38b06fd53219
btrfs: fix may_commit_transaction to deal with no partial filling

Now that we aren't partially filling tickets we may have some slack
space left in the space_info.  We need to account for this in
may_commit_transaction, otherwise we may choose to not commit the
transaction despite it actually having enough space to satisfy our
ticket.

Calculate the free space we have in the space_info, if any, and subtract
this from the ticket we have and use that amount to determine if we will
need to commit to reclaim enough space.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c