In the ext4_ialloc_alloc_inode() inside the "while (bgid <= bg_count) " loop if the free_inodes is greater that zero and ext4_bmap_bit_find_clr() returns ENOSPC we continue to the top of the loop but the bgid is not incremented. This would lead to an infinite while loop.
/* Block group has not any free i-node */
if (rc == ENOSPC) {
rc = ext4_block_set(fs->bdev, &b);
if (rc != EOK) {
ext4_fs_put_block_group_ref(&bg_ref);
return rc;
}
rc = ext4_fs_put_block_group_ref(&bg_ref);
if (rc != EOK)
return rc;
**++bgid;**
continue;
}
In the ext4_ialloc_alloc_inode() inside the "while (bgid <= bg_count) " loop if the free_inodes is greater that zero and ext4_bmap_bit_find_clr() returns ENOSPC we continue to the top of the loop but the bgid is not incremented. This would lead to an infinite while loop.