turning unmap on
previously we noticed that calling MmUnmapLockedPages() causes kernel crashes (thus the code is if 0-ed). however, when we don't unmap memory, it keeps accumulating in the nfsd's process memory (and is never "freed"). in this patch (a) calling unmap (b) checking if MmMapLockedPagesSpecifyCache() returns us a NULL pointer which is a type of failure that doesn't throw an exception but still is a failure. (c) cosmetic change to printf. NOTE: this cause still leads to failures for general tests. Running them in a loop (previously produced kernel crashes) now just leads to test failing. the cause is unknown!
This commit is contained in:
parent
89cd10a1f9
commit
6331621924
1 changed files with 8 additions and 3 deletions
|
|
@ -649,13 +649,18 @@ NTSTATUS marshal_nfs41_rw(nfs41_updowncall_entry *entry,
|
|||
__try {
|
||||
entry->u.ReadWrite.buf =
|
||||
MmMapLockedPagesSpecifyCache(entry->u.ReadWrite.MdlAddress,
|
||||
UserMode, MmCached, NULL, FALSE, NormalPagePriority);
|
||||
UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
|
||||
DbgP("MdlAddress=%p Userspace=%p\n", entry->u.ReadWrite.MdlAddress,
|
||||
entry->u.ReadWrite.buf);
|
||||
if (entry->u.ReadWrite.buf == NULL) {
|
||||
print_error("MmMapLockedPagesSpecifyCache failed to map pages\n");
|
||||
status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto out;
|
||||
}
|
||||
} __except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
NTSTATUS code;
|
||||
code = GetExceptionCode();
|
||||
print_error("Call to MmMapLocked failed due to exception 0x%0x\n", code);
|
||||
print_error("Call to MmMapLocked failed due to exception 0x%x\n", code);
|
||||
status = STATUS_ACCESS_DENIED;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1396,7 +1401,7 @@ nfs41_downcall (
|
|||
case NFS41_READ:
|
||||
RtlCopyMemory(&cur->u.ReadWrite.len, buf, sizeof(cur->u.ReadWrite.len));
|
||||
DbgP("[read/write] returned len %ld\n", cur->u.ReadWrite.len);
|
||||
#if 0
|
||||
#if 1
|
||||
/* 08/27/2010: it looks like we really don't need to call MmUnmapLockedPages()
|
||||
* eventhough we called MmMapLockedPagesSpecifyCache() as the MDL passed to us
|
||||
* is already locked.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue