- From 6c4c357c23585c1bb94110a0d2c2a22b846f82eb Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 25 Sep 2024 11:28:16 +0200
- Subject: [PATCH 1/4] build.vc19,sys: Only use our own FsRtlCopyRead2(),
- FsRtlCopyWrite2() on ARM64
- Only use our own FsRtlCopyRead2(), FsRtlCopyWrite2() on ARM64,
- as we still get asserts when building ms-nfs41-client with VC19
- on a ms-nfs41-client filesystem.
- Reviewed-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/nfs41_driver/nfs41_driver.vcxproj | 8 ++++----
- sys/copysup.c | 4 ++++
- 2 files changed, 8 insertions(+), 4 deletions(-)
- diff --git a/build.vc19/nfs41_driver/nfs41_driver.vcxproj b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- index 18fd852..14b711e 100644
- --- a/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- +++ b/build.vc19/nfs41_driver/nfs41_driver.vcxproj
- @@ -172,7 +172,7 @@
- <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- - <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
- + <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- @@ -186,7 +186,7 @@
- <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- - <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
- + <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
- @@ -228,7 +228,7 @@
- <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- - <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
- + <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- @@ -242,7 +242,7 @@
- <AdditionalOptions>/std:c17 /Zc:preprocessor- /kernel /wd4100 /wd4201 /wd5104</AdditionalOptions>
- </ClCompile>
- <Link>
- - <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib</AdditionalDependencies>
- + <AdditionalDependencies>$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ntoskrnl.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\hal.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\BufferOverflowfastfailK.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\ksecdd.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rxce.lib;$(WindowsSdkDir)lib0.0.19041.0\km\$(DDKPlatform)\rdbsslib.lib;$(WindowsSdkDir)lib\win7\km\$(DDKPlatform)\copysup.lib</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- diff --git a/sys/copysup.c b/sys/copysup.c
- index a70f179..799caf9 100644
- --- a/sys/copysup.c
- +++ b/sys/copysup.c
- @@ -35,6 +35,8 @@
- #include "nfs41_debug.h"
- #include "nfs41_build_features.h"
- +#if defined(_ARM_) || defined(_ARM64_)
- +
- #define COPYSUP_MAX_HOLE_SIZE (2*4096LL)
- BOOLEAN FsRtlCopyRead2(
- @@ -570,6 +572,8 @@ done_exit_filesystem:
- done:
- return retval;
- }
- +#endif /* defined(_ARM_) || defined(_ARM64_) */
- +
- #if defined(_ARM_) || defined(_ARM64_)
- --
- 2.45.1
- From 6ac071cec1143e2c7c0d34a6d0d5dfcd6a680fe1 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 25 Sep 2024 11:55:36 +0200
- Subject: [PATCH 2/4] build.vc19: Disable VC19 "JustMyCode" feature for better
- drmemory stacktraces
- Disable VC19 "JustMyCode" feature (see
- https://learn.microsoft.com/en-us/cpp/build/reference/jmc?view=msvc-170)
- for better drmemory stacktraces.
- The "JustMyCode" feature has caused problems with accurate
- stacktraces in libtirpc&co like this:
- ---- snip ----
- Error #2: UNINITIALIZED READ: reading 4 byte(s)
- libtirpc.dll!__CheckForDebuggerJustMyCode [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c:23]
- libtirpc.dll!time_not_ok [msnfs41_uidmapping\ms-nfs41-client\libtirpc\src\clnt_vc.c:15732480]
- KERNELBASE.dll!OpenThreadToken +0x4c (0x00007ffb9b992b6d <KERNELBASE.dll+0x32b6d>)
- KERNELBASE.dll!SleepConditionVariableSRW +0x36 (0x00007ffb9b9d3327 <KERNELBASE.dll+0x73327>)
- nfs41_send_compound [ms-nfs41-client\daemon\nfs41_rpc.c:351]
- compound_encode_send_decode [ms-nfs41-client\daemon\nfs41_compound.c:153]
- nfs41_read [ms-nfs41-client\daemon\nfs41_ops.c:873]
- read_from_mds [ms-nfs41-client\daemon\readwrite.c:80]
- handle_read [ms-nfs41-client\daemon\readwrite.c:165]
- upcall_handle [ms-nfs41-client\daemon\upcall.c:220]
- nfsd_worker_thread_main [ms-nfs41-client\daemon\nfs41_daemon.c:188]
- ---- snip ----
- Note the bogus line number in "clnt_vc.c:15732480", and that
- |SleepConditionVariableSRW()| (system library function) cannot call
- |libtirpc.dll!time_not_ok|.
- We just disable this feature as it only causes confusion.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- build.vc19/libtirpc/libtirpc.vcxproj | 3 +++
- build.vc19/nfs41_np/nfs41_np.vcxproj | 4 +++-
- build.vc19/nfs_install/nfs_install.vcxproj | 4 +++-
- build.vc19/nfs_mount/nfs_mount.vcxproj | 3 +++
- build.vc19/nfsd/nfsd.vcxproj | 4 +++-
- 5 files changed, 15 insertions(+), 3 deletions(-)
- diff --git a/build.vc19/libtirpc/libtirpc.vcxproj b/build.vc19/libtirpc/libtirpc.vcxproj
- index 3707b88..590715a 100644
- --- a/build.vc19/libtirpc/libtirpc.vcxproj
- +++ b/build.vc19/libtirpc/libtirpc.vcxproj
- @@ -128,6 +128,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100 /wd4131 /wd4389</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -150,6 +151,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100 /wd4131 /wd4389</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -172,6 +174,7 @@
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100 /wd4131 /wd4389</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- diff --git a/build.vc19/nfs41_np/nfs41_np.vcxproj b/build.vc19/nfs41_np/nfs41_np.vcxproj
- index 77a61b1..b1aad79 100644
- --- a/build.vc19/nfs41_np/nfs41_np.vcxproj
- +++ b/build.vc19/nfs41_np/nfs41_np.vcxproj
- @@ -72,7 +72,6 @@
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- -
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- @@ -126,6 +125,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -144,6 +144,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- @@ -162,6 +163,7 @@
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- diff --git a/build.vc19/nfs_install/nfs_install.vcxproj b/build.vc19/nfs_install/nfs_install.vcxproj
- index df69486..5c07c13 100644
- --- a/build.vc19/nfs_install/nfs_install.vcxproj
- +++ b/build.vc19/nfs_install/nfs_install.vcxproj
- @@ -124,6 +124,7 @@
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -140,6 +141,7 @@
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -156,13 +158,13 @@
- <AdditionalIncludeDirectories>..\..\sys;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- -
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level4</WarningLevel>
- diff --git a/build.vc19/nfs_mount/nfs_mount.vcxproj b/build.vc19/nfs_mount/nfs_mount.vcxproj
- index 9098369..0f8e9cc 100644
- --- a/build.vc19/nfs_mount/nfs_mount.vcxproj
- +++ b/build.vc19/nfs_mount/nfs_mount.vcxproj
- @@ -124,6 +124,7 @@
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -141,6 +142,7 @@
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -158,6 +160,7 @@
- <AdditionalIncludeDirectories>..\..\sys;..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <LanguageStandard_C>stdc17</LanguageStandard_C>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- diff --git a/build.vc19/nfsd/nfsd.vcxproj b/build.vc19/nfsd/nfsd.vcxproj
- index 481cef9..e49964a 100644
- --- a/build.vc19/nfsd/nfsd.vcxproj
- +++ b/build.vc19/nfsd/nfsd.vcxproj
- @@ -72,7 +72,6 @@
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- -
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- @@ -129,6 +128,7 @@
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -150,6 +150,7 @@
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- @@ -171,6 +172,7 @@
- <StringPooling>true</StringPooling>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <AdditionalOptions>/wd4100</AdditionalOptions>
- + <SupportJustMyCode>false</SupportJustMyCode>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- --
- 2.45.1
- From 3f914b65a4b94fef6b8b59ee856197a290526c22 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 25 Sep 2024 15:16:50 +0200
- Subject: [PATCH 3/4] daemon: Kernel logs weird getattr ChangeTime
- "1853819773316251935"
- Kernel logs weired ChangeTime values for getattr, which
- turns out to be from uninitalised memory.
- Example:
- ---- snip ----
- [1bd0] [unmarshal_nfs41_getattr] ChangeTime 1853819773316251935
- ---- snip ----
- The daemon's |handle_getattr()| should just unconditionally
- return the ChangeTime to avoid this confusion.
- Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/getattr.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
- diff --git a/daemon/getattr.c b/daemon/getattr.c
- index c193d40..67ea820 100644
- --- a/daemon/getattr.c
- +++ b/daemon/getattr.c
- @@ -165,12 +165,13 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall)
- info.symlink_dir = TRUE;
- }
- + EASSERT((info.attrmask.count > 0) &&
- + (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + args->ctime = info.change;
- +
- switch (args->query_class) {
- case FileBasicInformation:
- nfs_to_basic_info(state->file.name.name, &info, &args->basic_info);
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- - args->ctime = info.change;
- break;
- case FileStandardInformation:
- nfs_to_standard_info(&info, &args->std_info);
- --
- 2.45.1
- From 10d8c2cd069f1385770362f624f3d210f2fa0c67 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 25 Sep 2024 16:04:20 +0200
- Subject: [PATCH 4/4] cygwin: msnfs41client should wait for nfsd*.exe before
- mounting filesystems
- cygwin: msnfs41client.bash should wait for nfsd*.exe before mounting
- filesystems
- Reported-by: Martin Wege <martin.l.wege@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 52 ++++++++++++++++++++++++++++++++-
- 1 file changed, 51 insertions(+), 1 deletion(-)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 0ce778a..426ba8d 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -324,6 +324,42 @@ function nfsclient_removedriver
- return 0
- }
- +function nfsclient_waitfor_clientdaemon
- +{
- + typeset -i i
- +
- + #
- + # wait for two minutes, and poll in 0.25 second intervals
- + # (four times per second)
- + #
- + for (( i=0 ; i < 120*4 ; i++ )) ; do
- + #
- + # '/proc/sys/BaseNamedObjects/nfs41_shared_memory' is created
- + # when nfsd*.exe starts
- + # Note that this file is not removed if nfsd*.exe exits,
- + # so we explicitly query tasklist too
- + #
- + if [[ -e '/proc/sys/BaseNamedObjects/nfs41_shared_memory' ]] ; then
- + if [[ "$(tasklist | grep -E 'nfsd(|_debug).exe')" != '' ]] ; then
- + break
- + fi
- + fi
- +
- + # print message every 5 seconds
- + if (( i%(5*4) == 0 )) ; then
- + printf '%s: Waiting for nfsd*.exe to start\n' "$0"
- + fi
- + sleep 0.25
- + done
- +
- + if [[ -e '/proc/sys/BaseNamedObjects/nfs41_shared_memory' ]] ; then
- + if [[ "$(tasklist | grep -E 'nfsd(|_debug).exe')" != '' ]] ; then
- + return 0
- + fi
- + fi
- + return 1
- +}
- +
- function nfsclient_rundeamon
- {
- set -o nounset
- @@ -598,6 +634,11 @@ function nfsclient_system_mount_globaldirs
- set -o nounset
- set -o errexit
- + if ! nfsclient_waitfor_clientdaemon ; then
- + print -u2 -f $"%s: nfsd*.exe not running.\n" "$0"
- + return 1
- + fi
- +
- mountall_msnfs41client
- return $?
- @@ -615,6 +656,11 @@ function nfsclient_mount_homedir
- set -o nounset
- set -o errexit
- + if ! nfsclient_waitfor_clientdaemon ; then
- + print -u2 -f $"%s: nfsd*.exe not running.\n" "$0"
- + return 1
- + fi
- +
- #nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home2/rmainz'
- #nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home2/rmainz'
- nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6linklocal:/export/home2/rmainz'
- @@ -704,6 +750,9 @@ function main
- # add defauft system path for POSIX utilities
- PATH+=':/sbin:/usr/sbin:/bin:/usr/bin'
- + # add Windows tools path (tasklist, taskkill etc.)
- + PATH+=':/cygdrive/c/Windows/system32/'
- +
- # path to WinDBG cdb (fixme: 64bit x86-specific)
- PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
- @@ -792,7 +841,7 @@ function main
- check_machine_arch || (( numerr++ ))
- require_cmd 'nfs_mount.exe' || (( numerr++ ))
- require_cmd 'mountall_msnfs41client' || (( numerr++ ))
- - require_cmd 'PsExec.exe' || (( numerr++ ))
- + require_cmd 'tasklist.exe' || (( numerr++ ))
- if ! is_windows_admin_account ; then
- printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- (( numerr++ ))
- @@ -818,6 +867,7 @@ function main
- 'mount_homedir')
- check_machine_arch || (( numerr++ ))
- require_cmd 'nfs_mount.exe' || (( numerr++ ))
- + require_cmd 'tasklist.exe' || (( numerr++ ))
- (( numerr > 0 )) && return 1
- nfsclient_mount_homedir
- --
- 2.45.1
msnfs41client: Patches for to use system's |FsRtlCopy*()| for x86+AMD64, weird getattr Changetime, wait for nfsd before mounts+misc, 2024-09-25
Posted by Anonymous on Wed 25th Sep 2024 16:30
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.