Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17504584 authored by Liu Bo's avatar Liu Bo Committed by Chris Mason
Browse files

Btrfs: return free space to global_rsv as much as possible



@full is not protected within global_rsv.lock, so we may think global_rsv
is already full but in fact it's not, so we miss the opportunity to return
free space to global_rsv directly when we release other block_rsvs.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 1708cc57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4674,7 +4674,7 @@ void btrfs_block_rsv_release(struct btrfs_root *root,
			     u64 num_bytes)
{
	struct btrfs_block_rsv *global_rsv = &root->fs_info->global_block_rsv;
	if (global_rsv->full || global_rsv == block_rsv ||
	if (global_rsv == block_rsv ||
	    block_rsv->space_info != global_rsv->space_info)
		global_rsv = NULL;
	block_rsv_release_bytes(root->fs_info, block_rsv, global_rsv,