mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Fix both a problem with accessing backing objects, and also release
the process map on nonexistant pages. PR: kern/3327 Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
This commit is contained in:
parent
c58494e476
commit
7cac787bee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25055
@ -37,7 +37,7 @@
|
||||
*
|
||||
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
|
||||
*
|
||||
* $Id: procfs_mem.c,v 1.23 1997/02/22 09:40:28 peter Exp $
|
||||
* $Id: procfs_mem.c,v 1.24 1997/04/06 02:29:31 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -197,6 +197,17 @@ procfs_rwmem(p, uio)
|
||||
}
|
||||
|
||||
m = vm_page_lookup(object, pindex);
|
||||
|
||||
/* Allow fallback to backing objects if we are reading */
|
||||
|
||||
while (m == NULL && !writing && object->backing_object) {
|
||||
|
||||
pindex += OFF_TO_IDX(object->backing_object_offset);
|
||||
object = object->backing_object;
|
||||
|
||||
m = vm_page_lookup(object, pindex);
|
||||
}
|
||||
|
||||
if (m == NULL) {
|
||||
error = EFAULT;
|
||||
|
||||
@ -206,6 +217,8 @@ procfs_rwmem(p, uio)
|
||||
*/
|
||||
object = NULL;
|
||||
|
||||
vm_map_lookup_done(tmap, out_entry);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
|
||||
*
|
||||
* $Id: procfs_mem.c,v 1.23 1997/02/22 09:40:28 peter Exp $
|
||||
* $Id: procfs_mem.c,v 1.24 1997/04/06 02:29:31 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -197,6 +197,17 @@ procfs_rwmem(p, uio)
|
||||
}
|
||||
|
||||
m = vm_page_lookup(object, pindex);
|
||||
|
||||
/* Allow fallback to backing objects if we are reading */
|
||||
|
||||
while (m == NULL && !writing && object->backing_object) {
|
||||
|
||||
pindex += OFF_TO_IDX(object->backing_object_offset);
|
||||
object = object->backing_object;
|
||||
|
||||
m = vm_page_lookup(object, pindex);
|
||||
}
|
||||
|
||||
if (m == NULL) {
|
||||
error = EFAULT;
|
||||
|
||||
@ -206,6 +217,8 @@ procfs_rwmem(p, uio)
|
||||
*/
|
||||
object = NULL;
|
||||
|
||||
vm_map_lookup_done(tmap, out_entry);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user