Patch from Alex Tomas <bzzz@tmi.comex.ru>
There is a logic error in ext2_new_block(). If we manage to reserve some
blocks in the final blockgroup, local variable `bit' will be equal to
sbi->s_groups_count and we erroneously assume that the allocation failed.
Fix that up by testing local variable `group_alloc' instead.
goto io_error;
group_alloc = group_reserve_blocks(desc, gdp_bh, es_alloc);
}
- if (bit >= sbi->s_groups_count) {
+ if (!group_alloc) {
*err = -ENOSPC;
goto out_release;
}