pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Misc patches, 2025-11-03
Posted by Anonymous on Mon 3rd Nov 2025 20:46
raw | new post

  1. From aa4566da2912c8a57d97a58ddd6cb79de650effd Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Thu, 30 Oct 2025 12:01:52 +0100
  4. Subject: [PATCH 1/3] sys: Use |RxContext->CurrentIrp->MdlAddress| for
  5.  directory query data
  6.  
  7. Use |RxContext->CurrentIrp->MdlAddress| for directory query data.
  8. This also removes locking/unlocking of the memory pages, because
  9. |RxContext->CurrentIrp->MdlAddress| is already locked by RDBSS via
  10. |RxLockUserBuffer(RxContext->CurrentIrp, IoModifyAccess, ...)| (to
  11. fill |RxContext->Info.Buffer|) before calling |nfs41_QueryDirectory()|.
  12.  
  13. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  14. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  15. ---
  16.  sys/nfs41sys_dir.c        | 41 ++++++++++++++++-----------------------
  17.  sys/nfs41sys_updowncall.c |  2 --
  18.  2 files changed, 17 insertions(+), 26 deletions(-)
  19.  
  20. diff --git a/sys/nfs41sys_dir.c b/sys/nfs41sys_dir.c
  21. index 7e6e4a0..674720b 100644
  22. --- a/sys/nfs41sys_dir.c
  23. +++ b/sys/nfs41sys_dir.c
  24. @@ -103,6 +103,15 @@ NTSTATUS marshal_nfs41_dirquery(
  25.      RtlCopyMemory(tmp, &entry->u.QueryFile.return_single, sizeof(BOOLEAN));
  26.      tmp += sizeof(BOOLEAN);
  27.  
  28. +#pragma warning( push )
  29. +/*
  30. + * C28145: "The opaque MDL structure should not be modified by a
  31. + * driver.", |MDL_MAPPING_CAN_FAIL| is the exception
  32. + */
  33. +#pragma warning (disable : 28145)
  34. +    entry->u.QueryFile.mdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
  35. +#pragma warning( pop )
  36. +
  37.      status = nfs41_MapLockedPagesInNfsDaemonAddressSpace(
  38.          &entry->u.QueryFile.mdl_buf,
  39.          entry->u.QueryFile.mdl,
  40. @@ -264,29 +273,18 @@ NTSTATUS nfs41_QueryDirectory(
  41.  
  42.      entry->u.QueryFile.InfoClass = InfoClass;
  43.      entry->u.QueryFile.buf_len = RxContext->Info.LengthRemaining;
  44. -    entry->u.QueryFile.mdl = IoAllocateMdl(RxContext->Info.Buffer,
  45. -        RxContext->Info.LengthRemaining, FALSE, FALSE, NULL);
  46. +    /*
  47. +     * |RxContext->CurrentIrp->MdlAddress| is already locked by RDBSS via
  48. +     * |RxLockUserBuffer(RxContext->CurrentIrp, IoModifyAccess, ...)| (to
  49. +     * fill |RxContext->Info.Buffer|) before calling
  50. +     * |nfs41_QueryDirectory()|, so we do not have to lock/unlock it
  51. +     * ourselves
  52. +     */
  53. +    entry->u.QueryFile.mdl = RxContext->CurrentIrp->MdlAddress;
  54.      if (entry->u.QueryFile.mdl == NULL) {
  55.          status = STATUS_INTERNAL_ERROR;
  56.          goto out;
  57.      }
  58. -#pragma warning( push )
  59. -/*
  60. - * C28145: "The opaque MDL structure should not be modified by a
  61. - * driver.", |MDL_MAPPING_CAN_FAIL| is the exception
  62. - */
  63. -#pragma warning (disable : 28145)
  64. -    entry->u.QueryFile.mdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
  65. -#pragma warning( pop )
  66. -
  67. -    status = nfs41_ProbeAndLockKernelPages(entry->u.QueryFile.mdl,
  68. -        IoModifyAccess);
  69. -    if (status) {
  70. -        DbgP("nfs41_QueryDirectory: "
  71. -            "nfs41_ProbeAndLockKernelPages() failed, status=0x%lx\n",
  72. -            (long)status);
  73. -        goto out;
  74. -    }
  75.  
  76.      entry->u.QueryFile.filter = Filter;
  77.      entry->u.QueryFile.initial_query = RxContext->QueryDirectory.InitialQuery;
  78. @@ -325,11 +323,6 @@ NTSTATUS nfs41_QueryDirectory(
  79.  
  80.  out:
  81.      if (entry) {
  82. -        if (entry->u.QueryFile.mdl) {
  83. -            (void)nfs41_UnlockKernelPages(entry->u.QueryFile.mdl);
  84. -            IoFreeMdl(entry->u.QueryFile.mdl);
  85. -            entry->u.QueryFile.mdl = NULL;
  86. -        }
  87.          nfs41_UpcallDestroy(entry);
  88.      }
  89.  #ifdef ENABLE_TIMINGS
  90. diff --git a/sys/nfs41sys_updowncall.c b/sys/nfs41sys_updowncall.c
  91. index 5a4c250..c1a0310 100644
  92. --- a/sys/nfs41sys_updowncall.c
  93. +++ b/sys/nfs41sys_updowncall.c
  94. @@ -694,8 +694,6 @@ NTSTATUS nfs41_downcall(
  95.                  (void)nfs41_UnmapLockedKernelPagesInNfsDaemonAddressSpace(
  96.                      cur->u.QueryFile.mdl_buf,
  97.                      cur->u.QueryFile.mdl);
  98. -                (void)nfs41_UnlockKernelPages(cur->u.QueryFile.mdl);
  99. -                IoFreeMdl(cur->u.QueryFile.mdl);
  100.                  cur->u.QueryFile.mdl_buf = NULL;
  101.                  cur->u.QueryFile.mdl = NULL;
  102.              }
  103. --
  104. 2.51.0
  105.  
  106. From 162fb403361bece5f68e66e840c332e278761970 Mon Sep 17 00:00:00 2001
  107. From: Roland Mainz <roland.mainz@nrubsig.org>
  108. Date: Thu, 30 Oct 2025 12:52:22 +0100
  109. Subject: [PATCH 2/3] sys: Add debug output in codepaths for
  110.  invalid/unsupported parameters
  111.  
  112. Add debug output in codepaths for invalid/unsupported parameters.
  113.  
  114. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  115. ---
  116.  sys/nfs41sys_acl.c       | 11 ++++++++---
  117.  sys/nfs41sys_dir.c       |  4 +++-
  118.  sys/nfs41sys_fileinfo.c  |  4 ++++
  119.  sys/nfs41sys_fsctl.c     |  9 +++++++++
  120.  sys/nfs41sys_lock.c      |  4 +++-
  121.  sys/nfs41sys_openclose.c |  1 +
  122.  sys/nfs41sys_readwrite.c |  9 +++++++--
  123.  7 files changed, 35 insertions(+), 7 deletions(-)
  124.  
  125. diff --git a/sys/nfs41sys_acl.c b/sys/nfs41sys_acl.c
  126. index d9647b9..3cab187 100644
  127. --- a/sys/nfs41sys_acl.c
  128. +++ b/sys/nfs41sys_acl.c
  129. @@ -206,15 +206,19 @@ NTSTATUS check_nfs41_getacl_args(
  130.      SECURITY_INFORMATION info_class =
  131.          RxContext->CurrentIrpSp->Parameters.QuerySecurity.SecurityInformation;
  132.  
  133. -    /* we don't support sacls */
  134. +    /* we don't support sacls (yet) */
  135.      if (info_class == SACL_SECURITY_INFORMATION ||
  136.              info_class == LABEL_SECURITY_INFORMATION) {
  137. +        DbgP("check_nfs41_getacl_args: SACLs not supported (yet)\n");
  138.          status = STATUS_NOT_SUPPORTED;
  139.          goto out;
  140.      }
  141.      if (RxContext->CurrentIrp->UserBuffer == NULL &&
  142. -            RxContext->CurrentIrpSp->Parameters.QuerySecurity.Length)
  143. +            RxContext->CurrentIrpSp->Parameters.QuerySecurity.Length) {
  144. +        DbgP("check_nfs41_getacl_args: "
  145. +            "RxContext->CurrentIrp->UserBuffer == NULL\n");
  146.          status = STATUS_INVALID_USER_BUFFER;
  147. +    }
  148.  out:
  149.      return status;
  150.  }
  151. @@ -397,9 +401,10 @@ NTSTATUS check_nfs41_setacl_args(
  152.          status = STATUS_MEDIA_WRITE_PROTECTED;
  153.          goto out;
  154.      }
  155. -    /* we don't support sacls */
  156. +    /* we don't support sacls (yet) */
  157.      if (info_class == SACL_SECURITY_INFORMATION  ||
  158.              info_class == LABEL_SECURITY_INFORMATION) {
  159. +        DbgP("check_nfs41_setacl_args: SACLs not supported (yet)\n");
  160.          status = STATUS_NOT_SUPPORTED;
  161.          goto out;
  162.      }
  163. diff --git a/sys/nfs41sys_dir.c b/sys/nfs41sys_dir.c
  164. index 674720b..e80aa1e 100644
  165. --- a/sys/nfs41sys_dir.c
  166. +++ b/sys/nfs41sys_dir.c
  167. @@ -216,8 +216,10 @@ NTSTATUS map_querydir_errors(
  168.  NTSTATUS check_nfs41_dirquery_args(
  169.      IN PRX_CONTEXT RxContext)
  170.  {
  171. -    if (RxContext->Info.Buffer == NULL)
  172. +    if (RxContext->Info.Buffer == NULL) {
  173. +        DbgP("check_nfs41_dirquery_args: RxContext->Info.Buffer == NULL\n");
  174.          return STATUS_INVALID_USER_BUFFER;
  175. +    }
  176.      return STATUS_SUCCESS;
  177.  }
  178.  
  179. diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
  180. index c86838c..aaa2018 100644
  181. --- a/sys/nfs41sys_fileinfo.c
  182. +++ b/sys/nfs41sys_fileinfo.c
  183. @@ -610,6 +610,8 @@ NTSTATUS check_nfs41_setattr_args(
  184.              goto out;
  185.          }
  186.          if (rinfo->RootDirectory) {
  187. +            DbgP("check_nfs41_setattr_args: "
  188. +                "rinfo->RootDirectory != NULL not supported\n");
  189.              status = STATUS_INVALID_PARAMETER;
  190.              goto out;
  191.          }
  192. @@ -629,6 +631,8 @@ NTSTATUS check_nfs41_setattr_args(
  193.              goto out;
  194.          }
  195.          if (linfo->RootDirectory) {
  196. +            DbgP("check_nfs41_setattr_args: "
  197. +                "linfo->RootDirectory != NULL not supported\n");
  198.              status = STATUS_INVALID_PARAMETER;
  199.              goto out;
  200.          }
  201. diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
  202. index eb5ff06..864ad78 100644
  203. --- a/sys/nfs41sys_fsctl.c
  204. +++ b/sys/nfs41sys_fsctl.c
  205. @@ -80,6 +80,8 @@ NTSTATUS check_nfs41_queryallocatedranges_args(
  206.          (const PFILE_ALLOCATED_RANGE_BUFFER)FsCtl->pInputBuffer;
  207.  
  208.      if (FsCtl->pInputBuffer == NULL) {
  209. +        DbgP("check_nfs41_queryallocatedranges_args: "
  210. +            "FsCtl->pInputBuffer == NULL\n");
  211.          status = STATUS_INVALID_USER_BUFFER;
  212.          goto out;
  213.      }
  214. @@ -96,11 +98,15 @@ NTSTATUS check_nfs41_queryallocatedranges_args(
  215.          (in_range_buffer->Length.QuadPart < 0LL) ||
  216.          (in_range_buffer->Length.QuadPart >
  217.              (MAXLONGLONG - in_range_buffer->FileOffset.QuadPart))) {
  218. +        DbgP("check_nfs41_queryallocatedranges_args: "
  219. +            "in_range_buffer invalid data\n");
  220.          status = STATUS_INVALID_PARAMETER;
  221.          goto out;
  222.      }
  223.  
  224.      if (FsCtl->pOutputBuffer == NULL) {
  225. +        DbgP("check_nfs41_queryallocatedranges_args: "
  226. +            "FsCtl->pOutputBuffer == NULL\n");
  227.          status = STATUS_INVALID_USER_BUFFER;
  228.          goto out;
  229.      }
  230. @@ -461,6 +467,7 @@ NTSTATUS nfs41_SetZeroData(
  231.          goto out;
  232.  
  233.      if (FsCtl->pInputBuffer == NULL) {
  234. +        DbgP("nfs41_SetZeroData: FsCtl->pInputBuffer == NULL\n");
  235.          status = STATUS_INVALID_USER_BUFFER;
  236.          goto out;
  237.      }
  238. @@ -656,6 +663,8 @@ NTSTATUS nfs41_DuplicateData(
  239.          goto out;
  240.  
  241.      if (FsCtl->pInputBuffer == NULL) {
  242. +        DbgP("nfs41_DuplicateData: "
  243. +            "FsCtl->pInputBuffer == NULL\n");
  244.          status = STATUS_INVALID_USER_BUFFER;
  245.          goto out;
  246.      }
  247. diff --git a/sys/nfs41sys_lock.c b/sys/nfs41sys_lock.c
  248. index 31ed0ec..7b52ad6 100644
  249. --- a/sys/nfs41sys_lock.c
  250. +++ b/sys/nfs41sys_lock.c
  251. @@ -186,8 +186,10 @@ NTSTATUS nfs41_IsLockRealizable(
  252.      FsRtlEnterFileSystem();
  253.  
  254.      /* NFS lock operations with length=0 MUST fail with NFS4ERR_INVAL */
  255. -    if (Length->QuadPart == 0)
  256. +    if (Length->QuadPart == 0) {
  257. +        DbgP("nfs41_IsLockRealizable: Length->QuadPart == 0 not supported\n");
  258.          status = STATUS_NOT_SUPPORTED;
  259. +    }
  260.  
  261.      FsRtlExitFileSystem();
  262.  #ifdef DEBUG_LOCK
  263. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  264. index 2d9ae41..ebb7490 100644
  265. --- a/sys/nfs41sys_openclose.c
  266. +++ b/sys/nfs41sys_openclose.c
  267. @@ -520,6 +520,7 @@ NTSTATUS check_nfs41_create_args(
  268.      }
  269.  
  270.      if (isStream(SrvOpen->pAlreadyPrefixedName)) {
  271. +        DbgP("nfs41_Create: Streams not supported (yet)\n");
  272.          status = STATUS_NOT_SUPPORTED;
  273.          goto out;
  274.      }
  275. diff --git a/sys/nfs41sys_readwrite.c b/sys/nfs41sys_readwrite.c
  276. index a2c023a..f82549c 100644
  277. --- a/sys/nfs41sys_readwrite.c
  278. +++ b/sys/nfs41sys_readwrite.c
  279. @@ -220,8 +220,11 @@ NTSTATUS map_readwrite_errors(
  280.  static NTSTATUS check_nfs41_read_args(
  281.      IN PRX_CONTEXT RxContext)
  282.  {
  283. -    if (!RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer)
  284. +    if (RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer == NULL) {
  285. +        DbgP("check_nfs41_read_args: "
  286. +            "RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer == NULL\n");
  287.          return STATUS_INVALID_USER_BUFFER;
  288. +    }
  289.      return STATUS_SUCCESS;
  290.  }
  291.  
  292. @@ -337,7 +340,9 @@ static NTSTATUS check_nfs41_write_args(
  293.      __notnull PNFS41_V_NET_ROOT_EXTENSION pVNetRootContext =
  294.          NFS41GetVNetRootExtension(RxContext->pRelevantSrvOpen->pVNetRoot);
  295.  
  296. -    if (!RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer) {
  297. +    if (RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer == NULL) {
  298. +        DbgP("check_nfs41_write_args: "
  299. +            "RxContext->LowIoContext.ParamsFor.ReadWrite.Buffer == NULL\n");
  300.          status = STATUS_INVALID_USER_BUFFER;
  301.          goto out;
  302.      }
  303. --
  304. 2.51.0
  305.  
  306. From 75859f4172ae8f5552a91818ac6f03191535b283 Mon Sep 17 00:00:00 2001
  307. From: Roland Mainz <roland.mainz@nrubsig.org>
  308. Date: Thu, 30 Oct 2025 13:06:14 +0100
  309. Subject: [PATCH 3/3] nfs41_build_features.h,sys: Allow pagefile.sys on NFSv4
  310.  filesystems
  311.  
  312. Allow pagefile.sys on NFSv4 filesystems.
  313.  
  314. Reported-by: Dan Shelton <dan.f.shelton@gmail.com>
  315. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  316. ---
  317.  nfs41_build_features.h   | 6 ++++++
  318.  sys/nfs41sys_openclose.c | 8 ++++++--
  319.  2 files changed, 12 insertions(+), 2 deletions(-)
  320.  
  321. diff --git a/nfs41_build_features.h b/nfs41_build_features.h
  322. index 274950b..94be0e2 100644
  323. --- a/nfs41_build_features.h
  324. +++ b/nfs41_build_features.h
  325. @@ -261,4 +261,10 @@
  326.   */
  327.  #define NFS41_DRIVER_HACK_HANDLE_NFS_DELAY_GRACE_WIP 1
  328.  
  329. +/*
  330. + * |NFS41_DRIVER_HACK_ENABLE_PAGEFILE_SUPPORT| - allow pagefile.sys
  331. + * files on NFSv4 filesystems.
  332. + */
  333. +#define NFS41_DRIVER_HACK_ENABLE_PAGEFILE_SUPPORT 1
  334. +
  335.  #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
  336. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  337. index ebb7490..9196aad 100644
  338. --- a/sys/nfs41sys_openclose.c
  339. +++ b/sys/nfs41sys_openclose.c
  340. @@ -507,10 +507,14 @@ NTSTATUS check_nfs41_create_args(
  341.          goto out;
  342.      }
  343.  
  344. -    if (FlagOn(Fcb->FcbState, FCB_STATE_PAGING_FILE )) {
  345. -        print_error("FCB_STATE_PAGING_FILE not implemented\n");
  346. +    if (FlagOn(Fcb->FcbState, FCB_STATE_PAGING_FILE)) {
  347. +#ifdef NFS41_DRIVER_HACK_ENABLE_PAGEFILE_SUPPORT
  348. +        DbgP("nfs41_Create: FCB_STATE_PAGING_FILE set\n");
  349. +#else
  350. +        print_error("nfs41_Create: FCB_STATE_PAGING_FILE not implemented\n");
  351.          status = STATUS_NOT_IMPLEMENTED;
  352.          goto out;
  353. +#endif /* NFS41_DRIVER_HACK_ENABLE_PAGEFILE_SUPPORT */
  354.      }
  355.  
  356.      if (!pNetRootContext->mounts_init) {
  357. --
  358. 2.51.0
  359.  
  360. From 22ca35c76a040b391b74b5d5d0cc2b2fca086977 Mon Sep 17 00:00:00 2001
  361. From: Roland Mainz <roland.mainz@nrubsig.org>
  362. Date: Fri, 31 Oct 2025 14:38:54 +0100
  363. Subject: [PATCH 1/2] tests: Add "Smb2" fields for winfsinfo
  364.  fileremoteprotocolinfo
  365.  
  366. Add "Smb2" fields for winfsinfo fileremoteprotocolinfo.
  367.  
  368. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  369. ---
  370.  tests/winfsinfo1/winfsinfo.c | 36 ++++++++++++++++++++++++++++++++++--
  371.  1 file changed, 34 insertions(+), 2 deletions(-)
  372.  
  373. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  374. index ca658dd..a7a9d17 100644
  375. --- a/tests/winfsinfo1/winfsinfo.c
  376. +++ b/tests/winfsinfo1/winfsinfo.c
  377. @@ -1162,7 +1162,7 @@ int get_file_remote_protocol_info(const char *progname, const char *filename)
  378.  #if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
  379.      /* ProtocolSpecificReserved */
  380.      (void)printf("\tcompound ProtocolSpecificReserved=(\n");
  381. -    (void)printf("\t\ttypeset -a Reserved=(\n");
  382. +    (void)printf("\t\ttypeset -l -i -a Reserved=(\n");
  383.      for (i=0 ; i < 16 ; i++) {
  384.          (void)printf("\t\t\t[%d]=0x%lx\n",
  385.              i,
  386. @@ -1173,7 +1173,39 @@ int get_file_remote_protocol_info(const char *progname, const char *filename)
  387.  #else
  388.      /* ProtocolSpecific */
  389.      (void)printf("\tcompound ProtocolSpecific=(\n");
  390. -    (void)printf("\t\ttypeset -a Reserved=(\n");
  391. +
  392. +    if (frpi.Protocol == WNNC_NET_SMB) {
  393. +        (void)printf("\t\tcompound Smb2=(\n");
  394. +        (void)printf("\t\t\tcompound Server=(\n");
  395. +        (void)printf("\t\t\t\tCapabilities=0x%lx\n",
  396. +            (unsigned long)frpi.ProtocolSpecific.Smb2.Server.Capabilities);
  397. +        (void)printf("\t\t\t)\n");
  398. +        (void)printf("\t\t\tcompound Share=(\n");
  399. +        (void)printf("\t\t\t\tCapabilities=0x%lx\n",
  400. +            (unsigned long)frpi.ProtocolSpecific.Smb2.Share.Capabilities);
  401. +        (void)printf("\t\t\t\tShareFlags=0x%lx\n",
  402. +            (unsigned long)frpi.ProtocolSpecific.Smb2.Share.ShareFlags);
  403. +#if 0 /* MinGW header do not have these fields yet */
  404. +        (void)printf("\t\t\t\tCachingFlags=0x%lx\n",
  405. +            (unsigned long)frpi.ProtocolSpecific.Smb2.Share.CachingFlags);
  406. +        (void)printf("\t\t\t\tShareType=%d\n",
  407. +            (int)frpi.ProtocolSpecific.Smb2.Share.ShareType);
  408. +
  409. +        (void)printf("\t\t\t\ttypeset -l -i -a Reserved0=(\n");
  410. +        for (i=0 ; i < 4 ; i++) {
  411. +            (void)printf("\t\t\t\t\t[%d]=0x%lx\n",
  412. +                i,
  413. +                (long)frpi.ProtocolSpecific.Smb2.Share.Reserved0[i]);
  414. +        }
  415. +        (void)printf("\t\t\t\t)\n");
  416. +        (void)printf("\t\t\t\tReserved1=0x%lx\n",
  417. +            (unsigned long)frpi.ProtocolSpecific.Smb2.Share.Reserved1);
  418. +#endif
  419. +        (void)printf("\t\t\t)\n");
  420. +        (void)printf("\t\t)\n");
  421. +    }
  422. +
  423. +    (void)printf("\t\ttypeset -l -i -a Reserved=(\n");
  424.      for (i=0 ; i < 16 ; i++) {
  425.          (void)printf("\t\t\t[%d]=0x%lx\n",
  426.              i,
  427. --
  428. 2.51.0
  429.  
  430. From dac3ed27aeba651c21a9da0702ff19b0aa7127ab Mon Sep 17 00:00:00 2001
  431. From: Roland Mainz <roland.mainz@nrubsig.org>
  432. Date: Fri, 31 Oct 2025 14:40:30 +0100
  433. Subject: [PATCH 2/2] tests: Fix 64bit kernel alignment issue when trying to
  434.  query FileRemoteProtocolinfo for SMB filesystem
  435.  
  436. Fix 64bit kernel alignment issue when trying to query
  437. FileRemoteProtocolinfo for SMB filesystem.
  438.  
  439. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  440. ---
  441.  tests/winfsinfo1/winfsinfo.c | 6 +++++-
  442.  1 file changed, 5 insertions(+), 1 deletion(-)
  443.  
  444. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  445. index a7a9d17..a7dad62 100644
  446. --- a/tests/winfsinfo1/winfsinfo.c
  447. +++ b/tests/winfsinfo1/winfsinfo.c
  448. @@ -1076,7 +1076,11 @@ int get_file_remote_protocol_info(const char *progname, const char *filename)
  449.  {
  450.      int res = EXIT_FAILURE;
  451.      bool ok;
  452. -    FILE_REMOTE_PROTOCOL_INFO frpi;
  453. +#ifdef _MSC_BUILD
  454. +    __declspec(align(16)) FILE_REMOTE_PROTOCOL_INFO frpi;
  455. +#else
  456. +    FILE_REMOTE_PROTOCOL_INFO frpi __attribute__((aligned(16)));
  457. +#endif
  458.      int i;
  459.      (void)memset(&frpi, 0, sizeof(frpi));
  460.  
  461. --
  462. 2.51.0
  463.  
  464. From 483a7649d3ad4ce3872f68ba21af14200704b84d Mon Sep 17 00:00:00 2001
  465. From: Roland Mainz <roland.mainz@nrubsig.org>
  466. Date: Mon, 3 Nov 2025 20:59:50 +0100
  467. Subject: [PATCH 1/3] tests: Document filedisk-sparse fork of bobranten's
  468.  filedisk-22
  469.  
  470. Document filedisk-sparse fork of bobranten's filedisk-22.
  471.  
  472. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  473. ---
  474.  tests/manual_testing.txt | 27 ++++++++++++++++++---------
  475.  1 file changed, 18 insertions(+), 9 deletions(-)
  476.  
  477. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  478. index 4a2d42d..57c9013 100644
  479. --- a/tests/manual_testing.txt
  480. +++ b/tests/manual_testing.txt
  481. @@ -1,5 +1,5 @@
  482.  #
  483. -# ms-nfs41-client manual testing sequence, 2025-11-01
  484. +# ms-nfs41-client manual testing sequence, 2025-11-03
  485.  #
  486.  # Draft version, needs to be turned into automated tests
  487.  # if possible
  488. @@ -1146,16 +1146,25 @@ mkdir testruns && cd testruns
  489.  # FileDisk
  490.  # (use plain files as disks, disk/CDROM images)
  491.  #
  492. +# Original version is 'https://www.accum.se/~bosse/filedisk/filedisk-22.zip',
  493. +# we use our fork which supports punching sparse file holes and minor other
  494. +# tweaks
  495. +#
  496. +
  497. +#
  498. +# build
  499. +#
  500. +export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/:$PATH"
  501. +git clone https://github.com/gisburn/filedisk-sparse.git
  502. +cd filedisk-sparse/
  503. +MSBuild.exe filedisk.sln -t:Build -p:Configuration=Debug -p:Platform=x64
  504.  
  505.  #
  506.  # install
  507.  #
  508. -wget 'https://www.accum.se/~bosse/filedisk/filedisk-22.zip'
  509. -unzip filedisk-22.zip
  510. -cd filedisk-22
  511. -cp ./sys/Release/x64/filedisk.sys /cygdrive/c/Windows/System32/drivers/.
  512. -cp ./sys/Release/x64/filedisk.pdb /cygdrive/c/Windows/System32/drivers/.
  513. -cp ./exe/Release/x64/filedisk.exe /cygdrive/c/Windows/.
  514. +cp ./sys/Debug/x64/filedisk.sys /cygdrive/c/Windows/System32/drivers/.
  515. +cp ./sys/Debug/x64/filedisk.pdb /cygdrive/c/Windows/System32/drivers/.
  516. +cp ./exe/Debug/x64/filedisk.exe /cygdrive/c/Windows/.
  517.  chmod a+rx /cygdrive/c/Windows/filedisk.exe
  518.  sc create filedisk binPath='C:\Windows\System32\drivers\filedisk.sys' type=kernel
  519.  
  520. @@ -1173,8 +1182,8 @@ filedisk /umount V:
  521.  # Create NTFS filesystem and use it
  522.  #
  523.  rm -f /cygdrive/n/winntfs_filedisk_001.img
  524. -filedisk /mount 2 'N:\winntfs_filedisk_001.img' 8192G U:
  525. -format.com U: /FS:NTFS "/V:NTFSonNFS4_001" /Q /X
  526. +filedisk /mount 2 'N:\winntfs_filedisk_001.img' 1T U:
  527. +format.com U: /FS:NTFS /A:8192 "/V:NTFSonNFS4_001" /Q /X
  528.  mkdir /cygdrive/u/test1 && cd /cygdrive/u/test1
  529.  rm -Rfv bash && time nice ksh93 /home/roland_mainz/work/msnfs41_uidmapping/ms-nfs41-client/tests/nfsbuildtest/nfsbuildtest.ksh93 bash build
  530.  cd
  531. --
  532. 2.51.0
  533.  
  534. From 47892e6cae791e87b486ed777f2d01bac9458886 Mon Sep 17 00:00:00 2001
  535. From: Roland Mainz <roland.mainz@nrubsig.org>
  536. Date: Mon, 3 Nov 2025 21:26:00 +0100
  537. Subject: [PATCH 2/3] README.md,docs: Document filedisk-sparse as alternative
  538.  to VHD/VHDX disks
  539.  
  540. Document filedisk-sparse as alternative to VHD/VHDX disks.
  541.  
  542. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  543. ---
  544.  README.md       | 10 ++++++++++
  545.  docs/README.xml |  9 +++++++++
  546.  2 files changed, 19 insertions(+)
  547.  
  548. diff --git a/README.md b/README.md
  549. index 8d34637..fd1ff44 100644
  550. --- a/README.md
  551. +++ b/README.md
  552. @@ -776,6 +776,16 @@ Within WSL mount UNC path returned by `/sbin/nfs_mount`
  553.        Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
  554.        Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
  555.  
  556. +- [VHD/VHDX
  557. +  disks](https://learn.microsoft.com/en-us/windows-server/storage/disk-management/manage-virtual-hard-disks)
  558. +  currently (Win10, Win11) cannot use files on ms-nfs41-client/NFSv4
  559. +  filesystems as storage. It seems the Windows code makes explicit
  560. +  checks for SMB filesystems, and rejects any non-SMB filesystems.
  561. +
  562. +  As an alternative `filedisk-sparse`
  563. +  (<https://github.com/gisburn/filedisk-sparse/>) can be used to mount
  564. +  (sparse) files as disks or CDROM images.
  565. +
  566.  # Troubleshooting && finding bugs/debugging
  567.  
  568.  - `nfsd_debug.exe` has the `-d` option to set a level for debug output.
  569. diff --git a/docs/README.xml b/docs/README.xml
  570. index a1dbd2c..56460d8 100644
  571. --- a/docs/README.xml
  572. +++ b/docs/README.xml
  573. @@ -875,6 +875,15 @@ konnten gespeichert werden. Daten gingen verloren.
  574.  Dieser Fehler wurde von dem Server zurueckgegeben, auf dem sich die
  575.  Datei befindet. Versuchen Sie, die Datei woanders zu speichern.</programlisting>
  576.        </listitem>
  577. +      <listitem>
  578. +        <para><link xl:href="https://learn.microsoft.com/en-us/windows-server/storage/disk-management/manage-virtual-hard-disks">VHD/VHDX disks</link>
  579. +        currently (Win10, Win11) cannot use files on ms-nfs41-client/NFSv4 filesystems as storage.
  580. +        It seems the Windows code makes explicit checks for SMB filesystems,
  581. +        and rejects any non-SMB filesystems.</para>
  582. +        <para>As an alternative <literal>filedisk-sparse</literal>
  583. +        (<link xl:href="https://github.com/gisburn/filedisk-sparse/">https://github.com/gisburn/filedisk-sparse/</link>)
  584. +        can be used to mount (sparse) files as disks or CDROM images.</para>
  585. +      </listitem>
  586.      </itemizedlist>
  587.    </section>
  588.  
  589. --
  590. 2.51.0
  591.  
  592. From 31409aa71b356ea42d1eee7cb106bc96ad80e47a Mon Sep 17 00:00:00 2001
  593. From: Roland Mainz <roland.mainz@nrubsig.org>
  594. Date: Mon, 3 Nov 2025 21:37:51 +0100
  595. Subject: [PATCH 3/3] README.md,docs: Add note about per-machine software
  596.  installations on filedisk-sparse
  597.  
  598. Add note about per-machine software installations on
  599. NTFS<-->filedisk-sparse<-->NFSv4-Client<-->NFS-Server.
  600.  
  601. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  602. ---
  603.  README.md       | 6 ++++++
  604.  docs/README.xml | 3 +++
  605.  2 files changed, 9 insertions(+)
  606.  
  607. diff --git a/README.md b/README.md
  608. index fd1ff44..2364154 100644
  609. --- a/README.md
  610. +++ b/README.md
  611. @@ -786,6 +786,12 @@ Within WSL mount UNC path returned by `/sbin/nfs_mount`
  612.    (<https://github.com/gisburn/filedisk-sparse/>) can be used to mount
  613.    (sparse) files as disks or CDROM images.
  614.  
  615. +  This can also be used to host per-machine software installations/data
  616. +  storage (e.g. use
  617. +  `filedisk /mount 35 'N:\winntfs_filedisk_003.img' S:` as global mount
  618. +  which require NTFS or ReFS, but should be physically hosted on the NFS
  619. +  server.
  620. +
  621.  # Troubleshooting && finding bugs/debugging
  622.  
  623.  - `nfsd_debug.exe` has the `-d` option to set a level for debug output.
  624. diff --git a/docs/README.xml b/docs/README.xml
  625. index 56460d8..d605c85 100644
  626. --- a/docs/README.xml
  627. +++ b/docs/README.xml
  628. @@ -883,6 +883,9 @@ Datei befindet. Versuchen Sie, die Datei woanders zu speichern.</programlisting>
  629.          <para>As an alternative <literal>filedisk-sparse</literal>
  630.          (<link xl:href="https://github.com/gisburn/filedisk-sparse/">https://github.com/gisburn/filedisk-sparse/</link>)
  631.          can be used to mount (sparse) files as disks or CDROM images.</para>
  632. +        <para>This can also be used to host per-machine software installations/data storage (e.g. use
  633. +        <command>filedisk /mount 35 'N:\winntfs_filedisk_003.img' S:</command> as global mount
  634. +        which require NTFS or ReFS, but should be physically hosted on the NFS server.</para>
  635.        </listitem>
  636.      </itemizedlist>
  637.    </section>
  638. --
  639. 2.51.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