pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for adding NFSv4.2 OPs to debug+remove |NFS41_MAX_FILEIO_SIZE| limit, 2025-01-27
Posted by Anonymous on Mon 27th Jan 2025 15:44
raw | new post

  1. From 078c79ebc468cef3e7e52117ee6f8df1d29fcd33 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 27 Jan 2025 14:57:40 +0100
  4. Subject: [PATCH 1/2] daemon: Remove |NFS41_MAX_FILEIO_SIZE| limit
  5.  
  6. Remove |NFS41_MAX_FILEIO_SIZE| limit
  7.  
  8. Reported-by: Lionel Cons <lionelcons1972@gmail.com>
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. daemon/nfs41_const.h | 1 -
  12.  daemon/nfs41_xdr.c   | 5 ++++-
  13.  2 files changed, 4 insertions(+), 2 deletions(-)
  14.  
  15. diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h
  16. index c785df6..0d86b8d 100644
  17. --- a/daemon/nfs41_const.h
  18. +++ b/daemon/nfs41_const.h
  19. @@ -47,7 +47,6 @@
  20.   */
  21.  #define NFS4_FATTR4_OWNER_LIMIT (256)
  22.  
  23. -#define NFS41_MAX_FILEIO_SIZE   (1024 * 1024)
  24.  #define NFS41_MAX_SERVER_CACHE  1024
  25.  #define NFS41_MAX_RPC_REQS      128
  26.  
  27. diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
  28. index 1108950..4ed4102 100644
  29. --- a/daemon/nfs41_xdr.c
  30. +++ b/daemon/nfs41_xdr.c
  31. @@ -2915,7 +2915,10 @@ static bool_t encode_op_write(
  32.      if (!xdr_u_int32_t(xdr, &args->stable))
  33.          return FALSE;
  34.  
  35. -    return xdr_bytes(xdr, (char **)&data, &args->data_len, NFS41_MAX_FILEIO_SIZE);
  36. +    if (!xdr_u_int32_t(xdr, &args->data_len))
  37. +        return FALSE;
  38. +
  39. +    return xdr_opaque(xdr, (char *)data, args->data_len);
  40.  }
  41.  
  42.  static bool_t xdr_write_verf(
  43. --
  44. 2.45.1
  45.  
  46. From 60da8ccf8a78092ec62ed18121aa8a54ed727024 Mon Sep 17 00:00:00 2001
  47. From: Roland Mainz <roland.mainz@nrubsig.org>
  48. Date: Mon, 27 Jan 2025 15:04:17 +0100
  49. Subject: [PATCH 2/2] daemon: Add NFSv4.2+RFC8726 OPs to
  50.  |nfs_opnum_to_string()|
  51.  
  52. Add NFSv4.2+RFC8726 OPs to |nfs_opnum_to_string()|
  53.  
  54. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  55. ---
  56. daemon/daemon_debug.c | 20 ++++++++++++++++++++
  57.  1 file changed, 20 insertions(+)
  58.  
  59. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  60. index 80ce999..50a915e 100644
  61. --- a/daemon/daemon_debug.c
  62. +++ b/daemon/daemon_debug.c
  63. @@ -531,6 +531,26 @@ const char* nfs_opnum_to_string(int opnum)
  64.          NFSOPNUM_TO_STRLITERAL(OP_WANT_DELEGATION)
  65.          NFSOPNUM_TO_STRLITERAL(OP_DESTROY_CLIENTID)
  66.          NFSOPNUM_TO_STRLITERAL(OP_RECLAIM_COMPLETE)
  67. +        /* new operations for NFSv4.2 */
  68. +        NFSOPNUM_TO_STRLITERAL(OP_ALLOCATE)
  69. +        NFSOPNUM_TO_STRLITERAL(OP_COPY)
  70. +        NFSOPNUM_TO_STRLITERAL(OP_COPY_NOTIFY)
  71. +        NFSOPNUM_TO_STRLITERAL(OP_DEALLOCATE)
  72. +        NFSOPNUM_TO_STRLITERAL(OP_IO_ADVISE)
  73. +        NFSOPNUM_TO_STRLITERAL(OP_LAYOUTERROR)
  74. +        NFSOPNUM_TO_STRLITERAL(OP_LAYOUTSTATS)
  75. +        NFSOPNUM_TO_STRLITERAL(OP_OFFLOAD_CANCEL)
  76. +        NFSOPNUM_TO_STRLITERAL(OP_OFFLOAD_STATUS)
  77. +        NFSOPNUM_TO_STRLITERAL(OP_READ_PLUS)
  78. +        NFSOPNUM_TO_STRLITERAL(OP_SEEK)
  79. +        NFSOPNUM_TO_STRLITERAL(OP_WRITE_SAME)
  80. +        NFSOPNUM_TO_STRLITERAL(OP_CLONE)
  81. +        /* xattr support (RFC8726) */
  82. +        NFSOPNUM_TO_STRLITERAL(OP_GETXATTR)
  83. +        NFSOPNUM_TO_STRLITERAL(OP_SETXATTR)
  84. +        NFSOPNUM_TO_STRLITERAL(OP_LISTXATTRS)
  85. +        NFSOPNUM_TO_STRLITERAL(OP_REMOVEXATTR)
  86. +
  87.          NFSOPNUM_TO_STRLITERAL(OP_ILLEGAL)
  88.      }
  89.      return "<invalid nfs opnum>";
  90. --
  91. 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