Page MenuHomeFreeBSD

Fix -S with -l not being atomic.
ClosedPublic

Authored by bdrewery on Aug 9 2016, 7:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 3:45 PM
Unknown Object (File)
Sep 18 2024, 9:12 AM
Unknown Object (File)
Sep 18 2024, 12:03 AM
Unknown Object (File)
Sep 18 2024, 12:03 AM
Unknown Object (File)
Sep 18 2024, 12:03 AM
Unknown Object (File)
Sep 17 2024, 11:53 PM
Unknown Object (File)
Sep 5 2024, 2:57 AM
Unknown Object (File)
Sep 4 2024, 7:16 PM
Subscribers

Details

Summary

It was unlinking the target even though it uses rename(2) which already
effectively does that. -S is intended to not unlink(2) the target first.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

Test Plan

Truss and:

/usr/tests/usr.bin/xinstall # kyua test
install_test:copy_self  ->  passed  [0.036s]
install_test:copy_self_comparing  ->  passed  [0.035s]
install_test:copy_self_safe  ->  passed  [0.035s]
install_test:copy_self_safe_comparing  ->  passed  [0.035s]
install_test:copy_to_nonexistent  ->  passed  [0.035s]
install_test:copy_to_nonexistent_backup  ->  passed  [0.035s]
install_test:copy_to_nonexistent_backup_safe  ->  passed  [0.035s]
install_test:copy_to_nonexistent_comparing  ->  passed  [0.035s]
install_test:copy_to_nonexistent_preserving  ->  passed  [0.035s]
install_test:copy_to_nonexistent_safe  ->  passed  [0.035s]
install_test:copy_to_nonexistent_safe_comparing  ->  passed  [0.035s]
install_test:hard_link  ->  passed  [0.033s]
install_test:mkdir_simple  ->  passed  [0.052s]
install_test:overwrite  ->  passed  [0.035s]
install_test:overwrite_backup  ->  passed  [0.036s]
install_test:overwrite_backup_comparing  ->  passed  [0.037s]
install_test:overwrite_backup_safe  ->  passed  [0.036s]
install_test:overwrite_backup_safe_comparing  ->  passed  [0.037s]
install_test:overwrite_comparing  ->  passed  [0.035s]
install_test:overwrite_eq  ->  passed  [0.035s]
install_test:overwrite_eq_comparing  ->  passed  [0.035s]
install_test:overwrite_eq_safe  ->  passed  [0.035s]
install_test:overwrite_eq_safe_comparing  ->  passed  [0.035s]
install_test:overwrite_safe  ->  passed  [0.035s]
install_test:overwrite_safe_comparing  ->  passed  [0.035s]
install_test:strip_changing  ->  passed  [0.045s]
install_test:strip_changing_comparing  ->  passed  [0.045s]
install_test:strip_changing_overwrite  ->  passed  [0.045s]
install_test:strip_changing_overwrite_comparing  ->  passed  [0.045s]
install_test:strip_changing_overwrite_eq  ->  passed  [0.045s]
install_test:strip_changing_overwrite_eq_comparing  ->  passed  [0.045s]
install_test:strip_noop  ->  passed  [0.038s]
install_test:symbolic_link  ->  passed  [0.035s]
install_test:symbolic_link_absolute  ->  passed  [0.036s]
install_test:symbolic_link_relative  ->  passed  [0.036s]

Results file id is usr_tests_usr.bin_xinstall.20160809-192916-083663
Results saved to /root/.kyua/store/results.usr_tests_usr.bin_xinstall.20160809-192916-083663.db

35/35 passed (0 failed)

Diff Detail

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

Event Timeline

bdrewery retitled this revision from to Fix -S with -l not being atomic..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)
bdrewery added reviewers: brooks, jhb, bapt.

These came in with the initial import of -l from NetBSD, but NetBSD never had these unlinks. The unlink is kept for the default (no -S) case.

jhb edited edge metadata.
This revision is now accepted and ready to land.Aug 10 2016, 1:47 PM
This revision was automatically updated to reflect the committed changes.