pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for winfsinfo queryallocatedranges, queryallocatedranges length limit fix, tests+misc, 2025-02-26
Posted by Anonymous on Wed 26th Feb 2025 18:15
raw | new post

  1. From 68c8e775425c7693338c5ea5be226d9becf97082 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 26 Feb 2025 16:45:47 +0100
  4. Subject: [PATCH 1/3] tests: Add winfsinfo "fsctlqueryallocatedranges" subcmd
  5.  
  6. Add winfsinfo "fsctlqueryallocatedranges" subcmd, and
  7. use it in "testsparsefile1.ksh"
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. tests/sparsefiles/testsparsefile1.ksh |  76 +++++++-----
  12.  tests/winfsinfo1/winfsinfo.c          | 160 +++++++++++++++++++++++++-
  13.  2 files changed, 204 insertions(+), 32 deletions(-)
  14.  
  15. diff --git a/tests/sparsefiles/testsparsefile1.ksh b/tests/sparsefiles/testsparsefile1.ksh
  16. index 293ade9..b541849 100644
  17. --- a/tests/sparsefiles/testsparsefile1.ksh
  18. +++ b/tests/sparsefiles/testsparsefile1.ksh
  19. @@ -35,6 +35,7 @@ function test_sparse_holeonly_dd
  20.  {
  21.      set -o errexit
  22.      set -o nounset
  23. +    set -o pipefail
  24.      #set -o xtrace
  25.  
  26.      rm -f 'sparse_file_hole_only'
  27. @@ -45,20 +46,23 @@ function test_sparse_holeonly_dd
  28.      /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only'
  29.  
  30.      integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only' | wc -l)"
  31. +    integer winfsinfo_num_data_sections="$(winfsinfo fsctlqueryallocatedranges 'sparse_file_hole_only' | wc -l)"
  32.  
  33.      #
  34.      # test whether the file is OK
  35.      #
  36. -    if (( fsutil_num_data_sections != 0 )) ; then
  37. -        printf "# TEST failed, found %d data sections, expceted %d\n" \
  38. +    if (( (fsutil_num_data_sections != 0) || (winfsinfo_num_data_sections != 0) )) ; then
  39. +        printf "# TEST failed, found fsutil=%d/winfsinfo=%d data sections, expected %d\n" \
  40.              fsutil_num_data_sections \
  41. +            winfsinfo_num_data_sections \
  42.              0
  43.          return 1
  44.      fi
  45.  
  46. -    printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
  47. +    printf "\n#\n# TEST %q OK, found fsutil=%d/winfsinfo=%d data sections\n#\n" \
  48.          "$0" \
  49. -        fsutil_num_data_sections
  50. +        fsutil_num_data_sections \
  51. +        winfsinfo_num_data_sections
  52.  
  53.      return 0
  54.  }
  55. @@ -69,30 +73,33 @@ function test_sparse_holeonly_truncate
  56.      set -o nounset
  57.      #set -o xtrace
  58.  
  59. -    rm -f 'sparse_file_hole_only'
  60. -    touch 'sparse_file_hole_only'
  61. -    chattr -V +S 'sparse_file_hole_only'
  62. +    rm -f 'sparse_file_hole_only_trunc'
  63. +    touch 'sparse_file_hole_only_trunc'
  64. +    chattr -V +S 'sparse_file_hole_only_trunc'
  65.  
  66. -    truncate -s $((256*1024*1024)) 'sparse_file_hole_only'
  67. +    truncate -s $((256*1024*1024)) 'sparse_file_hole_only_trunc'
  68.  
  69. -    ls -l 'sparse_file_hole_only'
  70. -    /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only'
  71. +    ls -l 'sparse_file_hole_only_trunc'
  72. +    /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only_trunc'
  73.  
  74. -    integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only' | wc -l)"
  75. +    integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_hole_only_trunc' | wc -l)"
  76. +    integer winfsinfo_num_data_sections="$(winfsinfo fsctlqueryallocatedranges 'sparse_file_hole_only_trunc' | wc -l)"
  77.  
  78.      #
  79.      # test whether the file is OK
  80.      #
  81. -    if (( fsutil_num_data_sections != 0 )) ; then
  82. -        printf "# TEST failed, found %d data sections, expceted %d\n" \
  83. +    if (( (fsutil_num_data_sections != 0) || (winfsinfo_num_data_sections != 0) )) ; then
  84. +        printf "# TEST failed, found fsutil=%d/winfsinfo=%d data sections, expected %d\n" \
  85.              fsutil_num_data_sections \
  86. +            winfsinfo_num_data_sections \
  87.              0
  88.          return 1
  89.      fi
  90.  
  91. -    printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
  92. +    printf "\n#\n# TEST %q OK, found fsutil=%d/winfsinfo=%d data sections\n#\n" \
  93.          "$0" \
  94. -        fsutil_num_data_sections
  95. +        fsutil_num_data_sections \
  96. +        winfsinfo_num_data_sections
  97.  
  98.      return 0
  99.  }
  100. @@ -111,20 +118,23 @@ function test_normal_file
  101.      /cygdrive/c/Windows/system32/fsutil sparse queryrange 'test_normal_file'
  102.  
  103.      integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'test_normal_file' | wc -l)"
  104. +    integer winfsinfo_num_data_sections="$(winfsinfo fsctlqueryallocatedranges 'test_normal_file' | wc -l)"
  105.  
  106.      #
  107.      # test whether the file is OK
  108.      #
  109. -    if (( fsutil_num_data_sections != 1 )) ; then
  110. -        printf "# TEST failed, found %d data sections, expceted %d\n" \
  111. +    if (( (fsutil_num_data_sections != 1) || (winfsinfo_num_data_sections != 1) )) ; then
  112. +        printf "# TEST failed, found fsutil=%d/winfsinfo=%d data sections, expected %d\n" \
  113.              fsutil_num_data_sections \
  114. -            0
  115. +            winfsinfo_num_data_sections \
  116. +            1
  117.          return 1
  118.      fi
  119.  
  120. -    printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
  121. +    printf "\n#\n# TEST %q OK, found fsutil=%d/winfsinfo=%d data sections\n#\n" \
  122.          "$0" \
  123. -        fsutil_num_data_sections
  124. +        fsutil_num_data_sections \
  125. +        winfsinfo_num_data_sections
  126.  
  127.      return 0
  128.  }
  129. @@ -192,21 +202,25 @@ function test_multihole_sparsefile1
  130.      /cygdrive/c/Windows/system32/fsutil sparse queryrange 'mysparsefile'
  131.  
  132.      integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'mysparsefile' | wc -l)"
  133. +    integer winfsinfo_num_data_sections="$(winfsinfo fsctlqueryallocatedranges 'mysparsefile' | wc -l)"
  134.  
  135.  
  136.      #
  137.      # test whether the file is OK
  138.      #
  139. -    if (( fsutil_num_data_sections != (c.end_data_section-c.start_data_section) )) ; then
  140. -        printf "# TEST failed, found %d data sections, expceted %d\n" \
  141. +    if (( (fsutil_num_data_sections != (c.end_data_section-c.start_data_section)) || \
  142. +        (winfsinfo_num_data_sections != (c.end_data_section-c.start_data_section)) )) ; then
  143. +        printf "# TEST failed, found fsutil=%d/winfsinfo=%d data sections, expected %d\n" \
  144.              fsutil_num_data_sections \
  145. +            winfsinfo_num_data_sections \
  146.              $((c.end_data_section-c.start_data_section))
  147.          return 1
  148.      fi
  149.  
  150. -    printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
  151. +    printf "\n#\n# TEST %q OK, found fsutil=%d/winfsinfo=%d data sections\n#\n" \
  152.          "$0" \
  153. -        fsutil_num_data_sections
  154. +        fsutil_num_data_sections \
  155. +        winfsinfo_num_data_sections
  156.      return 0
  157.  }
  158.  
  159. @@ -231,21 +245,23 @@ function test_sparse_punchhole1
  160.      /cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_punchhole'
  161.  
  162.      integer fsutil_num_data_sections="$(/cygdrive/c/Windows/system32/fsutil sparse queryrange 'sparse_file_punchhole' | wc -l)"
  163. +    integer winfsinfo_num_data_sections="$(winfsinfo fsctlqueryallocatedranges 'sparse_file_punchhole' | wc -l)"
  164.  
  165.      #
  166.      # test whether the file is OK
  167.      #
  168. -    if (( fsutil_num_data_sections != 2 )) ; then
  169. -        printf "# TEST %q failed, found %d data sections, expceted %d\n" \
  170. -            "$0" \
  171. +    if (( (fsutil_num_data_sections != 2) || (winfsinfo_num_data_sections != 2) )) ; then
  172. +        printf "# TEST failed, found fsutil=%d/winfsinfo=%d data sections, expected %d\n" \
  173.              fsutil_num_data_sections \
  174. +            winfsinfo_num_data_sections \
  175.              2
  176.          return 1
  177.      fi
  178.  
  179. -    printf "\n#\n# TEST %q OK, found %d data sections\n#\n" \
  180. +    printf "\n#\n# TEST %q OK, found fsutil=%d/winfsinfo=%d data sections\n#\n" \
  181.          "$0" \
  182. -        fsutil_num_data_sections
  183. +        fsutil_num_data_sections \
  184. +        winfsinfo_num_data_sections
  185.  
  186.      return 0
  187.  }
  188. @@ -256,8 +272,6 @@ function test_sparse_punchhole1
  189.  #
  190.  set -o errexit
  191.  
  192. -PATH='/bin:/usr/bin'
  193. -
  194.  builtin basename
  195.  builtin rm
  196.  builtin wc
  197. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  198. index 4772428..6415476 100644
  199. --- a/tests/winfsinfo1/winfsinfo.c
  200. +++ b/tests/winfsinfo1/winfsinfo.c
  201. @@ -981,6 +981,160 @@ done:
  202.      return res;
  203.  }
  204.  
  205. +static
  206. +int fsctlqueryallocatedranges(const char *progname, const char *filename)
  207. +{
  208. +    HANDLE hFile;
  209. +
  210. +    FILE_STANDARD_INFO finfo;
  211. +    bool ok;
  212. +
  213. +    DWORD bytesReturned = 0;
  214. +    size_t max_ranges_per_query = 2;
  215. +    PFILE_ALLOCATED_RANGE_BUFFER ranges = NULL;
  216. +    FILE_ALLOCATED_RANGE_BUFFER inputBuffer;
  217. +    /*
  218. +     * |lastReturnedRange| - We start counting at |1| for
  219. +     * compatibility with "fsutil sparse queryrange"
  220. +     */
  221. +    size_t lastReturnedRange = 1;
  222. +    int retval = 0;
  223. +    size_t i;
  224. +    size_t cycle;
  225. +    DWORD numRangesReturned;
  226. +    DWORD lasterr;
  227. +
  228. +    (void)memset(&finfo, 0, sizeof(finfo));
  229. +
  230. +    ranges = malloc((sizeof(FILE_ALLOCATED_RANGE_BUFFER) * max_ranges_per_query));
  231. +    if (ranges == NULL) {
  232. +        (void)fprintf(stderr, "%s: Error out of memory\n", progname);
  233. +        return 1;
  234. +    }
  235. +
  236. +    hFile = CreateFileA(filename,
  237. +        GENERIC_READ,
  238. +        FILE_SHARE_READ,
  239. +        NULL,
  240. +        OPEN_EXISTING,
  241. +        FILE_ATTRIBUTE_NORMAL,
  242. +        NULL);
  243. +    if (hFile == INVALID_HANDLE_VALUE) {
  244. +        (void)fprintf(stderr,
  245. +            "%s: Error opening file '%s', lasterr=%d\n",
  246. +            progname,
  247. +            filename,
  248. +            (int)GetLastError());
  249. +        return 1;
  250. +    }
  251. +
  252. +    ok = GetFileInformationByHandleEx(hFile, FileStandardInfo, &finfo,
  253. +        sizeof(finfo));
  254. +    if (!ok) {
  255. +        (void)fprintf(stderr, "%s: GetFileInformationByHandleEx() "
  256. +            "error. GetLastError()==%d.\n",
  257. +            progname,
  258. +            (int)GetLastError());
  259. +        retval = 1;
  260. +        goto out;
  261. +    }
  262. +
  263. +    inputBuffer.FileOffset.QuadPart = 0ULL;
  264. +    /*
  265. +     * Set |inputBuffer.Length.QuadPart| to a value to query all
  266. +     * data ranges in a file
  267. +     *
  268. +     * Notes:
  269. +     * - |FILE_STANDARD_INFO.AllocationSize| can be zero on some
  270. +     * filesystems, smaller than |FILE_STANDARD_INFO.EndOfFile|
  271. +     * for sparse files and larger than
  272. +     * |FILE_STANDARD_INFO.EndOfFile| for normal files, or value
  273. +     * set by an user
  274. +     * - Also add 1GB (0x40000000) to test the API
  275. +     */
  276. +    inputBuffer.Length.QuadPart =
  277. +        max(finfo.AllocationSize.QuadPart,
  278. +            finfo.EndOfFile.QuadPart) +
  279. +        0x40000000;
  280. +
  281. +    for (cycle = 0 ; ; cycle ++) {
  282. +retry_fsctl:
  283. +        if (!DeviceIoControl(hFile,
  284. +            FSCTL_QUERY_ALLOCATED_RANGES,
  285. +            &inputBuffer,  1*sizeof(FILE_ALLOCATED_RANGE_BUFFER),
  286. +            ranges, (sizeof(FILE_ALLOCATED_RANGE_BUFFER) * max_ranges_per_query),
  287. +            &bytesReturned,
  288. +            NULL)) {
  289. +            lasterr = GetLastError();
  290. +            if (lasterr == ERROR_MORE_DATA) {
  291. +                /*
  292. +                 * Windows BUG: NTFS on Win10 returns the number of
  293. +                 * bytes we passed in, not the number of bytes which
  294. +                 * we should allocate
  295. +                 */
  296. +                max_ranges_per_query+=2;
  297. +                ranges = realloc(ranges,
  298. +                    (sizeof(FILE_ALLOCATED_RANGE_BUFFER) * max_ranges_per_query));
  299. +                if (ranges == NULL) {
  300. +                    (void)fprintf(stderr, "%s: Error out of memory\n",
  301. +                        progname);
  302. +                    retval = 1;
  303. +                    goto out;
  304. +                }
  305. +
  306. +                /* |memset(..., 0, ...)| only here for debuging */
  307. +                (void)memset(ranges, 0, sizeof(FILE_ALLOCATED_RANGE_BUFFER) * max_ranges_per_query);
  308. +                goto retry_fsctl;
  309. +            }
  310. +
  311. +            retval = 1;
  312. +            goto out;
  313. +        }
  314. +
  315. +        numRangesReturned = bytesReturned / sizeof(FILE_ALLOCATED_RANGE_BUFFER);
  316. +
  317. +        if (numRangesReturned > 0) {
  318. +            /*
  319. +             * If we do more than one query make sure the data range
  320. +             * offset we used to start the next query is the same
  321. +             * as the first returned data range (both should be
  322. +             * identical in offset)
  323. +             */
  324. +            if (cycle > 0) {
  325. +                if ((ranges[0].FileOffset.QuadPart != inputBuffer.FileOffset.QuadPart)) {
  326. +                    (void)fprintf(stderr,
  327. +                        "%s: Internal error: Restart query did not return "
  328. +                        "the same data range offset\n",
  329. +                        progname);
  330. +                    retval = 1;
  331. +                    goto out;
  332. +                }
  333. +            }
  334. +
  335. +            for (i = 0; i < numRangesReturned; i++) {
  336. +                if ((i < max_ranges_per_query) &&
  337. +                    ((cycle > 0)?(i > 0):true)) {
  338. +                    (void)printf("Data range[%ld]: Offset: 0x%llx, Length: 0x%llx\n",
  339. +                        (unsigned long)lastReturnedRange++,
  340. +                        (unsigned long long)ranges[i].FileOffset.QuadPart,
  341. +                        (unsigned long long)ranges[i].Length.QuadPart);
  342. +                }
  343. +            }
  344. +
  345. +            inputBuffer.FileOffset.QuadPart = ranges[i-1].FileOffset.QuadPart;
  346. +        }
  347. +
  348. +        /* Done ? */
  349. +        if (numRangesReturned < max_ranges_per_query)
  350. +            break;
  351. +    }
  352. +
  353. +out:
  354. +    (void)CloseHandle(hFile);
  355. +    return retval;
  356. +}
  357. +
  358. +
  359.  static
  360.  void usage(void)
  361.  {
  362. @@ -997,7 +1151,8 @@ void usage(void)
  363.          "filecasesensitiveinfo|"
  364.          "getfiletime|"
  365.          "nfs3attr|"
  366. -        "fileremoteprotocolinfo"
  367. +        "fileremoteprotocolinfo|"
  368. +        "fsctlqueryallocatedranges"
  369.          "> path\n");
  370.  }
  371.  
  372. @@ -1056,6 +1211,9 @@ int main(int ac, char *av[])
  373.      else if (!strcmp(subcmd, "fileremoteprotocolinfo")) {
  374.          return get_file_remote_protocol_info(av[0], av[2]);
  375.      }
  376. +    else if (!strcmp(subcmd, "fsctlqueryallocatedranges")) {
  377. +        return fsctlqueryallocatedranges(av[0], av[2]);
  378. +    }
  379.      else {
  380.          (void)fprintf(stderr, "%s: Unknown subcmd '%s'\n", av[0], subcmd);
  381.          return EXIT_FAILURE;
  382. --
  383. 2.45.1
  384.  
  385. From 9a730fb4f446eabe61433f66e6e735e5ff66b136 Mon Sep 17 00:00:00 2001
  386. From: Roland Mainz <roland.mainz@nrubsig.org>
  387. Date: Wed, 26 Feb 2025 16:48:52 +0100
  388. Subject: [PATCH 2/3] daemon: |FSCTL_QUERY_ALLOCATED_RANGES| should limit it's
  389.  search to the given length
  390.  
  391. |FSCTL_QUERY_ALLOCATED_RANGES| should limit it's search for more data
  392. ranges to the given |FILE_ALLOCATED_RANGE_BUFFER.Length|.
  393.  
  394. Reported-by: Lionel Cons <lionelcons1972@gmail.com>
  395. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  396. ---
  397. daemon/fsctl.c | 16 ++++++++++++++++
  398.  1 file changed, 16 insertions(+)
  399.  
  400. diff --git a/daemon/fsctl.c b/daemon/fsctl.c
  401. index dfff5a4..12fc2ce 100644
  402. --- a/daemon/fsctl.c
  403. +++ b/daemon/fsctl.c
  404. @@ -58,6 +58,7 @@ out:
  405.  static
  406.  int query_sparsefile_datasections(nfs41_open_state *state,
  407.      uint64_t start_offset,
  408. +    uint64_t end_offset,
  409.      FILE_ALLOCATED_RANGE_BUFFER *outbuffer,
  410.      size_t out_maxrecords,
  411.      size_t *restrict res_num_records)
  412. @@ -175,7 +176,21 @@ int query_sparsefile_datasections(nfs41_open_state *state,
  413.          outbuffer[i].Length.QuadPart = data_size;
  414.          (*res_num_records)++;
  415.  
  416. +        if (outbuffer[i].FileOffset.QuadPart > end_offset) {
  417. +            DPRINTF(QARLVL,
  418. +                ("end offset reached, "
  419. +                "outbuffer[%d].FileOffset.QuadPart(=%lld) > end_offset(=%lld)\n",
  420. +                (int)i,
  421. +                (long long)outbuffer[i].FileOffset.QuadPart,
  422. +                (long long)end_offset));
  423. +            break;
  424. +        }
  425. +
  426.          if (data_seek_sr_eof || hole_seek_sr_eof) {
  427. +            DPRINTF(QARLVL,
  428. +                ("EOF reached (data_seek_sr_eof=%d, hole_seek_sr_eof=%d)\n",
  429. +                (int)data_seek_sr_eof,
  430. +                (int)hole_seek_sr_eof));
  431.              break;
  432.          }
  433.      }
  434. @@ -223,6 +238,7 @@ int handle_queryallocatedranges(void *daemon_context,
  435.  
  436.      status = query_sparsefile_datasections(state,
  437.          args->inrange.FileOffset.QuadPart,
  438. +        args->inrange.FileOffset.QuadPart+args->inrange.Length.QuadPart,
  439.          outbuffer,
  440.          num_records,
  441.          &res_num_records);
  442. --
  443. 2.45.1
  444.  
  445. From f0c95fcc2debb40ab65932e5339fb92e51cb523b Mon Sep 17 00:00:00 2001
  446. From: Roland Mainz <roland.mainz@nrubsig.org>
  447. Date: Wed, 26 Feb 2025 17:50:59 +0100
  448. Subject: [PATCH 3/3] tests: Fix whitespace issues with tests/cthon04/*.patch
  449.  patches
  450.  
  451. Fix whitespace issues with tests/cthon04/*.patch patches, somehow
  452. the whiitespaces got mangled to death, and could no longer be applied:
  453. ---- snip ----
  454. git clone https://github.com/kofemann/ms-nfs41-client.git
  455. git clone git://git.linux-nfs.org/projects/steved/cthon04.git
  456. cd cthon04/
  457. git config --global --add safe.directory "$PWD"
  458. git checkout 6c9abfd6907b2b43036af111cc600ab60ef804e5
  459. git am ../ms-nfs41-client/tests/cthon04/*.patch
  460. Cloning into 'ms-nfs41-client'...
  461. remote: Enumerating objects: 8594, done.
  462. remote: Counting objects: 100% (615/615), done.
  463. remote: Compressing objects: 100% (348/348), done.
  464. remote: Total 8594 (delta 408), reused 408 (delta 258), pack-reused
  465. 7979 (from 2)
  466. Receiving objects: 100% (8594/8594), 3.35 MiB | 549.00 KiB/s, done.
  467. Resolving deltas: 100% (6379/6379), done.
  468. Cloning into 'cthon04'...
  469. remote: Counting objects: 363, done.
  470. remote: Compressing objects: 100% (162/162), done.
  471. remote: Total 363 (delta 233), reused 303 (delta 200)
  472. Receiving objects: 100% (363/363), 143.39 KiB | 169.00 KiB/s, done.
  473. Resolving deltas: 100% (233/233), done.
  474. Note: switching to '6c9abfd6907b2b43036af111cc600ab60ef804e5'.
  475. HEAD is now at 6c9abfd Cleaned up more warnings
  476. Applying: tools: Cygwin 3.6 port
  477. error: corrupt patch at line 21
  478. Patch failed at 0001 tools: Cygwin 3.6 port
  479. hint: Use 'git am --show-current-patch=diff' to see the failed patch
  480. When you have resolved this problem, run "git am --continue".
  481. If you prefer to skip this patch, run "git am --skip" instead.
  482. To restore the original branch and stop patching, run "git am --abort".
  483. ---- snip ----
  484.  
  485. Reported-by: Sebastian Feld <sebastian.n.feld@gmail.com>
  486. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  487. ---
  488. .../cthon04/0001-tools-Cygwin-3.6-port.patch  | 29 ++++++++++---------
  489.  ...-for-ms-nfs41-client-POSIX-symlink-t.patch |  7 +++--
  490.  .../0003-lock-Fix-issue-with-tlock-path.patch | 11 +++----
  491.  ...CK-Disable-tests-which-cannot-work-o.patch | 15 +++++-----
  492.  4 files changed, 33 insertions(+), 29 deletions(-)
  493.  
  494. diff --git a/tests/cthon04/0001-tools-Cygwin-3.6-port.patch b/tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  495. index e0da6c1..df9def9 100644
  496. --- a/tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  497. +++ b/tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  498. @@ -16,7 +16,7 @@ index 6b231a0..e8dcca3 100644
  499.  --- a/tools/dirdmp.c
  500.  +++ b/tools/dirdmp.c
  501.  @@ -7,8 +7,8 @@
  502. -
  503. +
  504.   #include <sys/param.h>
  505.   #include <sys/types.h>
  506.  -#include <dirent.h>
  507. @@ -26,21 +26,21 @@ index 6b231a0..e8dcca3 100644
  508.   #include <stdio.h>
  509.   #include <stdlib.h>
  510.  @@ -38,7 +38,7 @@ main(argc, argv)
  511. -       int argc;
  512. -       char *argv[];
  513. +       int argc;
  514. +       char *argv[];
  515.   {
  516.  -#if defined(LINUX) || defined (AIX)
  517.  +#if defined(LINUX) || defined(__CYGWIN__) || defined (AIX)
  518. -       fprintf(stderr, "dirdmp is not supported on this platform.\n");
  519. -       exit(1);
  520. +       fprintf(stderr, "dirdmp is not supported on this platform.\n");
  521. +       exit(1);
  522.   #else
  523.  @@ -50,7 +50,7 @@ main(argc, argv)
  524.   #endif /* LINUX || AIX */
  525.   }
  526. -
  527. +
  528.  -#if !(defined(LINUX) || defined(AIX))
  529.  +#if !(defined(LINUX) || defined(__CYGWIN__) || defined(AIX))
  530. -
  531. +
  532.   static void
  533.   print(dir)
  534.  diff --git a/tools/dirprt.c b/tools/dirprt.c
  535. @@ -48,13 +48,14 @@ index a0630eb..acb9ec3 100644
  536.  --- a/tools/dirprt.c
  537.  +++ b/tools/dirprt.c
  538.  @@ -72,7 +72,7 @@ print(dir)
  539. -               return;
  540. -       }
  541. -       while ((dp = readdir(dirp)) != NULL) {
  542. +               return;
  543. +       }
  544. +       while ((dp = readdir(dirp)) != NULL) {
  545.  -#if defined(SVR3) || defined(SVR4) || defined(LINUX)
  546.  +#if defined(SVR3) || defined(SVR4) || defined(LINUX) || defined(__CYGWIN__)
  547. -               printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
  548. -                      (long)dp->d_ino,
  549. -                      dp->d_reclen, dp->d_name);
  550. ---
  551. +               printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
  552. +                      (long)dp->d_ino,
  553. +                      dp->d_reclen, dp->d_name);
  554. +--
  555.  2.45.1
  556. +
  557. diff --git a/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch b/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  558. index a48ad84..007c958 100644
  559. --- a/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  560. +++ b/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  561. @@ -20,11 +20,12 @@ index d65eb3a..f993631 100644
  562.  @@ -43,7 +43,7 @@ static int Tflag = 0;        /* print timing */
  563.   static int Fflag = 0; /* test function only;  set count to 1, negate -t */
  564.   static int Nflag = 0; /* Suppress directory operations */
  565. -
  566. +
  567.  -#define SNAME "/this/is/a/symlink"    /* symlink prefix */
  568.  +#define SNAME "/dev/this/is/a/symlink"        /* symlink prefix */
  569. -
  570. +
  571.   static void
  572.   usage()
  573. ---
  574. +--
  575.  2.45.1
  576. +
  577. diff --git a/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch b/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  578. index 9a594f6..45dd4ee 100644
  579. --- a/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  580. +++ b/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  581. @@ -15,13 +15,14 @@ index 21b09a5..4db16e2 100755
  582.  --- a/lock/runtests
  583.  +++ b/lock/runtests
  584.  @@ -64,7 +64,7 @@ do
  585. -                       ;;
  586. -       esac
  587. -       echo ""
  588. +                       ;;
  589. +       esac
  590. +       echo ""
  591.  -      $i $TESTARGS $NFSTESTDIR
  592.  +      ./$i $TESTARGS $NFSTESTDIR
  593.   done
  594. -
  595. +
  596.   echo "Congratulations, you passed the locking tests!"
  597. ---
  598. +--
  599.  2.45.1
  600. +
  601. diff --git a/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch b/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  602. index 5b8a339..6664fa4 100644
  603. --- a/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  604. +++ b/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  605. @@ -20,10 +20,10 @@ index 77215c1..36f4978 100644
  606.  @@ -3,9 +3,9 @@
  607.   #     1.4 Lachman ONC Test Suite source
  608.   #
  609. -
  610. +
  611.  -TESTS=op_unlk op_ren op_chmod dupreq excltest negseek rename holey \
  612.  +TESTS=op_unlk op_chmod dupreq excltest negseek rename holey \
  613. -       truncate nfsidem nstat stat stat2 touchn fstat rewind \
  614. +       truncate nfsidem nstat stat stat2 touchn fstat rewind \
  615.  -      telldir bigfile bigfile2 freesp
  616.  +      telldir bigfile bigfile2 freesp
  617.   DOSRUNFILES = scripts/*.bat
  618. @@ -35,12 +35,12 @@ index 8f099fa..385ac61 100644
  619.  +++ b/special/runtests.wrk
  620.  @@ -29,7 +29,7 @@ if [ "$CIFS" = "yes" ] && echo $MNTOPTIONS | grep -E "vers=2|vers=3" > /dev/null
  621.   then
  622. -       echo "skipping test; not supported by SMB 2.0 and higher versions"
  623. +       echo "skipping test; not supported by SMB 2.0 and higher versions"
  624.   else
  625.  -      TMPDIR= ./op_ren
  626.  +      : # TMPDIR= ./op_ren
  627.   fi
  628. -
  629. +
  630.   echo ""
  631.  diff --git a/tools/Makefile b/tools/Makefile
  632.  index ce2cbc7..8cc1903 100644
  633. @@ -49,11 +49,12 @@ index ce2cbc7..8cc1903 100644
  634.  @@ -8,7 +8,7 @@
  635.   # 'make copy DESTDIR=path'      copies test programs to path
  636.   # 'make dist DESTDIR=path'      copies sources to path
  637. -
  638. +
  639.  -TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
  640.  +TESTS = tcp tcpd udp udpd dirdmp dirprt
  641. -
  642. +
  643.   # dirdmp apparently doesn't work with Linux 2.2.  So for Linux systems,
  644.   # comment out the above definition and use this one.
  645. ---
  646. +--
  647.  2.45.1
  648. +
  649. --
  650. 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