Skip to content

Extent Traversal Logic #3

@ayushr2

Description

@ayushr2

I think the implemented extent traversal logic is incorrect.
This is not documented anywhere but ext4_extent_idx structs after the ext4_extent_header are sorted by the ei_block.

The current logic picks the ext4_extent_idx which satisfies ext4_extent_idx.ei_block < file_block_no but that will always choose the first ext4_extent_idx struct. This will lead to incorrect results for larger files.

The linux kernel implementation does a binary search: look at ext4_ext_binsearch_idx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions