Page MenuHomeFreeBSD

Speed up pw operations that edit /etc/group or /etc/passwd
ClosedPublic

Authored by asomers on Oct 21 2016, 8:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 30 2024, 2:05 PM
Unknown Object (File)
Sep 19 2024, 1:39 PM
Unknown Object (File)
Sep 16 2024, 3:22 PM
Unknown Object (File)
Sep 9 2024, 3:50 AM
Unknown Object (File)
Sep 8 2024, 4:58 PM
Unknown Object (File)
Sep 8 2024, 11:32 AM
Unknown Object (File)
Aug 15 2024, 12:36 AM
Unknown Object (File)
Aug 6 2024, 11:20 AM

Details

Summary

r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
corruption on power loss. However, it fixed it by opening those files with
O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC
with appropriately place fsync()s instead, which is much faster. Using a
ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Test Plan

pw's kyua tests

Diff Detail

Event Timeline

asomers retitled this revision from to Speed up pw operations that edit /etc/group or /etc/passwd.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added reviewers: garga, dwmalone.
asomers added subscribers: truckman, bapt, vangyzen, se.
This revision is now accepted and ready to land.Oct 21 2016, 8:39 PM

Is anybody able to test the pfsense issue with my patch?
https://redmine.pfsense.org/issues/4523

bapt added a reviewer: bapt.
garga edited edge metadata.

I tried to break it on pfSense and couldn't reproduce original issue. Looks OK to me

This revision was automatically updated to reflect the committed changes.