]> git.baikalelectronics.ru Git - kernel.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)
commit8e60669022520460c82cc1153837891eac253724
treeefed93f9a10b2b5e0ca67d2622b025e7a501947d
parent63842bdf470017b070187392c2176755496cbeda
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