pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for MSYS2/Cygwin instructions, increasing BYTES_PER_SECTOR, tests+misc, 2025-04-08
Posted by Anonymous on Tue 8th Apr 2025 17:49
raw | new post

  1. From d02077fd60d22f27dc211ee0bbf6c50ae3a66af1 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Tue, 8 Apr 2025 15:16:11 +0200
  4. Subject: [PATCH 1/6] tests: Require autoconf+automake for building gcc+bash
  5.  
  6. Require Cygwin/MSYS2 autoconf+automake packages for building gcc+bash
  7.  
  8. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  9. ---
  10. tests/manual_testing.txt              | 6 +++++-
  11.  tests/nfsbuildtest/nfsbuildtest.ksh93 | 4 ++++
  12.  2 files changed, 9 insertions(+), 1 deletion(-)
  13.  
  14. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  15. index 8f0fbdd..20106b0 100644
  16. --- a/tests/manual_testing.txt
  17. +++ b/tests/manual_testing.txt
  18. @@ -1,5 +1,5 @@
  19.  #
  20. -# ms-nfs41-client manual testing sequence, 2025-03-20
  21. +# ms-nfs41-client manual testing sequence, 2025-04-08
  22.  #
  23.  # Draft version, needs to be turned into automated tests
  24.  # if possible
  25. @@ -18,6 +18,8 @@
  26.  #   gdb
  27.  #   make
  28.  #   bmake
  29. +#   autoconf
  30. +#   automake
  31.  #   netpbm
  32.  #   attr
  33.  #   git
  34. @@ -54,6 +56,8 @@
  35.  #   (install with $ pacman -S --noconfirm ${name_of_package} # (use space to separate package names)
  36.  #   ---- snip ----
  37.  #   base-devel
  38. +#   autoconf
  39. +#   automake
  40.  #   gcc
  41.  #   clang
  42.  #   sed
  43. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  44. index f211850..d4e7d7a 100644
  45. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  46. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  47. @@ -607,6 +607,8 @@ function main
  48.                         is_toolkit_pkg_installed itp 'libmpc-devel' || (( errc++ ))
  49.                         is_toolkit_pkg_installed itp 'libintl-devel' || (( errc++ ))
  50.                         is_toolkit_pkg_installed itp 'libisl-devel' || (( errc++ ))
  51. +                       is_toolkit_pkg_installed itp 'autoconf' || (( errc++ ))
  52. +                       is_toolkit_pkg_installed itp 'automake' || (( errc++ ))
  53.                         is_toolkit_pkg_installed itp 'gettext' || (( errc++ ))
  54.                         is_toolkit_pkg_installed itp 'gettext-devel' || (( errc++ ))
  55.                         (( errc > 0 )) && return 1
  56. @@ -626,6 +628,8 @@ function main
  57.                         is_toolkit_pkg_installed itp 'git' || (( errc++ ))
  58.                         is_toolkit_pkg_installed itp 'gcc-core' || (( errc++ ))
  59.                         is_toolkit_pkg_installed itp 'gcc-g++' || (( errc++ ))
  60. +                       is_toolkit_pkg_installed itp 'autoconf' || (( errc++ ))
  61. +                       is_toolkit_pkg_installed itp 'automake' || (( errc++ ))
  62.                         if is_cygwin ; then
  63.                                 if (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
  64.                                         print '# bash_build: Using Cygwin >= 3.5 config'
  65. --
  66. 2.45.1
  67.  
  68. From 568b25a8d479bf5694642dd8c863ec34a8e75475 Mon Sep 17 00:00:00 2001
  69. From: Roland Mainz <roland.mainz@nrubsig.org>
  70. Date: Tue, 8 Apr 2025 15:23:49 +0200
  71. Subject: [PATCH 2/6] cygwin,tests: Update MSYS2 installation info
  72.  
  73. Update MSYS2 installation info.
  74.  
  75. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  76. ---
  77. cygwin/README.bintarball.txt | 10 ++++++----
  78.  tests/manual_testing.txt     |  8 ++++----
  79.  2 files changed, 10 insertions(+), 8 deletions(-)
  80.  
  81. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  82. index bfa378d..21b6e38 100644
  83. --- a/cygwin/README.bintarball.txt
  84. +++ b/cygwin/README.bintarball.txt
  85. @@ -199,6 +199,8 @@ NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019+2022
  86.          emacs
  87.          gdb
  88.          make
  89. +        autoconf
  90. +        automake
  91.          gettext
  92.          gettext-devel
  93.          git
  94. @@ -264,15 +266,15 @@ setup-x86.exe --allow-unsupported-windows -q --no-verify --site "http://ctm.crou
  95.  # 1. Download&&install from Cygwin
  96.  # ---- snip ----
  97.  mkdir -p download && cd download
  98. -wget 'https://github.com/msys2/msys2-installer/releases/download/2024-11-16/msys2-x86_64-20241116.exe'
  99. -chmod a+x msys2-x86_64-20241116.exe
  100. -./msys2-x86_64-20241116 --default-answer --root 'C:\msys64' install
  101. +wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
  102. +chmod a+x 'msys2-x86_64-20250221'
  103. +./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
  104.  # ---- snip ----
  105.  
  106.  # 2. Install extra packages:
  107.  # Start MSYS2 UCRT mintty and execute this:
  108.  # ---- snip ----
  109. -pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel
  110. +pacman -S --noconfirm base-devel gcc clang sed time coreutils util-linux grep sed emacs gdb make autoconf automake gettext gettext-devel git subversion flex bison unzip pax tar libiconv-devel ncurses-devel gmp-devel mpfr-devel mpc-devel isl-devel procps-ng libiconv-devel
  111.  # ---- snip ----
  112.  
  113.  
  114. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  115. index 20106b0..0141a80 100644
  116. --- a/tests/manual_testing.txt
  117. +++ b/tests/manual_testing.txt
  118. @@ -49,11 +49,11 @@
  119.  # - MSYS2 environment:
  120.  #   - Install the env with:
  121.  #   $ mkdir -p download && cd download
  122. -#   $ wget 'https://github.com/msys2/msys2-installer/releases/download/2024-11-16/msys2-x86_64-20241116.exe'
  123. -#   $ chmod a+x msys2-x86_64-20241116.exe
  124. -#   $ ./msys2-x86_64-20241116 --default-answer --root 'C:\msys64' install
  125. +#   $ wget 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'
  126. +#   $ chmod a+x 'msys2-x86_64-20250221'
  127. +#   $ ./msys2-x86_64-20250221 --default-answer --root 'C:\msys64' install
  128.  #   - The following MSYS2 packages should be installed for running the tests with MSYS2:
  129. -#   (install with $ pacman -S --noconfirm ${name_of_package} # (use space to separate package names)
  130. +#   (install with $ pacman -S --noconfirm ${name_of_package} # (use <space> to separate package names)
  131.  #   ---- snip ----
  132.  #   base-devel
  133.  #   autoconf
  134. --
  135. 2.45.1
  136.  
  137. From 93f77853393f3d6d729450abd5c2e7c1bca2fe74 Mon Sep 17 00:00:00 2001
  138. From: Dan Shelton <dan.f.shelton@gmail.com>
  139. Date: Tue, 8 Apr 2025 15:33:03 +0200
  140. Subject: [PATCH 3/6] tests: winfsinfo fileremoteprotocolinfo should prefix hex
  141.  values with 0x
  142.  
  143. winfsinfo fileremoteprotocolinfo should prefix hex values with 0x
  144.  
  145. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  146. ---
  147. tests/winfsinfo1/winfsinfo.c | 6 +++---
  148.  1 file changed, 3 insertions(+), 3 deletions(-)
  149.  
  150. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  151. index 10616ed..1d2989a 100644
  152. --- a/tests/winfsinfo1/winfsinfo.c
  153. +++ b/tests/winfsinfo1/winfsinfo.c
  154. @@ -943,7 +943,7 @@ bool get_file_remote_protocol_info(const char *progname, const char *filename)
  155.      (void)printf("\tcompound GenericReserved=(\n");
  156.      (void)printf("\t\ttypeset -a Reserved=(\n");
  157.      for (i=0 ; i < 8 ; i++) {
  158. -        (void)printf("\t\t\t[%d]=%lx\n",
  159. +        (void)printf("\t\t\t[%d]=0x%lx\n",
  160.              i,
  161.              (long)frpi.GenericReserved.Reserved[i]);
  162.      }
  163. @@ -955,7 +955,7 @@ bool get_file_remote_protocol_info(const char *progname, const char *filename)
  164.      (void)printf("\tcompound ProtocolSpecificReserved=(\n");
  165.      (void)printf("\t\ttypeset -a Reserved=(\n");
  166.      for (i=0 ; i < 16 ; i++) {
  167. -        (void)printf("\t\t\t[%d]=%lx\n",
  168. +        (void)printf("\t\t\t[%d]=0x%lx\n",
  169.              i,
  170.              (long)frpi.ProtocolSpecificReserved.Reserved[i]);
  171.      }
  172. @@ -966,7 +966,7 @@ bool get_file_remote_protocol_info(const char *progname, const char *filename)
  173.      (void)printf("\tcompound ProtocolSpecific=(\n");
  174.      (void)printf("\t\ttypeset -a Reserved=(\n");
  175.      for (i=0 ; i < 16 ; i++) {
  176. -        (void)printf("\t\t\t[%d]=%lx\n",
  177. +        (void)printf("\t\t\t[%d]=0x%lx\n",
  178.              i,
  179.              (long)frpi.ProtocolSpecific.Reserved[i]);
  180.      }
  181. --
  182. 2.45.1
  183.  
  184. From f5d19d9fc25acaccdcc77fdfa164024db77ceb90 Mon Sep 17 00:00:00 2001
  185. From: Dan Shelton <dan.f.shelton@gmail.com>
  186. Date: Tue, 8 Apr 2025 15:37:01 +0200
  187. Subject: [PATCH 4/6] dll: nfs41_np should prefix hex values in debug messages
  188.  with 0x
  189.  
  190. nfs41_np should prefix hex values in debug messages with 0x
  191.  
  192. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  193. ---
  194. dll/nfs41_np.c | 4 ++--
  195.  1 file changed, 2 insertions(+), 2 deletions(-)
  196.  
  197. diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
  198. index 0943164..1db6d54 100644
  199. --- a/dll/nfs41_np.c
  200. +++ b/dll/nfs41_np.c
  201. @@ -850,7 +850,7 @@ NPCancelConnection(
  202.                              &CopyBytes);
  203.  
  204.                  if (Status != WN_SUCCESS) {
  205. -                    DbgP((L"SendToMiniRdr returned Status %lx\n",
  206. +                    DbgP((L"SendToMiniRdr returned Status 0x%lx\n",
  207.                          Status));
  208.                      break;
  209.                  }
  210. @@ -886,7 +886,7 @@ NPCancelConnection(
  211.                              &CopyBytes);
  212.  
  213.                  if (Status != WN_SUCCESS) {
  214. -                    DbgP((L"SendToMiniRdr returned Status %lx\n",
  215. +                    DbgP((L"SendToMiniRdr returned Status 0x%lx\n",
  216.                          Status));
  217.                      break;
  218.                  }
  219. --
  220. 2.45.1
  221.  
  222. From c11917644df3ad0041367b7c6e034261b2f5c79a Mon Sep 17 00:00:00 2001
  223. From: Roland Mainz <roland.mainz@nrubsig.org>
  224. Date: Tue, 8 Apr 2025 16:03:26 +0200
  225. Subject: [PATCH 5/6] daemon: Remove |FILE_SUPPORTS_REMOTE_STORAGE| from volume
  226.  flags
  227.  
  228. Remove Remove |FILE_SUPPORTS_REMOTE_STORAGE| from volume flags,
  229. this is for HSM.
  230.  
  231. Fixes: https://cygwin.com/pipermail/cygwin/2025-April/257885.html
  232. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  233. ---
  234. daemon/nfs41_superblock.c | 10 +++++++++-
  235.  1 file changed, 9 insertions(+), 1 deletion(-)
  236.  
  237. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  238. index b73cf45..db75c09 100644
  239. --- a/daemon/nfs41_superblock.c
  240. +++ b/daemon/nfs41_superblock.c
  241. @@ -170,9 +170,17 @@ void nfs41_superblock_fs_attributes(
  242.      IN const nfs41_superblock *superblock,
  243.      OUT PFILE_FS_ATTRIBUTE_INFORMATION FsAttrs)
  244.  {
  245. +    /*
  246. +     * |FileSystemAttributes| - general filesystem attributes
  247. +     *
  248. +     * Notes:
  249. +     * - |FILE_SUPPORTS_REMOTE_STORAGE| can only be set if we are on
  250. +     * HSM storage (tape worm etc.), see
  251. +     * https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/d4bc551b-7aaf-4b4f-ba0e-3a75e7c528f0#Appendix_A_167
  252. +     */
  253. +
  254.      FsAttrs->FileSystemAttributes = 0;
  255.      FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_SPARSE_FILES;
  256. -    FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_REMOTE_STORAGE;
  257.      /* NFSv4 protocol uses Unicode by default */
  258.      FsAttrs->FileSystemAttributes |= FILE_UNICODE_ON_DISK;
  259.  
  260. --
  261. 2.45.1
  262.  
  263. From a30198628c3a443f44a5f30d3b20bcf3bf79ec2e Mon Sep 17 00:00:00 2001
  264. From: Roland Mainz <roland.mainz@nrubsig.org>
  265. Date: Tue, 8 Apr 2025 16:44:44 +0200
  266. Subject: [PATCH 6/6] daemon: Increase volume |BYTES_PER_SECTOR| to |1024|
  267.  
  268. Increase volume |BYTES_PER_SECTOR| from |512| to |1024|.
  269. NFSv4 has no way to query the block size for a filesystem,
  270. because each file can technically have it's own block size or a
  271. variable block size.
  272. Since 512bytes has become increasily rare we just use 1kb.
  273.  
  274. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  275. ---
  276. daemon/volume.c | 2 +-
  277.  1 file changed, 1 insertion(+), 1 deletion(-)
  278.  
  279. diff --git a/daemon/volume.c b/daemon/volume.c
  280. index f18e902..c26d062 100644
  281. --- a/daemon/volume.c
  282. +++ b/daemon/volume.c
  283. @@ -34,7 +34,7 @@
  284.  /* windows volume queries want size in 'units', so we have to
  285.   * convert the nfs space_* attributes from bytes to units */
  286.  #define SECTORS_PER_UNIT    8
  287. -#define BYTES_PER_SECTOR    512
  288. +#define BYTES_PER_SECTOR    1024
  289.  #define BYTES_PER_UNIT      (SECTORS_PER_UNIT * BYTES_PER_SECTOR)
  290.  
  291.  #define TO_UNITS(bytes) (bytes / BYTES_PER_UNIT)
  292. --
  293. 2.45.1

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