ext2: Avoid loading bitmaps for full groups during block allocation
[pandora-kernel.git] / fs / ext2 / balloc.c
index 3cf038c..e8766a3 100644 (file)
@@ -1331,6 +1331,12 @@ retry_alloc:
                        goto io_error;
 
                free_blocks = le16_to_cpu(gdp->bg_free_blocks_count);
+               /*
+                * skip this group (and avoid loading bitmap) if there
+                * are no free blocks
+                */
+               if (!free_blocks)
+                       continue;
                /*
                 * skip this group if the number of
                 * free blocks is less than half of the reservation