pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


prototype patches 2024-01-12 backup
Posted by Anonymous on Fri 12th Jan 2024 16:05
raw | new post

  1. From d9d671da70e122e05b5153799ba4c527eca1f0d8 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Fri, 12 Jan 2024 14:04:51 +0100
  4. Subject: [PATCH 1/3] daemon: Remove owner/owner_group |EASSERT()| for new
  5.  files
  6.  
  7. Remove owner/owner_group |EASSERT()| for new files in |copy_attrs()|,
  8. this is no longer needed.
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. daemon/name_cache.c | 4 ++--
  13.  1 file changed, 2 insertions(+), 2 deletions(-)
  14.  
  15. diff --git a/daemon/name_cache.c b/daemon/name_cache.c
  16. index 656e8ab..3d059f3 100644
  17. --- a/daemon/name_cache.c
  18. +++ b/daemon/name_cache.c
  19. @@ -350,7 +350,7 @@ static void copy_attrs(
  20.      dst->type = src->type;
  21.      dst->numlinks = src->numlinks;
  22.      dst->mode = src->mode;
  23. -    EASSERT(src->owner[0] != '\0');
  24. +
  25.      if (src->owner[0] != '\0') {
  26.          dst->owner = dst->owner_buf;
  27.          (void)strcpy(dst->owner, src->owner);
  28. @@ -359,7 +359,7 @@ static void copy_attrs(
  29.          /* this should only happen for newly created files/dirs */
  30.          dst->owner = NULL;
  31.      }
  32. -    EASSERT(src->owner_group[0] != '\0');
  33. +
  34.      if (src->owner_group[0] != '\0') {
  35.          dst->owner_group = dst->owner_group_buf;
  36.          (void)strcpy(dst->owner_group, src->owner_group);
  37. --
  38. 2.43.0
  39.  
  40. From d29da9df501827af700429a09528bf1677d5ac72 Mon Sep 17 00:00:00 2001
  41. From: Roland Mainz <roland.mainz@nrubsig.org>
  42. Date: Fri, 12 Jan 2024 16:46:04 +0100
  43. Subject: [PATCH 2/3] daemon: Increase |MAX_PUTFH_PER_COMPOUND| to |128|
  44.  
  45. Increase the value of |MAX_PUTFH_PER_COMPOUND| from |16| to |128|
  46. for better performance.
  47.  
  48. Notes:
  49. - the real value is negotiated between NFSv4.1 server and
  50. client, |MAX_PUTFH_PER_COMPOUND| is the maximum value we support on
  51. our side.
  52.  
  53. - Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
  54. linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
  55. |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
  56. and nfs4j JAVA NFSv4 server uses |8192|.
  57.  
  58. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  59. ---
  60. daemon/name_cache.c | 17 ++++++++++++++++-
  61.  daemon/nfs41.h      | 10 +++++++---
  62.  2 files changed, 23 insertions(+), 4 deletions(-)
  63.  
  64. diff --git a/daemon/name_cache.c b/daemon/name_cache.c
  65. index 3d059f3..23549b3 100644
  66. --- a/daemon/name_cache.c
  67. +++ b/daemon/name_cache.c
  68. @@ -1259,7 +1259,22 @@ out_unlock:
  69.  
  70.  /* nfs41_name_cache_resolve_fh() */
  71.  
  72. -#define MAX_PUTFH_PER_COMPOUND 16
  73. +/*
  74. + * MAX_PUTFH_PER_COMPOUND
  75. + *
  76. + * The maximum is negotiated with with the NFSv4 server (follow
  77. + * |max_putfh_components()| below and |NFS41_MAX_OPS_PER_COMPOUND|
  78. + * in daemon/nfs41.h).
  79. + *
  80. + * Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
  81. + * linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
  82. + * |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
  83. + * and nfs4j JAVA NFSv4 server uses |8192|.
  84. + *
  85. + * Since bigger values eat more stack we set this to
  86. + * |128| for now.
  87. + */
  88. +#define MAX_PUTFH_PER_COMPOUND 128
  89.  
  90.  static bool_t get_path_fhs(
  91.      IN struct nfs41_name_cache *cache,
  92. diff --git a/daemon/nfs41.h b/daemon/nfs41.h
  93. index 86fded0..02414f9 100644
  94. --- a/daemon/nfs41.h
  95. +++ b/daemon/nfs41.h
  96. @@ -235,9 +235,13 @@ typedef struct __nfs41_slot_table {
  97.   * trouble with |signed int| vs. |unisgned int|, and NFSv4.x
  98.   * server implementations might want to allocate static buffers
  99.   * based on what we return.
  100. - * Linux uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
  101. - * linux-6.7/fs/nfsd/nfsd.h and Solaris uses a much higher value
  102. - * (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0).
  103. + *
  104. + * Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
  105. + * linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
  106. + * |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
  107. + * and nfs4j JAVA NFSv4 server uses |8192|.
  108. + *
  109. + * See also |MAX_PUTFH_PER_COMPOUND| in daemon/name_cache.c
  110.   */
  111.  #define NFS41_MAX_OPS_PER_COMPOUND 16384
  112.  typedef struct __nfs41_channel_attrs {
  113. --
  114. 2.43.0
  115.  
  116. From 00d25e8e9f5905c0ce2228211d5bbe3c79682243 Mon Sep 17 00:00:00 2001
  117. From: Roland Mainz <roland.mainz@nrubsig.org>
  118. Date: Fri, 12 Jan 2024 17:01:48 +0100
  119. Subject: [PATCH 3/3] daemon: Disable "ASSERTION 'length > 0'" for UNMOUNT
  120.  
  121. Disable 'length > 0' |EASSERT()| for UNMOUNT, as this upcall
  122. has no payload.
  123.  
  124. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  125. ---
  126. daemon/upcall.c | 6 +++++-
  127.  1 file changed, 5 insertions(+), 1 deletion(-)
  128.  
  129. diff --git a/daemon/upcall.c b/daemon/upcall.c
  130. index 7fa98ef..ebc16c4 100644
  131. --- a/daemon/upcall.c
  132. +++ b/daemon/upcall.c
  133. @@ -25,6 +25,7 @@
  134.  
  135.  #include "nfs41_build_features.h"
  136.  #include "upcall.h"
  137. +#include "nfs41_driver.h" /* only for |NFS41_UNMOUNT| */
  138.  #include "daemon_debug.h"
  139.  #include "util.h"
  140.  
  141. @@ -122,7 +123,10 @@ int upcall_parse(
  142.      /* parse the operation's arguments */
  143.      op = g_upcall_op_table[upcall->opcode];
  144.      if (op && op->parse) {
  145. -        EASSERT(length > 0);
  146. +        /* |NFS41_UNMOUNT| has 0 payload */
  147. +        if (upcall->opcode != NFS41_UNMOUNT) {
  148. +            EASSERT(length > 0);
  149. +        }
  150.          status = op->parse(buffer, length, upcall);
  151.          if (status) {
  152.              eprintf("parsing of upcall '%s' failed with %d.\n",
  153. --
  154. 2.43.0

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