- From 2b84712f9a208d3c468e0dc168507fa86a872a90 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 22 Jul 2025 11:12:49 +0200
- Subject: [PATCH 1/5] sys: Add |unmarshal_nfs41_volume()| for consistency with
- other updowncalls
- Cleanup: Add |unmarshal_nfs41_volume()| for consistency with other
- updowncalls.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_driver.h | 3 +++
- sys/nfs41sys_updowncall.c | 2 +-
- sys/nfs41sys_volinfo.c | 7 +++++++
- 3 files changed, 11 insertions(+), 1 deletion(-)
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index a5cb6cd..c6b6c0d 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -877,6 +877,9 @@ NTSTATUS marshal_nfs41_volume(
- unsigned char *buf,
- ULONG buf_len,
- ULONG *len);
- +void unmarshal_nfs41_volume(
- + nfs41_updowncall_entry *cur,
- + unsigned char **buf);
- NTSTATUS nfs41_QueryVolumeInformation(
- IN OUT PRX_CONTEXT RxContext);
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index 7e113be..c623dea 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -755,7 +755,7 @@ NTSTATUS nfs41_downcall(
- unmarshal_nfs41_symlink(cur, &buf);
- break;
- case NFS41_SYSOP_VOLUME_QUERY:
- - unmarshal_nfs41_attrget(cur, cur->buf, &cur->buf_len, &buf, TRUE);
- + unmarshal_nfs41_volume(cur, &buf);
- break;
- case NFS41_SYSOP_ACL_QUERY:
- status = unmarshal_nfs41_getacl(cur, &buf);
- diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
- index 182efcc..2028d4a 100644
- --- a/sys/nfs41sys_volinfo.c
- +++ b/sys/nfs41sys_volinfo.c
- @@ -99,6 +99,13 @@ out:
- return status;
- }
- +void unmarshal_nfs41_volume(
- + nfs41_updowncall_entry *cur,
- + unsigned char **buf)
- +{
- + unmarshal_nfs41_attrget(cur, cur->buf, &cur->buf_len, buf, TRUE);
- +}
- +
- static void print_queryvolume_args(
- PRX_CONTEXT RxContext)
- {
- --
- 2.45.1
- From 82bab5e9957bd098eab9921c3da6e13003ca07ed Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 23 Jul 2025 14:02:07 +0200
- Subject: [PATCH 2/5] tests: Document MariaDB setup+testing
- Document MariaDB SQL database setup+testing.
- Reported-by: Aurelien Couderc <aurelien.couderc2002@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 85 ++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 85 insertions(+)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index e491a78..a4a3364 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -796,5 +796,90 @@ curl --remote-name "https://www.cygwin.com/setup-x86.exe"
- ./setup-x86 -q --no-write-registry --no-admin --root "$(cygpath -w "$PWD")" --no-desktop --allow-unsupported-windows -q --no-verify --site "http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457"
- PATH="$PWD/bin" /cygdrive/c/Windows/system32/cmd.exe /C $'.\\bin\\bash.exe -x -c \'[[ "$(./bin/readlink.exe /proc/self/exe)" =~ $PWD/.*bin/.+ ]] && echo Test OK || echo Test failed'
- +
- +#
- +# MariaDB testing
- +#
- +
- +#### Setup:
- +1. Install MariaDB from https://archive.mariadb.org//mariadb-11.8.2/winx64-packages/mariadb-11.8.2-winx64.msi
- +
- +2. Create user "MariaDB" and group "MariaDB entries in Cygwin /etc/passwd and /etc/group.
- +This is needed because the current ms-nfs41-client idmapper cannot lookup accounts from the "NT SERVICE" domain
- +$ getent passwd "NT SERVICE+MariaDB" | sed -E 's/NT SERVICE\+//' >>'/etc/passwd'
- +$ getent group "NT SERVICE+MariaDB" | sed -E 's/NT SERVICE\+// '>>'/etc/group'
- +
- +3. Create user "MariaDB" and group "MariaDB" on the NFS server, based on the Cygwin /etc/passwd and /etc/group entries
- +
- +4. Create GLOBAL mount N: (e.g. via $ msnfs41client sys_terminal #)
- +
- +5. Create MariaDB data dir on the NFSv4.2 share
- +$ mkdir '/cygdrive/n/mariadbtest'
- +
- +6. Edit '/cygdrive/c/Program Files/MariaDB 11.8/data/my.ini' and change "datadir" to "L:\mariadbtest".
- +Example:
- +---- snip ----
- +[mysqld]
- +datadir=N:\mariadbtest
- +port=3306
- +innodb_buffer_pool_size=1535M
- +character-set-server=utf8mb4
- +[client]
- +port=3306
- +plugin-dir=C:\Program Files\MariaDB 11.8/lib/plugin
- +---- snip ----
- +
- +7. Copy contents of '/cygdrive/c/Program Files/MariaDB 11.8/data' to '/cygdrive/n/mariadbtest'
- +$ (cd '/cygdrive/c/Program Files/MariaDB 11.8/data' && tar --sparse -cvf - .) | (cd '/cygdrive/n/mariadbtest' && tar -xf -)
- +
- +8. $ chown -R "MariaDB:MariaDB" mariadbtest # on the NFS server!!
- +
- +#### Testing sparse database file:
- +1. Test script
- +---- snip ----
- +$ cat testdbsparse1.ksh
- +integer line_num=0
- +typeset line
- +typeset escaped_line
- +
- +cat <<EOF
- +SELECT VERSION();
- +
- +DROP DATABASE IF EXISTS alphabet_test4;
- +CREATE DATABASE alphabet_test4;
- +USE alphabet_test4;
- +
- +# create table using InnoDB with PAGE_COMPRESSED=1 (which will use punch hole to free space)
- +CREATE TABLE file_data (
- + line_number INT PRIMARY KEY,
- + line_text TEXT
- +) ENGINE=InnoDB PAGE_COMPRESSED=1;
- +EOF
- +
- +while IFS= read -r line ; do
- + (( line_num++ ))
- + # Escape single quotes in the line to prevent SQL injection issues
- + # This is a basic escape, for more complex data, consider prepared statements
- + escaped_line="${line//\'/\'\'}"
- +
- + # Insert the line number and text into the table
- + printf $'INSERT INTO file_data (line_number, line_text) VALUES (%d, \'%s\');\n' line_num "$escaped_line"
- +done
- +
- +# force rebuild, including punching holes
- +printf 'OPTIMIZE TABLE file_data;'
- +
- +print -u2 '#Done;\n#Verify with\nUSE alphabet_test4; SELECT * FROM file_data ORDER BY line_number;\n'
- +# EOF.
- +---- snip ----
- +
- +2. Run this test script with a large text file as input:
- +---- snip ----
- +time ksh93 -c 'for ((i=0 ; i < 10 ; i++ )) ; do cat /usr/share/doc/mingw64-x86_64-gcc/NEWS ; done | ksh93 testdbsparse1.ksh | /cygdrive/c/Program\ Files/MariaDB\ 11.8/bin/mariadb -u root -p'
- +---- snip ----
- +
- +3. Check whether the database file now has holes:
- +$ lssparse -H /cygdrive/n/mariadbtest/alphabet_test4/file_data.ibd
- +
- #
- # EOF.
- --
- 2.45.1
- From d749068796e6b8e265b6f106961eebbc6da6b6e7 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Wed, 23 Jul 2025 14:31:06 +0200
- Subject: [PATCH 3/5] sys: Disable APCs in |nfs41_UpcallWaitForReply()| while
- waiting for upcall
- Temporarily disable APCs (asynchronous procedure calls) in
- |nfs41_UpcallWaitForReply()| while waiting for upcall.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_updowncall.c | 5 +++++
- 1 file changed, 5 insertions(+)
- diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
- index c623dea..0b3b39c 100644
- --- a/sys/nfs41sys_updowncall.c
- +++ b/sys/nfs41sys_updowncall.c
- @@ -517,6 +517,8 @@ NTSTATUS nfs41_UpcallWaitForReply(
- {
- NTSTATUS status = STATUS_SUCCESS;
- + FsRtlEnterFileSystem();
- +
- nfs41_AddEntry(upcallLock, upcall, entry);
- KeSetEvent(&upcallEvent, 0, FALSE);
- @@ -567,7 +569,10 @@ retry_wait:
- goto out;
- }
- nfs41_RemoveEntry(downcallLock, entry);
- +
- out:
- + FsRtlExitFileSystem();
- +
- return status;
- }
- --
- 2.45.1
- From 41fee06eef44da57514c4437ec609fc83b6aeb07 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Wed, 23 Jul 2025 17:37:33 +0200
- Subject: [PATCH 4/5] sys: Disable APCs in RDR calls
- Temporarily disable APCs (asynchronous procedure calls) in RDR
- calls.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41sys_acl.c | 4 ++++
- sys/nfs41sys_dir.c | 2 ++
- sys/nfs41sys_ea.c | 5 +++++
- sys/nfs41sys_fileinfo.c | 4 ++++
- sys/nfs41sys_fsctl.c | 3 +++
- sys/nfs41sys_ioctl.c | 3 +++
- sys/nfs41sys_lock.c | 6 ++++++
- sys/nfs41sys_mount.c | 19 +++++++++++++++++++
- sys/nfs41sys_openclose.c | 6 ++++++
- sys/nfs41sys_readwrite.c | 8 ++++++++
- sys/nfs41sys_reparse.c | 4 ++++
- sys/nfs41sys_symlink.c | 3 +++
- sys/nfs41sys_volinfo.c | 2 ++
- 13 files changed, 69 insertions(+)
- diff --git a/sys/nfs41sys_acl.c b/sys/nfs41sys_acl.c
- index fce29f5..2ddf93d 100644
- --- a/sys/nfs41sys_acl.c
- +++ b/sys/nfs41sys_acl.c
- @@ -225,6 +225,7 @@ NTSTATUS nfs41_QuerySecurityInformation(
- print_debug_header(RxContext);
- print_acl_args(info_class);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_getacl_args(RxContext);
- if (status) goto out;
- @@ -355,6 +356,7 @@ out:
- t2.QuadPart - t1.QuadPart, getacl.tops, getacl.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_ACL_QUERY
- DbgEx();
- #endif
- @@ -412,6 +414,7 @@ NTSTATUS nfs41_SetSecurityInformation(
- print_debug_header(RxContext);
- print_acl_args(info_class);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_setacl_args(RxContext);
- if (status) goto out;
- @@ -481,6 +484,7 @@ out:
- t2.QuadPart - t1.QuadPart, setacl.tops, setacl.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_ACL_SET
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_dir.c b/sys/nfs41sys_dir.c
- index 1e9f581..7f565f5 100644
- --- a/sys/nfs41sys_dir.c
- +++ b/sys/nfs41sys_dir.c
- @@ -238,6 +238,7 @@ NTSTATUS nfs41_QueryDirectory(
- DbgEn();
- print_querydir_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_dirquery_args(RxContext);
- if (status) goto out;
- @@ -335,6 +336,7 @@ out:
- t2.QuadPart - t1.QuadPart, readdir.tops, readdir.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_DIR_QUERY
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_ea.c b/sys/nfs41sys_ea.c
- index 04447e8..db2005b 100644
- --- a/sys/nfs41sys_ea.c
- +++ b/sys/nfs41sys_ea.c
- @@ -346,6 +346,7 @@ NTSTATUS nfs41_SetEaInformation(
- print_debug_header(RxContext);
- print_ea_info(eainfo);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_setea_args(RxContext);
- if (status) goto out;
- @@ -411,6 +412,7 @@ out:
- t2.QuadPart - t1.QuadPart, setexattr.tops, setexattr.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_EA_SET
- DbgEx();
- #endif
- @@ -624,6 +626,8 @@ NTSTATUS nfs41_QueryEaInformation(
- print_debug_header(RxContext);
- print_get_ea(1, query);
- #endif
- + FsRtlEnterFileSystem();
- +
- status = check_nfs41_queryea_args(RxContext);
- if (status) goto out;
- @@ -688,6 +692,7 @@ out:
- t2.QuadPart - t1.QuadPart, getexattr.tops, getexattr.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_EA_QUERY
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
- index 202e2fd..d7dc5e7 100644
- --- a/sys/nfs41sys_fileinfo.c
- +++ b/sys/nfs41sys_fileinfo.c
- @@ -205,6 +205,7 @@ NTSTATUS nfs41_QueryFileInformation(
- DbgP("--> nfs41_QueryFileInformation, RxContext->Info.LengthRemaining=%ld\n",
- (long)RxContext->Info.LengthRemaining);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_dirquery_args(RxContext);
- if (status) {
- @@ -500,6 +501,7 @@ out:
- t2.QuadPart - t1.QuadPart, getattr.tops, getattr.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_FILE_QUERY
- DbgEx();
- DbgP("<-- nfs41_QueryFileInformation, status=0x%lx\n",
- @@ -655,6 +657,7 @@ NTSTATUS nfs41_SetFileInformation(
- DbgEn();
- print_debug_filedirquery_header(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_setattr_args(RxContext);
- if (status) goto out;
- @@ -772,6 +775,7 @@ out:
- t2.QuadPart - t1.QuadPart, setattr.tops, setattr.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_FILE_SET
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
- index 9df5528..c1a3f2b 100644
- --- a/sys/nfs41sys_fsctl.c
- +++ b/sys/nfs41sys_fsctl.c
- @@ -871,6 +871,8 @@ NTSTATUS nfs41_FsCtl(
- DbgEn();
- print_debug_header(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- +
- const ULONG fscontrolcode =
- RxContext->LowIoContext.ParamsFor.FsCtl.FsControlCode;
- @@ -910,6 +912,7 @@ NTSTATUS nfs41_FsCtl(
- }
- #endif /* DEBUG_FSCTL */
- + FsRtlExitFileSystem();
- #ifdef DEBUG_FSCTL
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_ioctl.c b/sys/nfs41sys_ioctl.c
- index 56da370..4496be9 100644
- --- a/sys/nfs41sys_ioctl.c
- +++ b/sys/nfs41sys_ioctl.c
- @@ -77,12 +77,15 @@ NTSTATUS nfs41_IoCtl(
- DbgEn();
- print_debug_header(RxContext);
- #endif /* DEBUG_IOCTL */
- + FsRtlEnterFileSystem();
- +
- const ULONG iocontrolcode =
- RxContext->LowIoContext.ParamsFor.IoCtl.IoControlCode;
- DbgP("nfs41_IoCtl: IoControlCode=0x%lx, status=0x%lx\n",
- (unsigned long)iocontrolcode, (long)status);
- + FsRtlExitFileSystem();
- #ifdef DEBUG_IOCTL
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_lock.c b/sys/nfs41sys_lock.c
- index 803c4c1..7bd2132 100644
- --- a/sys/nfs41sys_lock.c
- +++ b/sys/nfs41sys_lock.c
- @@ -166,11 +166,13 @@ NTSTATUS nfs41_IsLockRealizable(
- BooleanFlagOn(LowIoLockFlags, SL_EXCLUSIVE_LOCK),
- !BooleanFlagOn(LowIoLockFlags, SL_FAIL_IMMEDIATELY));
- #endif
- + FsRtlEnterFileSystem();
- /* NFS lock operations with length=0 MUST fail with NFS4ERR_INVAL */
- if (Length->QuadPart == 0)
- status = STATUS_NOT_SUPPORTED;
- + FsRtlExitFileSystem();
- #ifdef DEBUG_LOCK
- DbgEx();
- #endif
- @@ -286,6 +288,7 @@ NTSTATUS nfs41_Lock(
- DbgEn();
- print_lock_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- /* RxReleaseFcbResourceForThreadInMRx(RxContext, RxContext->pFcb,
- LowIoContext->ResourceThreadId); */
- @@ -343,6 +346,7 @@ out:
- lock.tops, lock.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_LOCK
- DbgEx();
- #endif
- @@ -404,6 +408,7 @@ NTSTATUS nfs41_Unlock(
- DbgEn();
- print_lock_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- /* RxReleaseFcbResourceForThreadInMRx(RxContext, RxContext->pFcb,
- LowIoContext->ResourceThreadId); */
- @@ -463,6 +468,7 @@ out:
- unlock.tops, unlock.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_LOCK
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index e328885..5e66eda 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -841,6 +841,7 @@ NTSTATUS nfs41_CreateVNetRoot(
- pCreateNetRootContext->VirtualNetRootStatus,
- (long)pCreateNetRootContext->NetRootStatus);
- #endif
- + FsRtlEnterFileSystem();
- if (pNetRoot->Type != NET_ROOT_DISK && pNetRoot->Type != NET_ROOT_WILD) {
- print_error("nfs41_CreateVNetRoot: Unsupported NetRoot Type %u\n",
- @@ -1246,6 +1247,8 @@ out:
- /* RDBSS expects that MRxCreateVNetRoot returns STATUS_PENDING
- * on success or failure */
- status = STATUS_PENDING;
- +
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1299,6 +1302,8 @@ NTSTATUS nfs41_FinalizeSrvCall(
- #ifdef DEBUG_MOUNT
- DbgEn();
- #endif
- + FsRtlEnterFileSystem();
- +
- // print_srv_call(pSrvCall);
- if (pSrvCall->Context == NULL)
- @@ -1310,6 +1315,7 @@ NTSTATUS nfs41_FinalizeSrvCall(
- pSrvCall->Context = NULL;
- out:
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1330,6 +1336,7 @@ NTSTATUS nfs41_FinalizeNetRoot(
- DbgEn();
- print_net_root(pNetRoot);
- #endif
- + FsRtlEnterFileSystem();
- if (pNetRoot->Type != NET_ROOT_DISK && pNetRoot->Type != NET_ROOT_WILD) {
- status = STATUS_NOT_SUPPORTED;
- @@ -1420,6 +1427,7 @@ NTSTATUS nfs41_FinalizeNetRoot(
- break;
- } while (1);
- out:
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1435,9 +1443,13 @@ NTSTATUS nfs41_FinalizeVNetRoot(
- DbgEn();
- print_v_net_root(pVNetRoot);
- #endif
- + FsRtlEnterFileSystem();
- +
- if (pVNetRoot->pNetRoot->Type != NET_ROOT_DISK &&
- pVNetRoot->pNetRoot->Type != NET_ROOT_WILD)
- status = STATUS_NOT_SUPPORTED;
- +
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1457,6 +1469,8 @@ NTSTATUS GetConnectionHandle(
- #ifdef DEBUG_MOUNT
- DbgEn();
- #endif
- + FsRtlEnterFileSystem();
- +
- InitializeObjectAttributes(&ObjectAttributes, ConnectionName,
- OBJ_CASE_INSENSITIVE|OBJ_KERNEL_HANDLE, NULL, NULL);
- @@ -1467,6 +1481,7 @@ NTSTATUS GetConnectionHandle(
- FILE_CREATE_TREE_CONNECTION | FILE_SYNCHRONOUS_IO_NONALERT,
- EaBuffer, EaLength);
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1545,6 +1560,7 @@ NTSTATUS nfs41_CreateConnection(
- #ifdef DEBUG_MOUNT
- DbgEn();
- #endif
- + FsRtlEnterFileSystem();
- if (!Wait) {
- //just post right now!
- @@ -1563,6 +1579,7 @@ NTSTATUS nfs41_CreateConnection(
- if (!status && Handle != INVALID_HANDLE_VALUE)
- ZwClose(Handle);
- out:
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- @@ -1585,6 +1602,7 @@ NTSTATUS nfs41_DeleteConnection(
- #ifdef DEBUG_MOUNT
- DbgEn();
- #endif
- + FsRtlEnterFileSystem();
- if (!Wait) {
- //just post right now!
- @@ -1625,6 +1643,7 @@ NTSTATUS nfs41_DeleteConnection(
- }
- ZwClose(Handle);
- out:
- + FsRtlExitFileSystem();
- #ifdef DEBUG_MOUNT
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index 406c1bf..94d3fa8 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -617,6 +617,7 @@ NTSTATUS nfs41_Create(
- print_nt_create_params(1, RxContext->Create.NtCreateParameters);
- // if (ea) print_ea_info(ea);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_create_args(RxContext);
- if (status) goto out;
- @@ -1075,6 +1076,7 @@ out:
- #endif
- }
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_OPEN
- DbgEx();
- #endif
- @@ -1086,6 +1088,8 @@ NTSTATUS nfs41_CollapseOpen(
- {
- NTSTATUS status = STATUS_MORE_PROCESSING_REQUIRED;
- DbgEn();
- + FsRtlEnterFileSystem();
- + FsRtlExitFileSystem();
- DbgEx();
- return status;
- }
- @@ -1140,6 +1144,7 @@ NTSTATUS nfs41_CloseSrvOpen(
- DbgEn();
- print_debug_header(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- if (!nfs41_fobx->deleg_type && !nfs41_fcb->StandardInfo.Directory &&
- !RxContext->pFcb->OpenCount) {
- @@ -1183,6 +1188,7 @@ out:
- t2.QuadPart - t1.QuadPart, close.tops, close.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_CLOSE
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_readwrite.c b/sys/nfs41sys_readwrite.c
- index b60d544..bdef760 100644
- --- a/sys/nfs41sys_readwrite.c
- +++ b/sys/nfs41sys_readwrite.c
- @@ -250,6 +250,8 @@ NTSTATUS nfs41_Read(
- DbgEn();
- print_readwrite_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- +
- status = check_nfs41_read_args(RxContext);
- if (status) goto out;
- @@ -322,6 +324,7 @@ out:
- read.tops, read.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_READ
- DbgEx();
- #endif
- @@ -373,6 +376,7 @@ NTSTATUS nfs41_Write(
- DbgEn();
- print_readwrite_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_write_args(RxContext);
- if (status) goto out;
- @@ -454,6 +458,7 @@ out:
- write.tops, write.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_WRITE
- DbgEx();
- #endif
- @@ -476,6 +481,8 @@ ULONG nfs41_ExtendForCache(
- (long long)pNewFileSize->QuadPart,
- (long long)pNewAllocationSize->QuadPart);
- #endif
- + FsRtlEnterFileSystem();
- +
- pNewAllocationSize->QuadPart = pNewFileSize->QuadPart;
- nfs41_fcb->StandardInfo.AllocationSize.QuadPart =
- pNewAllocationSize->QuadPart;
- @@ -485,6 +492,7 @@ ULONG nfs41_ExtendForCache(
- (long long)pNewFileSize->QuadPart,
- (long long)pNewAllocationSize->QuadPart);
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_CACHE
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_reparse.c b/sys/nfs41sys_reparse.c
- index df4fa1f..f97b6bf 100644
- --- a/sys/nfs41sys_reparse.c
- +++ b/sys/nfs41sys_reparse.c
- @@ -80,6 +80,7 @@ NTSTATUS nfs41_SetReparsePoint(
- __notnull PREPARSE_DATA_BUFFER Reparse = (PREPARSE_DATA_BUFFER)FsCtl->pInputBuffer;
- DbgEn();
- + FsRtlEnterFileSystem();
- DbgP("nfs41_SetReparsePoint: ReparseTag: '%s'/0x%04lx\n",
- reparsetag2string(Reparse->ReparseTag),
- @@ -98,6 +99,7 @@ NTSTATUS nfs41_SetReparsePoint(
- break;
- }
- + FsRtlExitFileSystem();
- DbgEx();
- return status;
- }
- @@ -109,9 +111,11 @@ NTSTATUS nfs41_GetReparsePoint(
- NTSTATUS status;
- DbgEn();
- + FsRtlEnterFileSystem();
- status = nfs41_GetSymlinkReparsePoint(RxContext);
- + FsRtlExitFileSystem();
- DbgEx();
- return status;
- }
- diff --git a/sys/nfs41sys_symlink.c b/sys/nfs41sys_symlink.c
- index 6db82de..43334a1 100644
- --- a/sys/nfs41sys_symlink.c
- +++ b/sys/nfs41sys_symlink.c
- @@ -565,6 +565,8 @@ NTSTATUS nfs41_GetSymlinkReparsePoint(
- #ifdef DEBUG_SYMLINK
- DbgEn();
- #endif
- + FsRtlEnterFileSystem();
- +
- status = check_nfs41_getsymlinkreparse_args(RxContext);
- if (status) {
- DbgP("nfs41_GetSymlinkReparsePoint: "
- @@ -903,6 +905,7 @@ out:
- if (targetname_buffer)
- RxFreePool(targetname_buffer);
- + FsRtlExitFileSystem();
- #ifdef DEBUG_SYMLINK
- DbgEx();
- #endif
- diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
- index 2028d4a..e663d0b 100644
- --- a/sys/nfs41sys_volinfo.c
- +++ b/sys/nfs41sys_volinfo.c
- @@ -158,6 +158,7 @@ NTSTATUS nfs41_QueryVolumeInformation(
- DbgEn();
- print_queryvolume_args(RxContext);
- #endif
- + FsRtlEnterFileSystem();
- status = check_nfs41_dirquery_args(RxContext);
- if (status) goto out;
- @@ -240,6 +241,7 @@ out:
- t2.QuadPart - t1.QuadPart, volume.tops, volume.ticks);
- #endif
- #endif
- + FsRtlExitFileSystem();
- #ifdef DEBUG_VOLUME_QUERY
- DbgEx();
- #endif
- --
- 2.45.1
- From 1e6c9c98c8801bcb18a1bea89c22fbf94d063644 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 23 Jul 2025 18:25:39 +0200
- Subject: [PATCH 5/5] daemon: Add hack to allow renaming files which are still
- opened
- Add hack to allow renaming files which are still opened. We
- still need to figure out what the correct Win32 behaviour would be.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/setattr.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index 322e934..ab124c8 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -465,9 +465,17 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
- /* AGLO: 03/21/2011: we can't handle rename of a file with a filename
- * that is currently opened by this client
- */
- - eprintf("handle_nfs41_rename: '%s' is opened\n", dst_path.path);
- + eprintf("handle_nfs41_rename: destination '%s' is opened\n",
- + dst_path.path);
- +/*
- + * gisburn: HACK: We have disabled this check to get MariaDB working,
- + * but we have to figure out what is the correct solution compared
- + * to NTFS and SMBFS
- + */
- +#ifdef DISABLED_FOR_NOW
- status = ERROR_FILE_EXISTS;
- goto out;
- +#endif
- }
- /* break any delegations on the source file */
- --
- 2.45.1
msnfs41client: Patch to disable APCs, MariaDB (sparse file) tests+misc, 2025-07-23 ...
Posted by Anonymous on Wed 23rd Jul 2025 17:53
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.