]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r308806
authorasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 16 Dec 2016 20:10:55 +0000 (20:10 +0000)
committerasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 16 Dec 2016 20:10:55 +0000 (20:10 +0000)
commitd54dcf1accf2c7afd399a5770ba91bb3497b4aec
treea2ebb4b1eb6112556e9f126c005a277c317c47f6
parent4a3ba38c58e1e14befa99250b730521138ef5968
MFC r308806

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

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 placed fsync()s instead, which is much faster. Using a
ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

git-svn-id: svn://svn.freebsd.org/base/stable/10@310173 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libutil/gr_util.c
lib/libutil/pw_util.c
usr.sbin/pw/grupd.c
usr.sbin/pw/pw_nis.c
usr.sbin/pw/pwupd.c