- From d9d671da70e122e05b5153799ba4c527eca1f0d8 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 12 Jan 2024 14:04:51 +0100
- Subject: [PATCH 1/3] daemon: Remove owner/owner_group |EASSERT()| for new
- files
- Remove owner/owner_group |EASSERT()| for new files in |copy_attrs()|,
- this is no longer needed.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/name_cache.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/daemon/name_cache.c b/daemon/name_cache.c
- index 656e8ab..3d059f3 100644
- --- a/daemon/name_cache.c
- +++ b/daemon/name_cache.c
- @@ -350,7 +350,7 @@ static void copy_attrs(
- dst->type = src->type;
- dst->numlinks = src->numlinks;
- dst->mode = src->mode;
- - EASSERT(src->owner[0] != '\0');
- +
- if (src->owner[0] != '\0') {
- dst->owner = dst->owner_buf;
- (void)strcpy(dst->owner, src->owner);
- @@ -359,7 +359,7 @@ static void copy_attrs(
- /* this should only happen for newly created files/dirs */
- dst->owner = NULL;
- }
- - EASSERT(src->owner_group[0] != '\0');
- +
- if (src->owner_group[0] != '\0') {
- dst->owner_group = dst->owner_group_buf;
- (void)strcpy(dst->owner_group, src->owner_group);
- --
- 2.43.0
- From d29da9df501827af700429a09528bf1677d5ac72 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 12 Jan 2024 16:46:04 +0100
- Subject: [PATCH 2/3] daemon: Increase |MAX_PUTFH_PER_COMPOUND| to |128|
- Increase the value of |MAX_PUTFH_PER_COMPOUND| from |16| to |128|
- for better performance.
- Notes:
- - the real value is negotiated between NFSv4.1 server and
- client, |MAX_PUTFH_PER_COMPOUND| is the maximum value we support on
- our side.
- - Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
- linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
- |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
- and nfs4j JAVA NFSv4 server uses |8192|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/name_cache.c | 17 ++++++++++++++++-
- daemon/nfs41.h | 10 +++++++---
- 2 files changed, 23 insertions(+), 4 deletions(-)
- diff --git a/daemon/name_cache.c b/daemon/name_cache.c
- index 3d059f3..23549b3 100644
- --- a/daemon/name_cache.c
- +++ b/daemon/name_cache.c
- @@ -1259,7 +1259,22 @@ out_unlock:
- /* nfs41_name_cache_resolve_fh() */
- -#define MAX_PUTFH_PER_COMPOUND 16
- +/*
- + * MAX_PUTFH_PER_COMPOUND
- + *
- + * The maximum is negotiated with with the NFSv4 server (follow
- + * |max_putfh_components()| below and |NFS41_MAX_OPS_PER_COMPOUND|
- + * in daemon/nfs41.h).
- + *
- + * Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
- + * linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
- + * |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
- + * and nfs4j JAVA NFSv4 server uses |8192|.
- + *
- + * Since bigger values eat more stack we set this to
- + * |128| for now.
- + */
- +#define MAX_PUTFH_PER_COMPOUND 128
- static bool_t get_path_fhs(
- IN struct nfs41_name_cache *cache,
- diff --git a/daemon/nfs41.h b/daemon/nfs41.h
- index 86fded0..02414f9 100644
- --- a/daemon/nfs41.h
- +++ b/daemon/nfs41.h
- @@ -235,9 +235,13 @@ typedef struct __nfs41_slot_table {
- * trouble with |signed int| vs. |unisgned int|, and NFSv4.x
- * server implementations might want to allocate static buffers
- * based on what we return.
- - * Linux uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
- - * linux-6.7/fs/nfsd/nfsd.h and Solaris uses a much higher value
- - * (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0).
- + *
- + * Linux nfsd uses |#define NFSD_MAX_OPS_PER_COMPOUND 50| in
- + * linux-6.7/fs/nfsd/nfsd.h, Solaris/Illumos nfsd uses up to
- + * |2048| (see also https://bugzilla.kernel.org/show_bug.cgi?id=216383#c0)
- + * and nfs4j JAVA NFSv4 server uses |8192|.
- + *
- + * See also |MAX_PUTFH_PER_COMPOUND| in daemon/name_cache.c
- */
- #define NFS41_MAX_OPS_PER_COMPOUND 16384
- typedef struct __nfs41_channel_attrs {
- --
- 2.43.0
- From 00d25e8e9f5905c0ce2228211d5bbe3c79682243 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 12 Jan 2024 17:01:48 +0100
- Subject: [PATCH 3/3] daemon: Disable "ASSERTION 'length > 0'" for UNMOUNT
- Disable 'length > 0' |EASSERT()| for UNMOUNT, as this upcall
- has no payload.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/upcall.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
- diff --git a/daemon/upcall.c b/daemon/upcall.c
- index 7fa98ef..ebc16c4 100644
- --- a/daemon/upcall.c
- +++ b/daemon/upcall.c
- @@ -25,6 +25,7 @@
- #include "nfs41_build_features.h"
- #include "upcall.h"
- +#include "nfs41_driver.h" /* only for |NFS41_UNMOUNT| */
- #include "daemon_debug.h"
- #include "util.h"
- @@ -122,7 +123,10 @@ int upcall_parse(
- /* parse the operation's arguments */
- op = g_upcall_op_table[upcall->opcode];
- if (op && op->parse) {
- - EASSERT(length > 0);
- + /* |NFS41_UNMOUNT| has 0 payload */
- + if (upcall->opcode != NFS41_UNMOUNT) {
- + EASSERT(length > 0);
- + }
- status = op->parse(buffer, length, upcall);
- if (status) {
- eprintf("parsing of upcall '%s' failed with %d.\n",
- --
- 2.43.0
prototype patches 2024-01-12 backup
Posted by Anonymous on Fri 12th Jan 2024 16:05
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.