pastebin - collaborative debugging tool
rovema.kpaste.net RSS


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

  1. From be5cc0ea231795a51f1f518ec95e22d340e07e60 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 16 Apr 2025 15:31:47 +0200
  4. Subject: [PATCH 1/2] daemon: Fix nfserr to Win32 err mapping and error
  5.  reporting
  6.  
  7. Fix nfserr to Win32 err mapping and error reporting.
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. daemon/fsctl.c     | 19 +++++++++++++------
  12.  daemon/readwrite.c | 12 ++++++------
  13.  2 files changed, 19 insertions(+), 12 deletions(-)
  14.  
  15. diff --git a/daemon/fsctl.c b/daemon/fsctl.c
  16. index 1b50fc3..72a7ba5 100644
  17. --- a/daemon/fsctl.c
  18. +++ b/daemon/fsctl.c
  19. @@ -393,9 +393,10 @@ int handle_setzerodata(void *daemon_context,
  20.           offset_start, len, &info);
  21.       if (status) {
  22.          DPRINTF(SZDLVL, ("handle_setzerodata(state->path.path='%s'): "
  23. -            "DEALLOCATE failed with status=0x%x\n",
  24. +            "DEALLOCATE failed with '%s'\n",
  25.              state->path.path,
  26. -            status));
  27. +            nfs_error_string(status)));
  28. +        status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
  29.          goto out;
  30.       }
  31.  
  32. @@ -504,6 +505,8 @@ int handle_duplicatedata(void *daemon_context,
  33.  
  34.      /* NFS CLONE supported ? */
  35.      if (session->client->root->supports_nfs42_clone == false) {
  36. +        DPRINTF(0,
  37. +            ("handle_duplicatedata: NFS CLONE not supported\n"));
  38.          status = ERROR_NOT_SUPPORTED;
  39.          goto out;
  40.      }
  41. @@ -511,6 +514,8 @@ int handle_duplicatedata(void *daemon_context,
  42.  #ifdef CLONE_PUNCH_HOLE_IF_CLONESIZE_BIGGER_THAN_SRCFILESIZE
  43.      /* NFS DEALLOCATE supported ? */
  44.      if (session->client->root->supports_nfs42_deallocate == false) {
  45. +        DPRINTF(0,
  46. +            ("handle_duplicatedata: NFS DEALLOCATE not supported\n"));
  47.          status = ERROR_NOT_SUPPORTED;
  48.          goto out;
  49.      }
  50. @@ -568,10 +573,11 @@ int handle_duplicatedata(void *daemon_context,
  51.              ("handle_duplicatedata("
  52.              "src_state->path.path='%s' "
  53.              "dst_state->path.path='%s'): "
  54. -            "CLONE failed with status=0x%x\n",
  55. +            "CLONE failed with '%s'\n",
  56.              src_state->path.path,
  57.              dst_state->path.path,
  58. -            status));
  59. +            nfs_error_string(status)));
  60. +        status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
  61.          goto out;
  62.      }
  63.  
  64. @@ -598,10 +604,11 @@ int handle_duplicatedata(void *daemon_context,
  65.                  ("handle_duplicatedata("
  66.                  "src_state->path.path='%s' "
  67.                  "dst_state->path.path='%s'): "
  68. -                "DEALLOCATE failed with status=0x%x\n",
  69. +                "DEALLOCATE failed with '%s'\n",
  70.                  src_state->path.path,
  71.                  dst_state->path.path,
  72. -                status));
  73. +                nfs_error_string(status)));
  74. +            status = nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
  75.              goto out;
  76.          }
  77.      }
  78. diff --git a/daemon/readwrite.c b/daemon/readwrite.c
  79. index fcf1749..f9ac3ee 100644
  80. --- a/daemon/readwrite.c
  81. +++ b/daemon/readwrite.c
  82. @@ -85,9 +85,9 @@ static int read_from_mds(
  83.              if (status == NFS4ERR_IO) {
  84.                  DPRINTF(0,
  85.                      ("read_from_mds: "
  86. -                    "nfs42_read_plus() failed, status=%d, "
  87. +                    "nfs42_read_plus() failed, error '%s', "
  88.                      "disabling OP_READ_PLUS\n",
  89. -                    status));
  90. +                    nfs_error_string(status)));
  91.                  session->client->root->supports_nfs42_read_plus = false;
  92.              }
  93.          }
  94. @@ -233,9 +233,9 @@ static int write_to_mds(
  95.              &info);
  96.          if (status) {
  97.              DPRINTF(0, ("write_to_mds(state->path.path='%s'): "
  98. -                "DEALLOCATE failed with status=0x%x\n",
  99. +                "DEALLOCATE failed with '%s'\n",
  100.                  state->path.path,
  101. -                status));
  102. +                nfs_error_string(status)));
  103.          }
  104.          else {
  105.              status = nfs42_allocate(session, file, stateid,
  106. @@ -243,9 +243,9 @@ static int write_to_mds(
  107.                  &info);
  108.              if (status) {
  109.                  DPRINTF(0, ("write_to_mds(state->path.path='%s'): "
  110. -                    "ALLOCATE failed with status=0x%x\n",
  111. +                    "ALLOCATE failed with '%s'\n",
  112.                      state->path.path,
  113. -                    status));
  114. +                    nfs_error_string(status)));
  115.              }
  116.          }
  117.  
  118. --
  119. 2.45.1
  120.  
  121. From af9bfaf025e5adaa2f0b689d5e800144a9b4ef9a Mon Sep 17 00:00:00 2001
  122. From: Roland Mainz <roland.mainz@nrubsig.org>
  123. Date: Wed, 16 Apr 2025 15:33:54 +0200
  124. Subject: [PATCH 2/2] daemon: Fix bogus '\b' in |handle_setzerodata()|
  125.  
  126. Fix bogus '\b' in |handle_setzerodata()|, this should be a newline.
  127.  
  128. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  129. ---
  130. daemon/fsctl.c | 3 ++-
  131.  1 file changed, 2 insertions(+), 1 deletion(-)
  132.  
  133. diff --git a/daemon/fsctl.c b/daemon/fsctl.c
  134. index 72a7ba5..7d83c32 100644
  135. --- a/daemon/fsctl.c
  136. +++ b/daemon/fsctl.c
  137. @@ -377,7 +377,8 @@ int handle_setzerodata(void *daemon_context,
  138.  
  139.      if (len < 0) {
  140.          status = ERROR_INVALID_PARAMETER;
  141. -        DPRINTF(SZDLVL, ("handle_setzerodata: invalid len\b"));
  142. +        DPRINTF(SZDLVL,
  143. +            ("handle_setzerodata: invalid len=%lld\n", len));
  144.          goto out;
  145.      }
  146.  
  147. --
  148. 2.45.1

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at