Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible infinite loop in ext4_ialloc_alloc_inode() #50

Open
rajeshvenkataraman opened this issue May 31, 2019 · 0 comments
Open

Possible infinite loop in ext4_ialloc_alloc_inode() #50

rajeshvenkataraman opened this issue May 31, 2019 · 0 comments

Comments

@rajeshvenkataraman
Copy link
Contributor

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;
                    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant