mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Fixed a really bogus problem with msync ripping pages away from
objects before they were written. Also, don't allow processes without write access to remove pages from vm_objects.
This commit is contained in:
parent
73d54b16b8
commit
a02051c37a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14036
@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_map.c,v 1.31 1996/01/04 21:13:17 wollman Exp $
|
||||
* $Id: vm_map.c,v 1.32 1996/01/19 03:59:52 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -1529,16 +1529,17 @@ vm_map_clean(map, start, end, syncio, invalidate)
|
||||
* the object before it completes is probably a very bad
|
||||
* idea.
|
||||
*/
|
||||
if (current->protection & VM_PROT_WRITE)
|
||||
if (current->protection & VM_PROT_WRITE) {
|
||||
vm_object_page_clean(object,
|
||||
OFF_TO_IDX(offset),
|
||||
OFF_TO_IDX(offset + size),
|
||||
syncio, TRUE);
|
||||
if (invalidate)
|
||||
vm_object_page_remove(object,
|
||||
OFF_TO_IDX(offset),
|
||||
OFF_TO_IDX(offset + size),
|
||||
FALSE);
|
||||
(syncio||invalidate)?1:0, TRUE);
|
||||
if (invalidate)
|
||||
vm_object_page_remove(object,
|
||||
OFF_TO_IDX(offset),
|
||||
OFF_TO_IDX(offset + size),
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
start += size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user