Skip to content

Off-by-one issue in inotify11? #1200

@nathanielmanistaatgoogle

Description

Maybe I'm misreading the test, but is there any off-by-one issue in inotify11?

It looks like churn creates 10,000 files (CHURN_FILES + 1 being 10,000), because of the <= in for (i = 0; i <= CHURN_FILES; ++i). But then it also looks like verify_inotify has a possibility of completing after verifying only 9,999 files, because of the < in while (!opened && nevents < CHURN_FILES).

Am I understanding that correctly? I don't imagine that it has any effect on the outcome of the test - I suspect the test functions perfectly well catching the potential regressions it was meant to catch - but is it something to tidy up? It caught my attention with a "huh, that's interesting...".

It wouldn't break the test to read all 10,000 expected files, would it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions