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

fs/linux: fix potential copy_file issue #13984

Merged
merged 1 commit into from
Jun 12, 2023
Merged

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Jun 8, 2023

sendfile/sendfile64 is meant to be run in a loop, since there is no guarantee that a single call copies all the data.
The current implementation may lead to corrupt files on linux.

@elad335
Copy link
Contributor

elad335 commented Jun 9, 2023

maybe sendfile indeed needs a loop but sendfile64 does not? I don't find any information the limitation of sendfile64.

@Nekotekina
Copy link
Member

Maybe there is no need to use sendfile64, actually, it seems Linux-specific

@Megamouse
Copy link
Contributor Author

you mean because of this?
"The glibc sendfile() wrapper function transparently deals with the kernel differences."

@Nekotekina
Copy link
Member

I think so, yes

sendfile is meant to be run in a loop, since there is no guarantee that a single call copies all the data.
The current implementation may lead to corrupt files on linux.
@Megamouse Megamouse force-pushed the sendfile branch 2 times, most recently from e463c19 to 0dc7ca7 Compare June 11, 2023 14:25
@Nekotekina Nekotekina merged commit 635fed0 into RPCS3:master Jun 12, 2023
@Megamouse Megamouse deleted the sendfile branch June 12, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants