- From 634823c5baed103d7f0893e0267c647f9152dff7 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 11 Oct 2025 15:21:18 +0200
- Subject: [PATCH 1/6] daemon: Move creation/closing of nfs41sys device
- pipelines into helper function
- Move creation/closing of nfs41sys device pipelines into helper function.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/delegation.c | 10 +++++-----
- daemon/nfs41_daemon.c | 34 +++++++++++++++++++---------------
- daemon/util.c | 26 +++++++++++++++++++-------
- daemon/util.h | 3 +++
- 4 files changed, 46 insertions(+), 27 deletions(-)
- diff --git a/daemon/delegation.c b/daemon/delegation.c
- index c6e7898..7585b62 100644
- --- a/daemon/delegation.c
- +++ b/daemon/delegation.c
- @@ -283,11 +283,11 @@ static int delegation_return(
- DPRINTF(1,
- ("delegation_return: making a downcall for srv_open=0x%p\n",
- deleg->srv_open));
- - pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A, GENERIC_READ|GENERIC_WRITE,
- - FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- + pipe = create_nfs41sys_device_pipe();
- if (pipe == INVALID_HANDLE_VALUE) {
- - eprintf("delegation_return: Unable to open downcall pipe %d\n",
- - GetLastError());
- + eprintf("delegation_return: "
- + "Unable to open downcall pipe, lasterr=%d\n",
- + (int)GetLastError());
- goto out_downcall;
- }
- length = inbuf_len;
- @@ -297,7 +297,7 @@ static int delegation_return(
- NULL, 0, (LPDWORD)&outbuf_len, NULL);
- if (!dstatus)
- eprintf("IOCTL_NFS41_INVALCACHE failed %d\n", GetLastError());
- - CloseHandle(pipe);
- + close_nfs41sys_device_pipe(pipe);
- }
- out_downcall:
- diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c
- index ff528c4..38d6d02 100644
- --- a/daemon/nfs41_daemon.c
- +++ b/daemon/nfs41_daemon.c
- @@ -36,7 +36,7 @@
- #include <sdkddkver.h>
- #include "nfs41_build_features.h"
- -#include "nfs41_driver.h" /* for NFS41_USER_DEVICE_NAME_A */
- +#include "nfs41_driver.h" /* for |IOCTL_NFS41_*| */
- #include "nfs41_np.h" /* for NFS41NP_SHARED_MEMORY */
- #include "nfs41_daemon.h"
- @@ -173,13 +173,11 @@ static unsigned int nfsd_worker_thread_main(void *args)
- eprintf("Failed set THREAD_PRIORITY_TIME_CRITICAL\n");
- }
- - pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A, GENERIC_READ | GENERIC_WRITE,
- - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
- - 0, NULL);
- - if (pipe == INVALID_HANDLE_VALUE)
- - {
- + pipe = create_nfs41sys_device_pipe();
- + if (pipe == INVALID_HANDLE_VALUE) {
- DWORD lasterr = GetLastError();
- - eprintf("Unable to open upcall pipe %d\n", (int)lasterr);
- + eprintf("nfsd_worker_thread_main: Unable to open upcall pipe %d\n",
- + (int)lasterr);
- return lasterr;
- }
- @@ -267,7 +265,8 @@ write_downcall:
- if (upcall.status != NFSD_VERSION_MISMATCH)
- upcall_cleanup(&upcall);
- }
- - CloseHandle(pipe);
- +
- + close_nfs41sys_device_pipe(pipe);
- return GetLastError();
- }
- @@ -890,12 +889,16 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv)
- NFS41D_VERSION = GetTickCount();
- DPRINTF(1, ("NFS41 Daemon starting: version %d\n", NFS41D_VERSION));
- - pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A, GENERIC_READ | GENERIC_WRITE,
- - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
- - 0, NULL);
- - if (pipe == INVALID_HANDLE_VALUE)
- - {
- - eprintf("Unable to open upcall pipe %d\n", GetLastError());
- + pipe = create_nfs41sys_device_pipe();
- + if (pipe == INVALID_HANDLE_VALUE) {
- + eprintf(
- +#ifdef STANDALONE_NFSD
- + "wmain: "
- +#else
- + "ServiceStart: "
- +#endif /* STANDALONE_NFSD */
- + "Unable to open upcall pipe %d\n",
- + (int)GetLastError());
- goto out_idmap;
- }
- @@ -957,7 +960,8 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv)
- DPRINTF(1, ("Parent woke up!!!!\n"));
- out_pipe:
- - CloseHandle(pipe);
- + close_nfs41sys_device_pipe(pipe);
- +
- out_idmap:
- if (nfs41_dg.idmapper)
- nfs41_idmap_free(nfs41_dg.idmapper);
- diff --git a/daemon/util.c b/daemon/util.c
- index 1c284d9..3d36780 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -800,14 +800,9 @@ int parse_fs_location_server_address(IN const char *restrict inaddr,
- return ERROR_BAD_NET_NAME;
- }
- -int delayxid(LONGLONG xid, LONGLONG moredelaysecs)
- +HANDLE create_nfs41sys_device_pipe(void)
- {
- - int status;
- HANDLE pipe;
- - unsigned char inbuf[sizeof(LONGLONG)*2], *buffer = inbuf;
- - DWORD inbuf_len = sizeof(LONGLONG)*2, outbuf_len, dstatus;
- - uint32_t length;
- -
- pipe = CreateFileA(NFS41_USER_DEVICE_NAME_A,
- GENERIC_READ|GENERIC_WRITE,
- FILE_SHARE_READ|FILE_SHARE_WRITE,
- @@ -815,6 +810,23 @@ int delayxid(LONGLONG xid, LONGLONG moredelaysecs)
- OPEN_EXISTING,
- 0,
- NULL);
- + return pipe;
- +}
- +
- +void close_nfs41sys_device_pipe(HANDLE pipe)
- +{
- + (void)CloseHandle(pipe);
- +}
- +
- +int delayxid(LONGLONG xid, LONGLONG moredelaysecs)
- +{
- + int status;
- + HANDLE pipe;
- + unsigned char inbuf[sizeof(LONGLONG)*2], *buffer = inbuf;
- + DWORD inbuf_len = sizeof(LONGLONG)*2, outbuf_len, dstatus;
- + uint32_t length;
- +
- + pipe = create_nfs41sys_device_pipe();
- if (pipe == INVALID_HANDLE_VALUE) {
- status = GetLastError();
- eprintf("delayxid: Unable to open downcall pipe. lasterr=%d\n",
- @@ -837,7 +849,7 @@ int delayxid(LONGLONG xid, LONGLONG moredelaysecs)
- eprintf("delayxid: IOCTL_NFS41_INVALCACHE failed, lasterr=%d\n",
- status);
- }
- - (void)CloseHandle(pipe);
- + close_nfs41sys_device_pipe(pipe);
- return status;
- }
- diff --git a/daemon/util.h b/daemon/util.h
- index bb3fbaa..ab62721 100644
- --- a/daemon/util.h
- +++ b/daemon/util.h
- @@ -439,6 +439,9 @@ int parse_fs_location_server_address(IN const char *restrict inaddr,
- OUT char *restrict addr,
- OUT unsigned short *restrict port);
- +HANDLE create_nfs41sys_device_pipe(void);
- +void close_nfs41sys_device_pipe(HANDLE pipe);
- +
- int delayxid(LONGLONG xid, LONGLONG moredelaysecs);
- #endif /* !__NFS41_DAEMON_UTIL_H__ */
- --
- 2.51.0
- From 372adf6bac81a004bf8c166fadbc90a89d2693a6 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 11 Oct 2025 15:58:16 +0200
- Subject: [PATCH 2/6] tests: nfsbuildtest: Use git fsck for better filesystem
- test coverage
- Use git fsck for better filesystem test coverage.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/nfsbuildtest/nfsbuildtest.ksh93 | 17 ++++++++++++++++-
- 1 file changed, 16 insertions(+), 1 deletion(-)
- diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
- index 322c685..2103fa3 100644
- --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
- +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
- @@ -161,6 +161,12 @@ function gcc_build
- cd "$PWD/gcc/"
- + # make sure git commands (like git "describe", "fsck", ...) work
- + git config --global --add safe.directory "$PWD"
- +
- + # use git fsck as filesystem test
- + time git fsck
- +
- if $config_use_posix_ksh93_builtins ; then
- PATH="/usr/ast/bin:/opt/ast/bin:$PATH"
- fi
- @@ -338,6 +344,12 @@ function bash_build
- cd "$PWD/bash/"
- + # make sure git commands (like git "describe", "fsck", ...) work
- + git config --global --add safe.directory "$PWD"
- +
- + # use git fsck as filesystem test
- + time git fsck
- +
- if $config_use_posix_ksh93_builtins ; then
- PATH="/usr/ast/bin:/opt/ast/bin:$PATH"
- fi
- @@ -507,9 +519,12 @@ function msnfs41client_build
- cd "$PWD/ms-nfs41-client/"
- - # make sure git commands (like "git describe ...") work
- + # make sure git commands (like git "describe", "fsck", ...) work
- git config --global --add safe.directory "$PWD"
- + # use git fsck as filesystem test
- + time git fsck
- +
- #
- # patch sources and configure build
- #
- --
- 2.51.0
- From d3291b7781da2bd7f5d89dbe53289efee6709f87 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 11 Oct 2025 15:59:33 +0200
- Subject: [PATCH 3/6] daemon: Use |restrict|+|const| for |marshall_*|-functions
- Use |restrict|+|const| for |marshall_*|-functions.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 15 ++++++++++-----
- daemon/ea.c | 14 ++++++++++----
- daemon/fsctl.c | 25 ++++++++++++++++---------
- daemon/getattr.c | 7 +++++--
- daemon/mount.c | 7 +++++--
- daemon/open.c | 7 +++++--
- daemon/readdir.c | 7 +++++--
- daemon/readwrite.c | 7 +++++--
- daemon/setattr.c | 7 +++++--
- daemon/symlink.c | 8 +++++---
- daemon/upcall.h | 4 +++-
- daemon/volume.c | 7 +++++--
- 12 files changed, 79 insertions(+), 36 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index d2baf96..9a7f812 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -498,11 +498,13 @@ out:
- return status;
- }
- -static int marshall_getacl(unsigned char *buffer, uint32_t *length,
- - nfs41_upcall *upcall)
- +static int marshall_getacl(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status = ERROR_NOT_SUPPORTED;
- - getacl_upcall_args *args = &upcall->args.getacl;
- + const getacl_upcall_args *args = &upcall->args.getacl;
- status = safe_write(&buffer, length, &args->sec_desc_len, sizeof(DWORD));
- if (status) goto out;
- @@ -1557,9 +1559,12 @@ out:
- return status;
- }
- -static int marshall_setacl(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_setacl(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - setacl_upcall_args *args = &upcall->args.setacl;
- + const setacl_upcall_args *args = &upcall->args.setacl;
- return safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
- }
- diff --git a/daemon/ea.c b/daemon/ea.c
- index 5acf81b..fa52f7e 100644
- --- a/daemon/ea.c
- +++ b/daemon/ea.c
- @@ -259,9 +259,12 @@ out:
- return nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
- }
- -static int marshall_setexattr(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_setexattr(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - setexattr_upcall_args *args = &upcall->args.setexattr;
- + const setexattr_upcall_args *args = &upcall->args.setexattr;
- return safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
- }
- @@ -786,10 +789,13 @@ out_free:
- goto out;
- }
- -static int marshall_getexattr(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_getexattr(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status = NO_ERROR;
- - getexattr_upcall_args *args = &upcall->args.getexattr;
- + const getexattr_upcall_args *args = &upcall->args.getexattr;
- status = safe_write(&buffer, length, &args->overflow, sizeof(args->overflow));
- if (status) goto out;
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 096d207..44f2f57 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -300,11 +300,14 @@ int handle_queryallocatedranges(void *daemon_context,
- return status;
- }
- -static int marshall_queryallocatedranges(unsigned char *buffer,
- - uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_queryallocatedranges(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status;
- - queryallocatedranges_upcall_args *args = &upcall->args.queryallocatedranges;
- + const queryallocatedranges_upcall_args *args =
- + &upcall->args.queryallocatedranges;
- status = safe_write(&buffer, length, &args->buffer_overflow, sizeof(args->buffer_overflow));
- if (status) goto out;
- @@ -426,10 +429,12 @@ out:
- return status;
- }
- -static int marshall_setzerodata(unsigned char *buffer,
- - uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_setzerodata(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - setzerodata_upcall_args *args = &upcall->args.setzerodata;
- + const setzerodata_upcall_args *args = &upcall->args.setzerodata;
- int status;
- status = safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
- return status;
- @@ -902,10 +907,12 @@ out:
- return status;
- }
- -static int marshall_duplicatedata(unsigned char *buffer,
- - uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_duplicatedata(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - setzerodata_upcall_args *args = &upcall->args.setzerodata;
- + const setzerodata_upcall_args *args = &upcall->args.setzerodata;
- int status;
- status = safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
- return status;
- diff --git a/daemon/getattr.c b/daemon/getattr.c
- index bc6709f..4744285 100644
- --- a/daemon/getattr.c
- +++ b/daemon/getattr.c
- @@ -216,10 +216,13 @@ out:
- return status;
- }
- -static int marshall_getattr(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_getattr(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status;
- - getattr_upcall_args *args = &upcall->args.getattr;
- + const getattr_upcall_args *args = &upcall->args.getattr;
- uint32_t info_len;
- switch (args->query_class) {
- diff --git a/daemon/mount.c b/daemon/mount.c
- index 88c3067..81f1b30 100644
- --- a/daemon/mount.c
- +++ b/daemon/mount.c
- @@ -316,9 +316,12 @@ out_err:
- goto out;
- }
- -static int marshall_mount(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_mount(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - mount_upcall_args *args = &upcall->args.mount;
- + const mount_upcall_args *args = &upcall->args.mount;
- int status;
- DPRINTF(2, ("NFS41_SYSOP_MOUNT: writing pointer to nfs41_root 0x%p, version %d, "
- "lease_time %d\n", upcall->root_ref, NFS41D_VERSION, args->lease_time));
- diff --git a/daemon/open.c b/daemon/open.c
- index 1d5f30d..2454138 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -1232,10 +1232,13 @@ out_free_state:
- goto out;
- }
- -static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_open(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status;
- - open_upcall_args *args = &upcall->args.open;
- + const open_upcall_args *args = &upcall->args.open;
- status = safe_write(&buffer, length, &args->basic_info, sizeof(args->basic_info));
- if (status) goto out;
- diff --git a/daemon/readdir.c b/daemon/readdir.c
- index c7f0d18..82f4800 100644
- --- a/daemon/readdir.c
- +++ b/daemon/readdir.c
- @@ -958,10 +958,13 @@ out_free_cookie:
- goto out_free_entry;
- }
- -static int marshall_readdir(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_readdir(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status;
- - readdir_upcall_args *args = &upcall->args.readdir;
- + const readdir_upcall_args *args = &upcall->args.readdir;
- status = safe_write(&buffer, length, &args->query_reply_len, sizeof(args->query_reply_len));
- return status;
- diff --git a/daemon/readwrite.c b/daemon/readwrite.c
- index 4dd610f..7f5ce32 100644
- --- a/daemon/readwrite.c
- +++ b/daemon/readwrite.c
- @@ -399,9 +399,12 @@ out:
- return status;
- }
- -static int marshall_rw(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_rw(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - readwrite_upcall_args *args = &upcall->args.rw;
- + const readwrite_upcall_args *args = &upcall->args.rw;
- int status;
- status = safe_write(&buffer, length, &args->out_len, sizeof(args->out_len));
- if (status) goto out;
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index 8705161..90b177a 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -717,9 +717,12 @@ static int handle_setattr(void *daemon_context, nfs41_upcall *upcall)
- return status;
- }
- -static int marshall_setattr(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_setattr(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - setattr_upcall_args *args = &upcall->args.setattr;
- + const setattr_upcall_args *args = &upcall->args.setattr;
- return safe_write(&buffer, length, &args->ctime, sizeof(args->ctime));
- }
- diff --git a/daemon/symlink.c b/daemon/symlink.c
- index 49c3271..d1a746b 100644
- --- a/daemon/symlink.c
- +++ b/daemon/symlink.c
- @@ -287,10 +287,12 @@ out:
- return status;
- }
- -static int marshall_symlink_get(unsigned char *buffer, uint32_t *length,
- - nfs41_upcall *upcall)
- +static int marshall_symlink_get(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- - symlink_upcall_args *args = &upcall->args.symlink;
- + const symlink_upcall_args *args = &upcall->args.symlink;
- unsigned short len = (args->target_get.len + 1) * sizeof(WCHAR);
- int status = NO_ERROR;
- int wc_len;
- diff --git a/daemon/upcall.h b/daemon/upcall.h
- index 43016e5..f0c2016 100644
- --- a/daemon/upcall.h
- +++ b/daemon/upcall.h
- @@ -287,7 +287,9 @@ typedef int (*upcall_parse_proc)(
- uint32_t length,
- nfs41_upcall *upcall);
- typedef int (*upcall_handle_proc)(void*, nfs41_upcall*);
- -typedef int (*upcall_marshall_proc)(unsigned char*, uint32_t*, nfs41_upcall*);
- +typedef int (*upcall_marshall_proc)(unsigned char* restrict,
- + uint32_t*restrict,
- + nfs41_upcall* restrict);
- typedef void (*upcall_cancel_proc)(nfs41_upcall*);
- typedef void (*upcall_cleanup_proc)(nfs41_upcall*);
- diff --git a/daemon/volume.c b/daemon/volume.c
- index 8a6ef44..4417b37 100644
- --- a/daemon/volume.c
- +++ b/daemon/volume.c
- @@ -230,10 +230,13 @@ static int handle_volume(void *daemon_context, nfs41_upcall *upcall)
- return status;
- }
- -static int marshall_volume(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
- +static int marshall_volume(
- + unsigned char *restrict buffer,
- + uint32_t *restrict length,
- + nfs41_upcall *restrict upcall)
- {
- int status;
- - volume_upcall_args *args = &upcall->args.volume;
- + const volume_upcall_args *args = &upcall->args.volume;
- status = safe_write(&buffer, length, &args->len, sizeof(args->len));
- if (status) goto out;
- --
- 2.51.0
- From 423da89c7b4f5b0d3f09091a7572bc86db29a36e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sat, 11 Oct 2025 16:06:38 +0200
- Subject: [PATCH 4/6] daemon: Fix clang "assigned but not used" warnings in
- |marshall_*()|-functions
- Fix clang "assigned but not used" warnings in |marshall_*()|-functions.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 2 +-
- daemon/ea.c | 2 +-
- daemon/symlink.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 9a7f812..7a3cbb6 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -503,7 +503,7 @@ static int marshall_getacl(
- uint32_t *restrict length,
- nfs41_upcall *restrict upcall)
- {
- - int status = ERROR_NOT_SUPPORTED;
- + int status;
- const getacl_upcall_args *args = &upcall->args.getacl;
- status = safe_write(&buffer, length, &args->sec_desc_len, sizeof(DWORD));
- diff --git a/daemon/ea.c b/daemon/ea.c
- index fa52f7e..be5ecac 100644
- --- a/daemon/ea.c
- +++ b/daemon/ea.c
- @@ -794,7 +794,7 @@ static int marshall_getexattr(
- uint32_t *restrict length,
- nfs41_upcall *restrict upcall)
- {
- - int status = NO_ERROR;
- + int status;
- const getexattr_upcall_args *args = &upcall->args.getexattr;
- status = safe_write(&buffer, length, &args->overflow, sizeof(args->overflow));
- diff --git a/daemon/symlink.c b/daemon/symlink.c
- index d1a746b..d03c738 100644
- --- a/daemon/symlink.c
- +++ b/daemon/symlink.c
- @@ -294,7 +294,7 @@ static int marshall_symlink_get(
- {
- const symlink_upcall_args *args = &upcall->args.symlink;
- unsigned short len = (args->target_get.len + 1) * sizeof(WCHAR);
- - int status = NO_ERROR;
- + int status;
- int wc_len;
- unsigned short *wc_len_out;
- --
- 2.51.0
- From a2dcaf2d2b98985462018f3e02aa4fb889a353ab Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Sat, 11 Oct 2025 21:47:55 +0200
- Subject: [PATCH 5/6] sys: Split unmarshal_nfs41_symlink() into
- unmarshal_nfs41_get_symlink()+unmarshal_nfs41_set_symlink()
- Split unmarshal_nfs41_symlink() into unmarshal_nfs41_get_symlink() +
- unmarshal_nfs41_set_symlink().
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_driver.h | 5 ++++-
- sys/nfs41sys_symlink.c | 12 ++++++++----
- sys/nfs41sys_updowncall.c | 4 +++-
- 3 files changed, 15 insertions(+), 6 deletions(-)
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index 92c21cc..8061528 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -842,7 +842,10 @@ NTSTATUS marshal_nfs41_symlink(
- unsigned char *buf,
- ULONG buf_len,
- ULONG *len);
- -void unmarshal_nfs41_symlink(
- +void unmarshal_nfs41_get_symlink(
- + nfs41_updowncall_entry *cur,
- + const unsigned char *restrict *restrict buf);
- +void unmarshal_nfs41_set_symlink(
- nfs41_updowncall_entry *cur,
- const unsigned char *restrict *restrict buf);
- NTSTATUS nfs41_SetSymlinkReparsePoint(
- diff --git a/sys/nfs41sys_symlink.c b/sys/nfs41sys_symlink.c
- index c669565..2e85f48 100644
- --- a/sys/nfs41sys_symlink.c
- +++ b/sys/nfs41sys_symlink.c
- @@ -119,13 +119,10 @@ out:
- return status;
- }
- -void unmarshal_nfs41_symlink(
- +void unmarshal_nfs41_get_symlink(
- nfs41_updowncall_entry *cur,
- const unsigned char *restrict *restrict buf)
- {
- - if (cur->opcode == NFS41_SYSOP_SYMLINK_SET)
- - return;
- -
- RtlCopyMemory(&cur->u.Symlink.target->Length, *buf, sizeof(USHORT));
- *buf += sizeof(USHORT);
- if (cur->u.Symlink.target->Length >
- @@ -138,6 +135,13 @@ void unmarshal_nfs41_symlink(
- *buf += cur->u.Symlink.target->Length;
- }
- +void unmarshal_nfs41_set_symlink(
- + nfs41_updowncall_entry *cur,
- + const unsigned char *restrict *restrict buf)
- +{
- + /* empty */
- +}
- +
- NTSTATUS map_symlink_errors(
- NTSTATUS status)
- {
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index 6d4c6c9..9f246f6 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -745,8 +745,10 @@ NTSTATUS nfs41_downcall(
- unmarshal_nfs41_eaget(cur, &inbuf);
- break;
- case NFS41_SYSOP_SYMLINK_GET:
- + unmarshal_nfs41_get_symlink(cur, &inbuf);
- + break;
- case NFS41_SYSOP_SYMLINK_SET:
- - unmarshal_nfs41_symlink(cur, &inbuf);
- + unmarshal_nfs41_set_symlink(cur, &inbuf);
- break;
- case NFS41_SYSOP_VOLUME_QUERY:
- unmarshal_nfs41_volume(cur, &inbuf);
- --
- 2.51.0
- From 3bf8514cbf4118a78e5874bc1f08367aaf426844 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Sun, 12 Oct 2025 00:31:41 +0200
- Subject: [PATCH 6/6] sys: Shorten upcall/downcall header debug message+include
- async_op boolean
- Shorten upcall/downcall header debug message+include async_op boolean
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_driver.c | 13 +++++++++----
- sys/nfs41sys_updowncall.c | 4 ++--
- 2 files changed, 11 insertions(+), 6 deletions(-)
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index e9e4486..38cc8e3 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -255,10 +255,15 @@ NTSTATUS marshal_nfs41_header(
- tmp += sizeof(HANDLE);
- #ifdef DEBUG_MARSHAL_HEADER
- - DbgP("[upcall header] xid=%lld opcode='%s' filename='%wZ' version=%d "
- - "session=0x%p open_state=0x%x\n", entry->xid,
- - ENTRY_OPCODE2STRING(entry), entry->filename,
- - entry->version, entry->session, entry->open_state);
- + DbgP("[upcall hdr] xid=%lld op='%s'%s filename='%wZ' vers=%d "
- + "sess=0x%p open_state=0x%x\n",
- + entry->xid,
- + opcode2string(entry->opcode),
- + (entry->async_op?"(async)":""),
- + entry->filename,
- + (int)entry->version,
- + entry->session,
- + entry->open_state);
- #endif /* DEBUG_MARSHAL_HEADER */
- out:
- return status;
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index 9f246f6..f491a29 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -154,8 +154,8 @@ static void unmarshal_nfs41_header(
- RtlCopyMemory(&tmp->errno, *buf, sizeof(tmp->errno));
- *buf += sizeof(tmp->errno);
- #ifdef DEBUG_MARSHAL_HEADER
- - DbgP("[downcall header] "
- - "xid=%lld opcode='%s' status=0x%lx errno=%d\n",
- + DbgP("[downcall hdr] "
- + "xid=%lld op='%s' status=0x%lx errno=%d\n",
- tmp->xid,
- opcode2string(tmp->opcode),
- (long)tmp->status,
- --
- 2.51.0
msnfs41client: Patches for moving device open into util function, cleanup, asyncop status in sysdebug+misc, 2025-10-12
Posted by Anonymous on Sat 11th Oct 2025 23:44
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.
rovema.kpaste.net RSS