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
This commit is contained in:
Bryan Drewery 2016-04-06 22:38:50 +00:00
parent 9af130ae8c
commit 15719ec499

View File

@ -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);
}