Btrfs: skip allocation attempt from empty cluster
[pandora-kernel.git] / fs / btrfs / extent-tree.c
index 71c8e70..813c6bb 100644 (file)
@@ -5299,9 +5299,9 @@ alloc:
                         * 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,