btree(3): don't shortcut closing if the metadata is dirty.

Obtained from:	NetBSD (from krb5 tree)

MFC after:	3 weeks
This commit is contained in:
Pedro F. Giffuni 2016-09-26 02:29:28 +00:00
parent 3e0d0fcee9
commit d191be26c0

View File

@ -134,7 +134,8 @@ __bt_sync(const DB *dbp, u_int flags)
return (RET_ERROR);
}
if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED))
if (F_ISSET(t, B_INMEM | B_RDONLY) ||
!F_ISSET(t, B_MODIFIED | B_METADIRTY))
return (RET_SUCCESS);
if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR)