Do not collapse objects with OBJ_NOSPLIT backing swap object.

NOSPLIT swap objects are not anonymous, they are used by tmpfs regular
files and POSIX shared memory.  For such objects, collapse is not
permitted.

Reported by:	mjg
Reviewed by:	markj, trasz
Tested by:	mjg, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D19923
This commit is contained in:
Konstantin Belousov 2019-05-05 11:06:19 +00:00
parent 2d6b8546b7
commit 7f1446052f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347150

View File

@ -1748,7 +1748,8 @@ vm_object_collapse(vm_object_t object)
VM_OBJECT_WLOCK(backing_object);
if (backing_object->handle != NULL ||
(backing_object->type != OBJT_DEFAULT &&
backing_object->type != OBJT_SWAP) ||
(backing_object->type != OBJT_SWAP ||
(backing_object->flags & OBJ_NOSPLIT) != 0)) ||
(backing_object->flags & OBJ_DEAD) ||
object->handle != NULL ||
(object->type != OBJT_DEFAULT &&