Page MenuHomeFreeBSD

install: Expect EINTR while copying
ClosedPublic

Authored by des on Sat, Feb 7, 5:46 PM.
Tags
None
Referenced Files
F146963027: D55168.id.diff
Sat, Mar 7, 4:30 AM
Unknown Object (File)
Tue, Mar 3, 5:22 AM
Unknown Object (File)
Thu, Feb 19, 10:25 AM
Unknown Object (File)
Fri, Feb 13, 4:21 AM
Unknown Object (File)
Thu, Feb 12, 5:33 PM
Unknown Object (File)
Thu, Feb 12, 7:45 AM
Unknown Object (File)
Thu, Feb 12, 3:26 AM
Unknown Object (File)
Wed, Feb 11, 11:16 PM
Subscribers

Details

Summary

Both copy_file_range() and read() / write() in our fallback loop can be
interrupted before copying anything at all, in which case it returns -1
and sets errno to EINTR. If that happens, we should retry, not fail.

While here, drop the size argument from copy() (we always want to copy
the entire file anyway) and add a test case that exercises the metalog
and digest functionality.

MFC after: 1 week
PR: 293028

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70617
Build 67500: arc lint + arc unit

Event Timeline

des requested review of this revision.Sat, Feb 7, 5:46 PM

Fix fallback too. This is an excellent argument for creating
something like Apple's libcopyfile...

usr.bin/xinstall/tests/install_test.sh
527

A filename with a space that needs encoded would maybe be useful here, to demonstrate that it's properly escaping

usr.bin/xinstall/tests/install_test.sh
527

The point of this test is to exercise the digest functionality, which I accidentally broke in an earlier version of this patch. What you describe belongs in a more general test of the metalog functionality, which is not my goal here.

usr.bin/xinstall/tests/install_test.sh
527

That is the impression you give by writing

test case that exercises the metalog and digest functionality.

I'm not asking for exhaustive metalog tests, just one specific bit that's easy to screw up and super easy to test while you're already here.

des marked 2 inline comments as done.Wed, Feb 11, 1:43 PM
This revision is now accepted and ready to land.Wed, Feb 11, 3:14 PM
This revision was automatically updated to reflect the committed changes.