- From be5cc0ea231795a51f1f518ec95e22d340e07e60 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 16 Apr 2025 15:31:47 +0200
- Subject: [PATCH 1/2] daemon: Fix nfserr to Win32 err mapping and error
- reporting
- Fix nfserr to Win32 err mapping and error reporting.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 19 +++++++++++++------
- daemon/readwrite.c | 12 ++++++------
- 2 files changed, 19 insertions(+), 12 deletions(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 1b50fc3..72a7ba5 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -393,9 +393,10 @@ int handle_setzerodata(void *daemon_context,
- offset_start, len, &info);
- if (status) {
- DPRINTF(SZDLVL, ("handle_setzerodata(state->path.path='%s'): "
- - "DEALLOCATE failed with status=0x%x\n",
- + "DEALLOCATE failed with '%s'\n",
- state->path.path,
- - status));
- + nfs_error_string(status)));
- + status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
- goto out;
- }
- @@ -504,6 +505,8 @@ int handle_duplicatedata(void *daemon_context,
- /* NFS CLONE supported ? */
- if (session->client->root->supports_nfs42_clone == false) {
- + DPRINTF(0,
- + ("handle_duplicatedata: NFS CLONE not supported\n"));
- status = ERROR_NOT_SUPPORTED;
- goto out;
- }
- @@ -511,6 +514,8 @@ int handle_duplicatedata(void *daemon_context,
- #ifdef CLONE_PUNCH_HOLE_IF_CLONESIZE_BIGGER_THAN_SRCFILESIZE
- /* NFS DEALLOCATE supported ? */
- if (session->client->root->supports_nfs42_deallocate == false) {
- + DPRINTF(0,
- + ("handle_duplicatedata: NFS DEALLOCATE not supported\n"));
- status = ERROR_NOT_SUPPORTED;
- goto out;
- }
- @@ -568,10 +573,11 @@ int handle_duplicatedata(void *daemon_context,
- ("handle_duplicatedata("
- "src_state->path.path='%s' "
- "dst_state->path.path='%s'): "
- - "CLONE failed with status=0x%x\n",
- + "CLONE failed with '%s'\n",
- src_state->path.path,
- dst_state->path.path,
- - status));
- + nfs_error_string(status)));
- + status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
- goto out;
- }
- @@ -598,10 +604,11 @@ int handle_duplicatedata(void *daemon_context,
- ("handle_duplicatedata("
- "src_state->path.path='%s' "
- "dst_state->path.path='%s'): "
- - "DEALLOCATE failed with status=0x%x\n",
- + "DEALLOCATE failed with '%s'\n",
- src_state->path.path,
- dst_state->path.path,
- - status));
- + nfs_error_string(status)));
- + status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
- goto out;
- }
- }
- diff --git a/daemon/readwrite.c b/daemon/readwrite.c
- index fcf1749..f9ac3ee 100644
- --- a/daemon/readwrite.c
- +++ b/daemon/readwrite.c
- @@ -85,9 +85,9 @@ static int read_from_mds(
- if (status == NFS4ERR_IO) {
- DPRINTF(0,
- ("read_from_mds: "
- - "nfs42_read_plus() failed, status=%d, "
- + "nfs42_read_plus() failed, error '%s', "
- "disabling OP_READ_PLUS\n",
- - status));
- + nfs_error_string(status)));
- session->client->root->supports_nfs42_read_plus = false;
- }
- }
- @@ -233,9 +233,9 @@ static int write_to_mds(
- &info);
- if (status) {
- DPRINTF(0, ("write_to_mds(state->path.path='%s'): "
- - "DEALLOCATE failed with status=0x%x\n",
- + "DEALLOCATE failed with '%s'\n",
- state->path.path,
- - status));
- + nfs_error_string(status)));
- }
- else {
- status = nfs42_allocate(session, file, stateid,
- @@ -243,9 +243,9 @@ static int write_to_mds(
- &info);
- if (status) {
- DPRINTF(0, ("write_to_mds(state->path.path='%s'): "
- - "ALLOCATE failed with status=0x%x\n",
- + "ALLOCATE failed with '%s'\n",
- state->path.path,
- - status));
- + nfs_error_string(status)));
- }
- }
- --
- 2.45.1
- From af9bfaf025e5adaa2f0b689d5e800144a9b4ef9a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 16 Apr 2025 15:33:54 +0200
- Subject: [PATCH 2/2] daemon: Fix bogus '\b' in |handle_setzerodata()|
- Fix bogus '\b' in |handle_setzerodata()|, this should be a newline.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 72a7ba5..7d83c32 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -377,7 +377,8 @@ int handle_setzerodata(void *daemon_context,
- if (len < 0) {
- status = ERROR_INVALID_PARAMETER;
- - DPRINTF(SZDLVL, ("handle_setzerodata: invalid len\b"));
- + DPRINTF(SZDLVL,
- + ("handle_setzerodata: invalid len=%lld\n", len));
- goto out;
- }
- --
- 2.45.1
msnfs41client: Patches for NFS error handling/mapping, typos+misc, 2025-04-16-002
Posted by Anonymous on Wed 16th Apr 2025 15:59
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.