Skip to content

Commit be064d1

Browse files
Alexandre Olivachrismason-xx
authored andcommitted
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: Alexandre Oliva <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 425d831 commit be064d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/extent-tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5299,9 +5299,9 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
52995299
* people trying to start a new cluster
53005300
*/
53015301
spin_lock(&last_ptr->refill_lock);
5302-
if (last_ptr->block_group &&
5303-
(last_ptr->block_group->ro ||
5304-
!block_group_bits(last_ptr->block_group, data)))
5302+
if (!last_ptr->block_group ||
5303+
last_ptr->block_group->ro ||
5304+
!block_group_bits(last_ptr->block_group, data))
53055305
goto refill_cluster;
53065306

53075307
offset = btrfs_alloc_from_cluster(block_group, last_ptr,

0 commit comments

Comments
 (0)