diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2016-04-06 22:38:50 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2016-04-06 22:38:50 +0000 |
commit | 3261994ba6feb27f89151ec6f7139edd8484cf00 (patch) | |
tree | 7910e83b0323d45afcba2659ea75d9964895c04f /lib/libc | |
parent | 5499ecc9666fdf02ad318ae02374b358ee18ff35 (diff) | |
download | FreeBSD-src-3261994ba6feb27f89151ec6f7139edd8484cf00.zip FreeBSD-src-3261994ba6feb27f89151ec6f7139edd8484cf00.tar.gz |
Follow-up r295924: Only sync hash-based db files open for writing when closing.
This fixes a major performance regression when reading db files such as
the pw database during a 'pkg install'.
MFC after: 1 week
Tested by: bapt
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5868
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/db/hash/hash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 02503ee..fc4e50e 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -423,7 +423,8 @@ hdestroy(HTAB *hashp) free(hashp->tmp_buf); if (hashp->fp != -1) { - (void)_fsync(hashp->fp); + if (hashp->save_file) + (void)_fsync(hashp->fp); (void)_close(hashp->fp); } |