]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: account for trans_block_rsv in may_commit_transaction
authorJosef Bacik <josef@toxicpanda.com>
Fri, 13 Mar 2020 19:58:07 +0000 (15:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:22 +0000 (11:25 +0200)
commit642d557c815907661c637172c9cbf03cb78318cb
treefd3339cb7da6371bd4a49b3bbf85eb691783f567
parent446ea2f1a72c9b2369c1df46c59965f0eaee1c7d
btrfs: account for trans_block_rsv in may_commit_transaction

On ppc64le with 64k page size (respectively 64k block size) generic/320
was failing and debug output showed we were getting a premature ENOSPC
with a bunch of space in btrfs_fs_info::trans_block_rsv.

This meant there were still open transaction handles holding space, yet
the flusher didn't commit the transaction because it deemed the freed
space won't be enough to satisfy the current reserve ticket. Fix this
by accounting for space in trans_block_rsv when deciding whether the
current transaction should be committed or not.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-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