diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 3cf038c055d7b587290b05bd659624985e9d1056..e8766a3967760f07b210e10e3b879f2c6af62872 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -1331,6 +1331,12 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal, 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