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)
Sat, Sep 26, 5:17 PM
Unknown Object (File)
Fri, Sep 25, 10:05 AM
Unknown Object (File)
Mon, Sep 21, 4:02 PM
Unknown Object (File)
Sun, Sep 20, 3:01 AM
Unknown Object (File)
Tue, Sep 15, 5:59 AM
Unknown Object (File)
Mon, Sep 14, 7:18 AM
Unknown Object (File)
Fri, Sep 11, 5:41 AM
Unknown Object (File)
Tue, Sep 8, 8:52 PM

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.