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

Commit be064d11 authored by Alexandre Oliva's avatar Alexandre Oliva Committed by Chris Mason
Browse files

Btrfs: skip allocation attempt from empty cluster



If we don't have a cluster, don't bother trying to allocate from it,
jumping right away to the attempt to allocate a new cluster.

Signed-off-by: default avatarAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 425d8315
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5299,9 +5299,9 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
			 * people trying to start a new cluster
			 */
			spin_lock(&last_ptr->refill_lock);
			if (last_ptr->block_group &&
			    (last_ptr->block_group->ro ||
			    !block_group_bits(last_ptr->block_group, data)))
			if (!last_ptr->block_group ||
			    last_ptr->block_group->ro ||
			    !block_group_bits(last_ptr->block_group, data))
				goto refill_cluster;

			offset = btrfs_alloc_from_cluster(block_group, last_ptr,