Page MenuHomeFreeBSD

cp: make buffer local to copy_fallback()
AcceptedPublic

Authored by ehem_freebsd_m5p.com on Feb 27 2021, 1:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 12:26 AM
Unknown Object (File)
Nov 28 2023, 11:57 AM
Unknown Object (File)
Nov 8 2023, 7:44 PM
Unknown Object (File)
Nov 6 2023, 1:48 PM
Unknown Object (File)
Oct 7 2023, 6:42 PM
Unknown Object (File)
Oct 5 2023, 12:46 PM
Unknown Object (File)
Sep 29 2023, 12:44 PM
Unknown Object (File)
Sep 3 2023, 12:30 PM
Subscribers

Details

Reviewers
asomers
Summary

As the copy buffer isn't used anywhere else, it should be local instead
of being passed in each time. Previously it had been static to
copy_file().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37426
Build 34315: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Feb 27 2021, 1:24 AM

Erk, noticed an issue. I'm unsure of the magnitude of this.

bin/cp/utils.c
87–91

Bit of funkiness about this comment now. copy_fallback() may never get called if copy_file_range() functions for all files. copy_fallback() though could fail in the middle of copying files if copy_file_range() functions for some, but not for others.

As such, this comment isn't guaranteed to be true anymore. It seems unlikely for copy_fallback() to fail in the middle, but it is now possible. I'm tempted to leave this alone as it will still be true most of the time.