svn commit: r297626 - head/lib/libc/db/hash
Bryan Drewery
bdrewery at FreeBSD.org
Wed Apr 6 22:38:51 UTC 2016
Author: bdrewery
Date: Wed Apr 6 22:38:50 2016
New Revision: 297626
URL: https://svnweb.freebsd.org/changeset/base/297626
Log:
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
Modified:
head/lib/libc/db/hash/hash.c
Modified: head/lib/libc/db/hash/hash.c
==============================================================================
--- head/lib/libc/db/hash/hash.c Wed Apr 6 21:59:52 2016 (r297625)
+++ head/lib/libc/db/hash/hash.c Wed Apr 6 22:38:50 2016 (r297626)
@@ -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);
}
More information about the svn-src-all
mailing list