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

Fix mmap error when reading empty file during resume check on Linux #7808

Open
wants to merge 3 commits into
base: RC_2_0
Choose a base branch
from

Conversation

Doekin
Copy link

@Doekin Doekin commented Dec 9, 2024

This PR fixes #7790, where calling mmap() with length = 0 on Linux causes an -EINVAL error during the resume check process.

@arvidn
Copy link
Owner

arvidn commented Dec 10, 2024

There are tests with torrents that have 0-size files. Is this issue specifically when files that (when completed) are not 0-sized, but happens to have 0-size on disk during checking?

We would need an automated test to trigger this as well

@arvidn arvidn added this to the 2.0.11 milestone Dec 10, 2024
@Doekin
Copy link
Author

Doekin commented Dec 10, 2024

Exactly, you got it right.

@Doekin
Copy link
Author

Doekin commented Dec 10, 2024

I added larger files to test_checking. The test fails as expected without the mmap patch, and passes once the patch is applied.

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

Successfully merging this pull request may close these issues.

force recheck with zero byte files gives mmap error
2 participants