diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-01-17 09:07:39 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-01-31 14:02:01 +0100 |
commit | a30a3d2067536cbcce26c055e70cc3a6ae4fd45c (patch) | |
tree | 79aae74bcef4811226ad97d5247909f89a9c63bb /fs/nfsd/acl.h | |
parent | a7a63acc6575ded6f48ab293e275e8b903325e54 (diff) | |
download | linux-a30a3d2067536cbcce26c055e70cc3a6ae4fd45c.tar.gz linux-a30a3d2067536cbcce26c055e70cc3a6ae4fd45c.tar.bz2 linux-a30a3d2067536cbcce26c055e70cc3a6ae4fd45c.zip |
btrfs: take overcommit into account in inc_block_group_ro
inc_block_group_ro does a calculation to see if we have enough room left
over if we mark this block group as read only in order to see if it's ok
to mark the block group as read only.
The problem is this calculation _only_ works for data, where our used is
always less than our total. For metadata we will overcommit, so this
will almost always fail for metadata.
Fix this by exporting btrfs_can_overcommit, and then see if we have
enough space to remove the remaining free space in the block group we
are trying to mark read only. If we do then we can mark this block
group as read only.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/nfsd/acl.h')
0 files changed, 0 insertions, 0 deletions