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
F148952459: D8319.id21605.diff
Sat, Mar 21, 6:55 AM
Unknown Object (File)
Fri, Mar 20, 8:38 AM
Unknown Object (File)
Fri, Mar 20, 8:30 AM
Unknown Object (File)
Wed, Mar 18, 1:17 AM
Unknown Object (File)
Tue, Mar 17, 1:33 PM
Unknown Object (File)
Mon, Mar 16, 11:11 AM
Unknown Object (File)
Mon, Mar 16, 6:28 AM
Unknown Object (File)
Sun, Mar 15, 4:33 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.