- From 858d15ccf6320483af1beecfa24337922e7c2864 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 6 Apr 2024 19:38:01 +0200
- Subject: [PATCH 1/2] sys: Improve debug messages in case of |MmMap*()|
- failures/exceptions
- Improve debug messages in case of |MmMap*()| failures/exceptions
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 26 ++++++++++++++++++--------
- 1 file changed, 18 insertions(+), 8 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 2d06e7d..64913d3 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -752,13 +752,17 @@ NTSTATUS marshal_nfs41_open(
- MmMapLockedPagesSpecifyCache(entry->u.Open.EaMdl,
- UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- if (entry->u.Open.EaBuffer == NULL) {
- - print_error("MmMapLockedPagesSpecifyCache failed to map pages\n");
- + print_error("marshal_nfs41_open: "
- + "MmMapLockedPagesSpecifyCache() failed to "
- + "map pages\n");
- status = STATUS_INSUFFICIENT_RESOURCES;
- goto out;
- }
- }
- } __except(EXCEPTION_EXECUTE_HANDLER) {
- - print_error("Call to MmMapLocked failed due to exception 0x%x\n", GetExceptionCode());
- + print_error("marshal_nfs41_open: Call to "
- + "MmMapLockedPagesSpecifyCache() failed "
- + "due to exception 0x%x\n", (int)GetExceptionCode());
- status = STATUS_ACCESS_DENIED;
- goto out;
- }
- @@ -823,14 +827,17 @@ NTSTATUS marshal_nfs41_rw(
- MmMapLockedPagesSpecifyCache(entry->u.ReadWrite.MdlAddress,
- UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- if (entry->buf == NULL) {
- - print_error("MmMapLockedPagesSpecifyCache failed to map pages\n");
- + print_error("marshal_nfs41_rw: "
- + "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%x\n", code);
- + print_error("marshal_nfs41_rw: Call to "
- + "MmMapLockedPagesSpecifyCache() failed due to "
- + "exception 0x%x\n", (int)code);
- status = STATUS_ACCESS_DENIED;
- goto out;
- }
- @@ -1005,14 +1012,17 @@ NTSTATUS marshal_nfs41_dirquery(
- MmMapLockedPagesSpecifyCache(entry->u.QueryFile.mdl,
- UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- if (entry->u.QueryFile.mdl_buf == NULL) {
- - print_error("MmMapLockedPagesSpecifyCache failed to map pages\n");
- + print_error("marshal_nfs41_dirquery: "
- + "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%x\n", code);
- + print_error("marshal_nfs41_dirquery: Call to "
- + "MmMapLockedPagesSpecifyCache() failed "
- + "due to exception 0x%x\n", (int)code);
- status = STATUS_ACCESS_DENIED;
- goto out;
- }
- @@ -1747,8 +1757,8 @@ NTSTATUS unmarshal_nfs41_rw(
- } __except(EXCEPTION_EXECUTE_HANDLER) {
- NTSTATUS code;
- code = GetExceptionCode();
- - print_error("Call to MmUnmapLockedPages failed due to"
- - " exception 0x%0x\n", code);
- + print_error("unmarshal_nfs41_rw: Call to MmUnmapLockedPages() "
- + "failed due to exception 0x%0x\n", (int)code);
- status = STATUS_ACCESS_DENIED;
- }
- #endif
- --
- 2.43.0
- From 0d38b62a1bd610030f6220b09808e39aa1c731ca Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 6 Apr 2024 19:40:01 +0200
- Subject: [PATCH 2/2] sys: Use |MmCached| instead of |MmNonCached|
- Use |MmCached| instead of |MmNonCached| for memory mappings.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 64913d3..b48f7cc 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -750,7 +750,7 @@ NTSTATUS marshal_nfs41_open(
- if (entry->u.Open.EaMdl) {
- entry->u.Open.EaBuffer =
- MmMapLockedPagesSpecifyCache(entry->u.Open.EaMdl,
- - UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- + UserMode, MmCached, NULL, TRUE, NormalPagePriority);
- if (entry->u.Open.EaBuffer == NULL) {
- print_error("marshal_nfs41_open: "
- "MmMapLockedPagesSpecifyCache() failed to "
- @@ -825,7 +825,7 @@ NTSTATUS marshal_nfs41_rw(
- #pragma warning( pop )
- entry->buf =
- MmMapLockedPagesSpecifyCache(entry->u.ReadWrite.MdlAddress,
- - UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- + UserMode, MmCached, NULL, TRUE, NormalPagePriority);
- if (entry->buf == NULL) {
- print_error("marshal_nfs41_rw: "
- "MmMapLockedPagesSpecifyCache() failed to map pages\n");
- @@ -1010,7 +1010,7 @@ NTSTATUS marshal_nfs41_dirquery(
- __try {
- entry->u.QueryFile.mdl_buf =
- MmMapLockedPagesSpecifyCache(entry->u.QueryFile.mdl,
- - UserMode, MmNonCached, NULL, TRUE, NormalPagePriority);
- + UserMode, MmCached, NULL, TRUE, NormalPagePriority);
- if (entry->u.QueryFile.mdl_buf == NULL) {
- print_error("marshal_nfs41_dirquery: "
- "MmMapLockedPagesSpecifyCache() failed to map pages\n");
- --
- 2.43.0
msnfs41client: Patches for kernel/daemon memory mappings+debug output, 2024-04-10
Posted by Anonymous on Wed 10th Apr 2024 14:41
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.