pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for |FATTR4_WORD1_SPACE_USED|, utils, docs+misc, 2025-02-17
Posted by Anonymous on Mon 17th Feb 2025 17:55
raw | new post

  1. From 1c83d20c6a7acea88b000f91ee16dd46efd84470 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 17 Feb 2025 12:52:29 +0100
  4. Subject: [PATCH 1/8] daemon,sys: Add support for |FATTR4_WORD1_SPACE_USED|
  5.  
  6. Add support for |FATTR4_WORD1_SPACE_USED| (number of file system
  7. bytes allocated to this filesystem object), which is mapped to
  8. Win32 |FILE_STANDARD_INFORMATION.AllocationSize|.
  9.  
  10. This is required to track the allocated size for sparse files.
  11.  
  12. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  13. ---
  14. daemon/callback_xdr.c     |  7 +++++--
  15.  daemon/daemon_debug.c     |  3 +++
  16.  daemon/fileinfoutil.c     | 22 ++++++++++++++--------
  17.  daemon/lookup.c           |  6 ++++--
  18.  daemon/name_cache.c       | 33 ++++++++++++++++++++++-----------
  19.  daemon/nfs41_ops.c        |  6 ++++--
  20.  daemon/nfs41_superblock.c |  3 ++-
  21.  daemon/nfs41_types.h      |  4 +++-
  22.  daemon/nfs41_xdr.c        |  4 ++++
  23.  daemon/readdir.c          |  9 +++++----
  24.  daemon/setattr.c          | 12 +++++++++++-
  25.  sys/nfs41sys_ea.c         | 10 ++++++----
  26.  sys/nfs41sys_fileinfo.c   | 11 +----------
  27.  13 files changed, 84 insertions(+), 46 deletions(-)
  28.  
  29. diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c
  30. index 99333c5..8a21e40 100644
  31. --- a/daemon/callback_xdr.c
  32. +++ b/daemon/callback_xdr.c
  33. @@ -1,5 +1,6 @@
  34.  /* NFSv4.1 client for Windows
  35. - * Copyright (C) 2012 The Regents of the University of Michigan
  36. + * Copyright (C) 2012 The Regents of the University of Michigan
  37. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  38.   *
  39.   * Olga Kornievskaia <aglo@umich.edu>
  40.   * Casey Bodley <cbodley@umich.edu>
  41. @@ -265,7 +266,9 @@ static bool_t info_to_fattr4(nfs41_file_info *info, fattr4 *fattr)
  42.          NFS4_OPAQUE_LIMIT, XDR_ENCODE);
  43.      
  44.      /* The only attributes that the server can reliably
  45. -     * query via CB_GETATTR are size and change. */
  46. +     * query via CB_GETATTR are size and change.
  47. +     * FIXME: What about |FATTR4_WORD1_SPACE_USED| ?
  48. +     */
  49.      if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_CHANGE)) {
  50.          result = xdr_u_hyper(&fattr_xdr, &info->change);
  51.          if (!result) { CBX_ERR("getattr.info.change"); goto out; }
  52. diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c
  53. index 4f3a9f2..493d221 100644
  54. --- a/daemon/daemon_debug.c
  55. +++ b/daemon/daemon_debug.c
  56. @@ -1111,6 +1111,9 @@ void print_nfs41_file_info(
  57.                  (long)info->time_modify.seconds,
  58.                  (long)info->time_modify.nseconds);
  59.          }
  60. +        if (info->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED)
  61. +            PRNFS41FI_FMT("space_used=%lld, ",
  62. +                (long long)info->space_used);
  63.          if (info->attrmask.arr[1] & FATTR4_WORD1_SYSTEM)
  64.              PRNFS41FI_FMT("system=%d, ", (int)info->system);
  65.          p += snprintf(p, (sizeof(buf)-(p-buf)), "} ");
  66. diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
  67. index 97eff4f..bb23b41 100644
  68. --- a/daemon/fileinfoutil.c
  69. +++ b/daemon/fileinfoutil.c
  70. @@ -140,9 +140,11 @@ void nfs_to_standard_info(
  71.      EASSERT(info->attrmask.arr[0] & FATTR4_WORD0_SIZE);
  72.      EASSERT((info->attrmask.count > 0) &&
  73.          (info->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS));
  74. +    EASSERT((info->attrmask.count > 0) &&
  75. +        (info->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED));
  76.  
  77. -    std_out->AllocationSize.QuadPart =
  78. -        std_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  79. +    std_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  80. +    std_out->AllocationSize.QuadPart = (LONGLONG)info->space_used;
  81.      std_out->NumberOfLinks = info->numlinks;
  82.      std_out->DeletePending = FALSE;
  83.      std_out->Directory = FileAttributes & FILE_ATTRIBUTE_DIRECTORY ?
  84. @@ -194,8 +196,8 @@ void nfs_to_network_openinfo(
  85.          net_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET;
  86.      }
  87.  
  88. -    net_out->AllocationSize.QuadPart =
  89. -        net_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  90. +    net_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  91. +    net_out->AllocationSize.QuadPart = (LONGLONG)info->space_used;
  92.      net_out->FileAttributes =
  93.          nfs_file_info_to_attributes(superblock, info);
  94.  }
  95. @@ -272,8 +274,8 @@ void nfs_to_stat_info(
  96.          stat_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET;
  97.      }
  98.  
  99. -    stat_out->AllocationSize.QuadPart =
  100. -        stat_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  101. +    stat_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  102. +    stat_out->AllocationSize.QuadPart = (LONGLONG)info->space_used;
  103.  
  104.      stat_out->FileAttributes =
  105.          nfs_file_info_to_attributes(superblock, info);
  106. @@ -340,8 +342,8 @@ void nfs_to_stat_lx_info(
  107.          stat_lx_out->ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET;
  108.      }
  109.  
  110. -    stat_lx_out->AllocationSize.QuadPart =
  111. -        stat_lx_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  112. +    stat_lx_out->EndOfFile.QuadPart = (LONGLONG)info->size;
  113. +    stat_lx_out->AllocationSize.QuadPart = (LONGLONG)info->space_used;
  114.  
  115.      stat_lx_out->FileAttributes =
  116.          nfs_file_info_to_attributes(superblock, info);
  117. @@ -585,6 +587,10 @@ void nfs41_file_info_cpy(
  118.          if (attrmask->arr[1] & FATTR4_WORD1_SPACE_TOTAL) {
  119.              dest->space_total = src->space_total;
  120.          }
  121. +        if (attrmask->arr[1] & FATTR4_WORD1_SPACE_USED) {
  122. +            /* Per file-object size */
  123. +            dest->space_used = src->space_used;
  124. +        }
  125.          if (attrmask->arr[1] & FATTR4_WORD1_SYSTEM) {
  126.              dest->system = src->system;
  127.          }
  128. diff --git a/daemon/lookup.c b/daemon/lookup.c
  129. index 21e5598..2829eaa 100644
  130. --- a/daemon/lookup.c
  131. +++ b/daemon/lookup.c
  132. @@ -1,5 +1,6 @@
  133.  /* NFSv4.1 client for Windows
  134. - * Copyright (C) 2012 The Regents of the University of Michigan
  135. + * Copyright (C) 2012 The Regents of the University of Michigan
  136. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  137.   *
  138.   * Olga Kornievskaia <aglo@umich.edu>
  139.   * Casey Bodley <cbodley@umich.edu>
  140. @@ -100,7 +101,8 @@ static void init_component_args(
  141.          | FATTR4_WORD0_FSID | FATTR4_WORD0_FILEID
  142.          | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE;
  143.      args->attr_request.arr[1] = FATTR4_WORD1_MODE
  144. -        | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_SYSTEM
  145. +        | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_SPACE_USED
  146. +        | FATTR4_WORD1_SYSTEM
  147.          | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE
  148.          | FATTR4_WORD1_TIME_MODIFY
  149.          | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
  150. diff --git a/daemon/name_cache.c b/daemon/name_cache.c
  151. index b15629c..209b019 100644
  152. --- a/daemon/name_cache.c
  153. +++ b/daemon/name_cache.c
  154. @@ -1,5 +1,6 @@
  155.  /* NFSv4.1 client for Windows
  156. - * Copyright (C) 2012 The Regents of the University of Michigan
  157. + * Copyright (C) 2012 The Regents of the University of Michigan
  158. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  159.   *
  160.   * Olga Kornievskaia <aglo@umich.edu>
  161.   * Casey Bodley <cbodley@umich.edu>
  162. @@ -79,16 +80,17 @@ static __inline bool_t is_delegation(
  163.  #define NC_ATTR_CHANGE      (1 <<  1)
  164.  #define NC_ATTR_FSID        (1 <<  2)
  165.  #define NC_ATTR_SIZE        (1 <<  3)
  166. -#define NC_ATTR_HIDDEN      (1 <<  4)
  167. -#define NC_ATTR_ARCHIVE     (1 <<  5)
  168. -#define NC_ATTR_MODE        (1 <<  6)
  169. -#define NC_ATTR_NUMLINKS    (1 <<  7)
  170. -#define NC_ATTR_OWNER       (1 <<  8)
  171. -#define NC_ATTR_OWNER_GROUP (1 <<  9)
  172. -#define NC_ATTR_TIME_ACCESS (1 << 10)
  173. -#define NC_ATTR_TIME_CREATE (1 << 11)
  174. -#define NC_ATTR_TIME_MODIFY (1 << 12)
  175. -#define NC_ATTR_SYSTEM      (1 << 13)
  176. +#define NC_ATTR_SPACE_USED  (1 <<  4)
  177. +#define NC_ATTR_HIDDEN      (1 <<  5)
  178. +#define NC_ATTR_ARCHIVE     (1 <<  6)
  179. +#define NC_ATTR_MODE        (1 <<  7)
  180. +#define NC_ATTR_NUMLINKS    (1 <<  8)
  181. +#define NC_ATTR_OWNER       (1 <<  9)
  182. +#define NC_ATTR_OWNER_GROUP (1 << 10)
  183. +#define NC_ATTR_TIME_ACCESS (1 << 11)
  184. +#define NC_ATTR_TIME_CREATE (1 << 12)
  185. +#define NC_ATTR_TIME_MODIFY (1 << 13)
  186. +#define NC_ATTR_SYSTEM      (1 << 14)
  187.  
  188.  /* attribute cache */
  189.  struct attr_cache_entry {
  190. @@ -97,6 +99,7 @@ struct attr_cache_entry {
  191.      uint32_t                nc_attrs;
  192.      uint64_t                change;
  193.      uint64_t                size;
  194. +    uint64_t                space_used;
  195.      uint64_t                fileid;
  196.      uint64_t                fsid_major;
  197.      uint64_t                fsid_minor;
  198. @@ -369,6 +372,10 @@ static void attr_cache_update(
  199.              entry->time_modify_s  = info->time_modify.seconds;
  200.              entry->time_modify_ns = info->time_modify.nseconds;
  201.          }
  202. +        if (info->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED) {
  203. +            entry->nc_attrs |= NC_ATTR_SPACE_USED;
  204. +            entry->space_used = info->space_used;
  205. +        }
  206.          if (info->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
  207.              entry->nc_attrs |= NC_ATTR_SYSTEM;
  208.              entry->system = info->system;
  209. @@ -455,6 +462,10 @@ static void copy_attrs(
  210.          dst->attrmask.arr[0] |= FATTR4_WORD0_ARCHIVE;
  211.          dst->archive = src->archive;
  212.      }
  213. +    if (src->nc_attrs & NC_ATTR_SPACE_USED) {
  214. +        dst->attrmask.arr[1] |= FATTR4_WORD1_SPACE_USED;
  215. +        dst->space_used = src->space_used;
  216. +    }
  217.      if (src->nc_attrs & NC_ATTR_SYSTEM) {
  218.          dst->attrmask.arr[1] |= FATTR4_WORD1_SYSTEM;
  219.          dst->system = src->system;
  220. diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
  221. index 38d3125..7f8f870 100644
  222. --- a/daemon/nfs41_ops.c
  223. +++ b/daemon/nfs41_ops.c
  224. @@ -1512,8 +1512,10 @@ int nfs41_setattr(
  225.      nfs41_attr_cache_update(session_name_cache(session),
  226.          file->fh.fileid, info);
  227.  
  228. -    if ((setattr_res.attrsset.count > 0) &&
  229. -        (setattr_res.attrsset.arr[0] & FATTR4_WORD0_SIZE))
  230. +    if (((setattr_res.attrsset.count > 0) &&
  231. +            (setattr_res.attrsset.arr[0] & FATTR4_WORD0_SIZE)) ||
  232. +        (setattr_res.attrsset.count > 1) &&
  233. +            (setattr_res.attrsset.arr[1] & FATTR4_WORD1_SPACE_USED))
  234.          nfs41_superblock_space_changed(file->fh.superblock);
  235.  out:
  236.      return status;
  237. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  238. index 185ad5c..baf33fc 100644
  239. --- a/daemon/nfs41_superblock.c
  240. +++ b/daemon/nfs41_superblock.c
  241. @@ -142,7 +142,8 @@ static int get_superblock_attrs(
  242.          | FATTR4_WORD0_FSID | FATTR4_WORD0_FILEID
  243.          | FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE;
  244.      superblock->default_getattr.arr[1] = FATTR4_WORD1_MODE
  245. -        | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_SYSTEM
  246. +        | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_SPACE_USED
  247. +        | FATTR4_WORD1_SYSTEM
  248.          | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE
  249.          | FATTR4_WORD1_TIME_MODIFY;
  250.      superblock->default_getattr.arr[2] = 0;
  251. diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h
  252. index 1596d3d..59f1fd8 100644
  253. --- a/daemon/nfs41_types.h
  254. +++ b/daemon/nfs41_types.h
  255. @@ -1,5 +1,6 @@
  256.  /* NFSv4.1 client for Windows
  257. - * Copyright (C) 2012 The Regents of the University of Michigan
  258. + * Copyright (C) 2012 The Regents of the University of Michigan
  259. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  260.   *
  261.   * Olga Kornievskaia <aglo@umich.edu>
  262.   * Casey Bodley <cbodley@umich.edu>
  263. @@ -208,6 +209,7 @@ typedef struct __nfs41_file_info {
  264.      nfsacl41                *acl;
  265.      uint64_t                change;
  266.      uint64_t                size;
  267. +    uint64_t                space_used;
  268.      uint32_t                type;
  269.      uint32_t                numlinks;
  270.      uint32_t                rdattr_error;
  271. diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
  272. index 84c5f7f..21314fd 100644
  273. --- a/daemon/nfs41_xdr.c
  274. +++ b/daemon/nfs41_xdr.c
  275. @@ -1873,6 +1873,10 @@ static bool_t decode_file_attrs(
  276.              if (!xdr_u_hyper(xdr, &info->space_total))
  277.                  return FALSE;
  278.          }
  279. +        if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED) {
  280. +            if (!xdr_u_hyper(xdr, &info->space_used))
  281. +                return FALSE;
  282. +        }
  283.          if (attrs->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
  284.              if (!xdr_bool(xdr, &info->system))
  285.                  return FALSE;
  286. diff --git a/daemon/readdir.c b/daemon/readdir.c
  287. index 5fa883b..2723b74 100644
  288. --- a/daemon/readdir.c
  289. +++ b/daemon/readdir.c
  290. @@ -1,5 +1,6 @@
  291.  /* NFSv4.1 client for Windows
  292. - * Copyright (C) 2012 The Regents of the University of Michigan
  293. + * Copyright (C) 2012 The Regents of the University of Michigan
  294. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  295.   *
  296.   * Olga Kornievskaia <aglo@umich.edu>
  297.   * Casey Bodley <cbodley@umich.edu>
  298. @@ -372,9 +373,9 @@ static void readdir_copy_dir_info(
  299.          info->fdi.ChangeTime.QuadPart = FILE_INFO_TIME_NOT_SET;
  300.      }
  301.  
  302. -    info->fdi.EndOfFile.QuadPart =
  303. -        info->fdi.AllocationSize.QuadPart =
  304. -            entry->attr_info.size;
  305. +    info->fdi.EndOfFile.QuadPart = entry->attr_info.size;
  306. +    info->fdi.AllocationSize.QuadPart = entry->attr_info.space_used;
  307. +
  308.      info->fdi.FileAttributes =
  309.          nfs_file_info_to_attributes(superblock, &entry->attr_info);
  310.  }
  311. diff --git a/daemon/setattr.c b/daemon/setattr.c
  312. index 1d02042..da5dac6 100644
  313. --- a/daemon/setattr.c
  314. +++ b/daemon/setattr.c
  315. @@ -1,5 +1,6 @@
  316.  /* NFSv4.1 client for Windows
  317. - * Copyright (C) 2012 The Regents of the University of Michigan
  318. + * Copyright (C) 2012 The Regents of the University of Michigan
  319. + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  320.   *
  321.   * Olga Kornievskaia <aglo@umich.edu>
  322.   * Casey Bodley <cbodley@umich.edu>
  323. @@ -502,6 +503,15 @@ static int handle_nfs41_set_size(void *daemon_context, setattr_upcall_args *args
  324.              FILE_INFORMATION_CLASS2string(args->set_class),
  325.              (long long)size->QuadPart));
  326.  
  327. +    /*
  328. +     * We cannot set the allocation size, the NFS server handles this
  329. +     * automagically
  330. +     */
  331. +    if (args->set_class == FileAllocationInformation) {
  332. +        status = NO_ERROR;
  333. +        goto out;
  334. +    }
  335. +
  336.      /* break read delegations before SETATTR */
  337.      nfs41_delegation_return(state->session, &state->file,
  338.          OPEN_DELEGATE_READ, FALSE);
  339. diff --git a/sys/nfs41sys_ea.c b/sys/nfs41sys_ea.c
  340. index 0803f1b..b5f12c3 100644
  341. --- a/sys/nfs41sys_ea.c
  342. +++ b/sys/nfs41sys_ea.c
  343. @@ -174,12 +174,13 @@ void unmarshal_nfs41_eaget(
  344.  static void print_nfs3_attrs(
  345.      nfs3_attrs *attrs)
  346.  {
  347. -    DbgP("type=%d mode=0%o nlink=%d size=%lld "
  348. +    DbgP("type=%d mode=0%o nlink=%d "
  349. +        "size=%lld used=%lld"
  350.          "atime=(tv_sec=%ld,tv_nsec=%lu) "
  351.          "mtime=(tv_sec=%ld,tv_nsec=%lu) "
  352.          "ctime=(tv_sec=%ld,tv_nsec=%lu)\n",
  353.          attrs->type, attrs->mode, attrs->nlink,
  354. -        (long long)attrs->size,
  355. +        (long long)attrs->size, (long long)attrs->used,
  356.          (long)attrs->atime.tv_sec, (unsigned long)attrs->atime.tv_nsec,
  357.          (long)attrs->mtime.tv_sec, (unsigned long)attrs->mtime.tv_nsec,
  358.          (long)attrs->ctime.tv_sec, (unsigned long)attrs->ctime.tv_nsec);
  359. @@ -228,8 +229,9 @@ static void create_nfs3_attrs(
  360.      attrs->gid = nfs41_fcb->owner_group_local_gid;
  361.  #endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
  362.      attrs->nlink = nfs41_fcb->StandardInfo.NumberOfLinks;
  363. -    attrs->size = attrs->used =
  364. -        nfs41_fcb->StandardInfo.EndOfFile.QuadPart;
  365. +    attrs->size = nfs41_fcb->StandardInfo.EndOfFile.QuadPart;
  366. +    attrs->used = nfs41_fcb->StandardInfo.AllocationSize.QuadPart;
  367. +
  368.      /*
  369.       * NFSv4.1 |nfs41_fsid| contains two 64bit fields (|major|,
  370.       * |minor|), but the |nfs3_attrs.fsid| field is only one 64bit
  371. diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
  372. index f6457e5..5f59d7d 100644
  373. --- a/sys/nfs41sys_fileinfo.c
  374. +++ b/sys/nfs41sys_fileinfo.c
  375. @@ -593,9 +593,6 @@ NTSTATUS nfs41_SetFileInformation(
  376.                  (PFILE_ALLOCATION_INFORMATION)RxContext->Info.Buffer;
  377.  
  378.              nfs41_fcb->StandardInfo.AllocationSize.QuadPart = info->AllocationSize.QuadPart;
  379. -            if (nfs41_fcb->StandardInfo.EndOfFile.QuadPart > info->AllocationSize.QuadPart) {
  380. -                nfs41_fcb->StandardInfo.EndOfFile.QuadPart = info->AllocationSize.QuadPart;
  381. -            }
  382.              break;
  383.          }
  384.      case FileEndOfFileInformation:
  385. @@ -603,13 +600,7 @@ NTSTATUS nfs41_SetFileInformation(
  386.              PFILE_END_OF_FILE_INFORMATION info =
  387.                  (PFILE_END_OF_FILE_INFORMATION)RxContext->Info.Buffer;
  388.  
  389. -            if (info->EndOfFile.QuadPart > nfs41_fcb->StandardInfo.AllocationSize.QuadPart) {
  390. -                nfs41_fcb->StandardInfo.AllocationSize.QuadPart =
  391. -                    nfs41_fcb->StandardInfo.EndOfFile.QuadPart = info->EndOfFile.QuadPart;
  392. -            }
  393. -            else {
  394. -                nfs41_fcb->StandardInfo.EndOfFile.QuadPart = info->EndOfFile.QuadPart;
  395. -            }
  396. +            nfs41_fcb->StandardInfo.EndOfFile.QuadPart = info->EndOfFile.QuadPart;
  397.              break;
  398.          }
  399.      case FileRenameInformation:
  400. --
  401. 2.45.1
  402.  
  403. From c9a093013609bd241ffff90b6dac609fe184ac2a Mon Sep 17 00:00:00 2001
  404. From: Roland Mainz <roland.mainz@nrubsig.org>
  405. Date: Mon, 17 Feb 2025 13:53:19 +0100
  406. Subject: [PATCH 2/8] cygwin: Add "sparse file support" section to
  407.  README.bintarball.txt
  408.  
  409. Add "sparse file support" section to README.bintarball.txt
  410.  
  411. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  412. ---
  413. cygwin/README.bintarball.txt | 18 ++++++++++++++++++
  414.  1 file changed, 18 insertions(+)
  415.  
  416. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  417. index 4c3ca12..c40c24f 100644
  418. --- a/cygwin/README.bintarball.txt
  419. +++ b/cygwin/README.bintarball.txt
  420. @@ -67,6 +67,24 @@ NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  421.      - Cygwin /usr/bin/setfacl+/usr/bin/getfacl
  422.      - Windows Explorer ACL dialog
  423.  
  424. +- Sparse file support
  425. +    - Full sparse file support, including creation, punching holes
  426. +      (via NFSv4.2 DEALLOCATE), enumeration of hole&data ranges etc.
  427. +    - Supports Win32 APIs |FSCTL_QUERY_ALLOCATED_RANGES|,
  428. +      |FSCTL_SET_SPARSE|, |FSCTL_SET_ZERO_DATA|; NFSv4.1
  429. +      |FATTR4_WORD1_SPACE_USED| is mapped to Win32
  430. +      |FILE_STANDARD_INFORMATION.AllocationSize| and
  431. +      |NfsV3Attributes.used| EA for sparse file support.
  432. +    - Cygwin >= 3.6 support POSIX-1.2024 |lseek(...,SEEK_HOLE,...)|
  433. +      and |lseek(...,SEEK_DATA,...)|, coreutils /usr/bin/fallocate
  434. +      and $ /usr/bin/cp --sparse=auto src dest #
  435. +    - /cygdrive/c/Windows/system32/fsutil sparse queryrange myfile.dat
  436. +      can be used to enumerate ranges where data are allocated
  437. +      (BUG: Win10+Win11 fsutil only support 64 data ranges, the
  438. +      filesystem itself supports an unlimited number of data ranges)
  439. +    - /cygdrive/c/Windows/system32/xcopy /sparse (on Win11) can be
  440. +      used to copy sparse files
  441. +
  442.  - Symlink reparse and translation support
  443.      - Translates Win32/NT symlink syntax (e.g.
  444.        $ mklink /D ... Y:\tmp\ #) to NFS/POSIX syntax (e.g.
  445. --
  446. 2.45.1
  447.  
  448. From 2c1767ab799808fbcde9e9d4321426bac71911d5 Mon Sep 17 00:00:00 2001
  449. From: Roland Mainz <roland.mainz@nrubsig.org>
  450. Date: Mon, 17 Feb 2025 14:00:53 +0100
  451. Subject: [PATCH 3/8] cygwin: msnfs41client.bash needs license template
  452.  
  453. msnfs41client.bash needs license template
  454.  
  455. Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
  456. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  457. ---
  458. cygwin/devel/msnfs41client.bash | 24 ++++++++++++++++++++++++
  459.  1 file changed, 24 insertions(+)
  460.  
  461. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  462. index a46e7f7..505f8c3 100755
  463. --- a/cygwin/devel/msnfs41client.bash
  464. +++ b/cygwin/devel/msnfs41client.bash
  465. @@ -1,5 +1,29 @@
  466.  #!/bin/bash
  467.  
  468. +#
  469. +# MIT License
  470. +#
  471. +# Copyright (c) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  472. +#
  473. +# Permission is hereby granted, free of charge, to any person obtaining a copy
  474. +# of this software and associated documentation files (the "Software"), to deal
  475. +# in the Software without restriction, including without limitation the rights
  476. +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  477. +# copies of the Software, and to permit persons to whom the Software is
  478. +# furnished to do so, subject to the following conditions:
  479. +#
  480. +# The above copyright notice and this permission notice shall be included in all
  481. +# copies or substantial portions of the Software.
  482. +#
  483. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  484. +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  485. +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  486. +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  487. +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  488. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  489. +# SOFTWARE.
  490. +#
  491. +
  492.  #
  493.  # msnfs41client.bash - simple Cygwin frontent for the msnfs41client
  494.  # NFSv4.2/NFSv4.1 filesystem driver development
  495. --
  496. 2.45.1
  497.  
  498. From 198aafb73f0a93f428aff59df6eb7cdeac9a5832 Mon Sep 17 00:00:00 2001
  499. From: Roland Mainz <roland.mainz@nrubsig.org>
  500. Date: Mon, 17 Feb 2025 14:11:17 +0100
  501. Subject: [PATCH 4/8] cygwin: msnfs41client install: Disable openfiles tracking
  502.  by default
  503.  
  504. msnfs41client.bash install: Disable openfiles tracking by default
  505.  
  506. Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
  507. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  508. ---
  509. cygwin/devel/msnfs41client.bash | 3 ++-
  510.  1 file changed, 2 insertions(+), 1 deletion(-)
  511.  
  512. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  513. index 505f8c3..701ad59 100755
  514. --- a/cygwin/devel/msnfs41client.bash
  515. +++ b/cygwin/devel/msnfs41client.bash
  516. @@ -193,7 +193,8 @@ function nfsclient_install
  517.         sc query nfs41_driver
  518.         domainname
  519.  
  520. -       openfiles /local ON
  521. +       #openfiles /local ON
  522. +       openfiles /local OFF
  523.  
  524.         #
  525.         # install "msnfs41client run_daemon" as system service
  526. --
  527. 2.45.1
  528.  
  529. From 0d4eb2867423a43f5dad40f1b524627161ef5c07 Mon Sep 17 00:00:00 2001
  530. From: Roland Mainz <roland.mainz@nrubsig.org>
  531. Date: Mon, 17 Feb 2025 14:50:59 +0100
  532. Subject: [PATCH 5/8] cygwin: mount_sshnfs+sshnfs should use 15min timeout via
  533.  ServerAliveInterval+ServerAliveCountMax
  534.  
  535. mount_sshnfs+sshnfs should use 15min timeout via
  536. ServerAliveInterval=10 and ServerAliveCountMax=90 to avoid issues
  537. with instable WIFI connections.
  538.  
  539. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  540. ---
  541. cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 12 ++++++++----
  542.  cygwin/utils/sshnfs/sshnfs.ksh             | 10 +++++++++-
  543.  2 files changed, 17 insertions(+), 5 deletions(-)
  544.  
  545. diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  546. index ace325a..316b999 100644
  547. --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  548. +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  549. @@ -3,7 +3,7 @@
  550.  #
  551.  # MIT License
  552.  #
  553. -# Copyright (c) 2023-2024 Roland Mainz <roland.mainz@nrubsig.org>
  554. +# Copyright (c) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  555.  #
  556.  # Permission is hereby granted, free of charge, to any person obtaining a copy
  557.  # of this software and associated documentation files (the "Software"), to deal
  558. @@ -422,7 +422,7 @@ function cmd_mount
  559.  
  560.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  561.         typeset -r mount_sshnfs_cmdmount_usage=$'+
  562. -       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2024-11-25 \$\n]
  563. +       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2025-02-17 \$\n]
  564.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  565.         [+NAME?mount_sshnfs mount - mount NFSv4 filesystem through ssh
  566.                 tunnel]
  567. @@ -635,6 +635,8 @@ function cmd_mount
  568.                         # for a benchmark) and lower latency, as NFS is
  569.                         # a bit latency-sensitive
  570.                         # - We turn compression off, as it incrases latency
  571. +                       # - ServerAliveInterval+ServerAliveCountMax ==
  572. +                       #   15min timeout (10sec*6*15)
  573.                         #
  574.                         ssh \
  575.                                 -L "${c.local_forward_port}:localhost:2049" \
  576. @@ -643,6 +645,8 @@ function cmd_mount
  577.                                 -f -o 'ExitOnForwardFailure=yes' \
  578.                                 -o 'Compression=no' \
  579.                                 -o 'Ciphers=aes128-cbc,aes128-ctr' \
  580. +                               '-o' 'ServerAliveInterval=10' \
  581. +                               '-o' "ServerAliveCountMax=$((6*15))" \
  582.                                 "${c.ssh_jumphost_args[@]}" \
  583.                                 "${c.nfsserver_ssh_login_name}@${c.nfs_server.host}"
  584.                         if (( $? != 0 )) ; then
  585. @@ -788,7 +792,7 @@ function cmd_umount
  586.         typeset mydebug=false # fixme: should be "bool" for ksh93v
  587.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  588.         typeset -r mount_sshnfs_cmdumount_usage=$'+
  589. -       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2024-11-25 \$\n]
  590. +       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2025-02-17 \$\n]
  591.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  592.         [+NAME?mount_sshnfs umount - unmount NFSv4 filesystem mounted
  593.                 via mount_sshnfs mount]
  594. @@ -892,7 +896,7 @@ function main
  595.  
  596.         # fixme: Need better text layout for $ mount_sshnfs --man #
  597.         typeset -r mount_sshnfs_usage=$'+
  598. -       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2024-11-25 \$\n]
  599. +       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2025-02-17 \$\n]
  600.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  601.         [+NAME?mount_sshnfs - mount/umount NFSv4 filesystem via ssh
  602.                 tunnel]
  603. diff --git a/cygwin/utils/sshnfs/sshnfs.ksh b/cygwin/utils/sshnfs/sshnfs.ksh
  604. index 6582ae2..b6c1a3d 100644
  605. --- a/cygwin/utils/sshnfs/sshnfs.ksh
  606. +++ b/cygwin/utils/sshnfs/sshnfs.ksh
  607. @@ -3,7 +3,7 @@
  608.  #
  609.  # MIT License
  610.  #
  611. -# Copyright (c) 2023-2024 Roland Mainz <roland.mainz@nrubsig.org>
  612. +# Copyright (c) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
  613.  #
  614.  # Permission is hereby granted, free of charge, to any person obtaining a copy
  615.  # of this software and associated documentation files (the "Software"), to deal
  616. @@ -486,6 +486,8 @@ function main
  617.                                 # for a benchmark) and lower latency, as NFS is
  618.                                 # a bit latency-sensitive
  619.                                 # - We turn compression off, as it incrases latency
  620. +                               # - ServerAliveInterval+ServerAliveCountMax ==
  621. +                               #   15min timeout (10sec*6*15)
  622.                                 #
  623.                                 ssh \
  624.                                         -L "${c.local_forward_port}:localhost:2049" \
  625. @@ -494,6 +496,8 @@ function main
  626.                                         -f -o 'ExitOnForwardFailure=yes' \
  627.                                         -o 'Compression=no' \
  628.                                         -o 'Ciphers=aes128-cbc,aes128-ctr' \
  629. +                                       -o 'ServerAliveInterval=10' \
  630. +                                       -o "ServerAliveCountMax=$((6*15))" \
  631.                                         "${c.ssh_jumphost_args[@]}" \
  632.                                         "${c.nfsserver_ssh_login_name}@${c.nfs_server.host}"
  633.                                 if (( $? != 0 )) ; then
  634. @@ -534,12 +538,16 @@ function main
  635.                                 # for a benchmark) and lower latency, as NFS is
  636.                                 # a bit latency-sensitive
  637.                                 # - We turn compression off, as it incrases latency
  638. +                               # - ServerAliveInterval+ServerAliveCountMax ==
  639. +                               #   15min timeout (10sec*6*15)
  640.                                 #
  641.                                 c.args=(
  642.                                         '-R' "${c.destination_nfs_port}:localhost:${c.local_forward_port}"
  643.                                         '-o' 'ExitOnForwardFailure=yes'
  644.                                         '-o' 'Compression=no'
  645.                                         '-o' 'Ciphers=aes128-cbc,aes128-ctr'
  646. +                                       '-o' 'ServerAliveInterval=10' \
  647. +                                       '-o' "ServerAliveCountMax=$((6*15))" \
  648.                                         "${c.args[@]}"
  649.                                 )
  650.                                 ;;
  651. --
  652. 2.45.1
  653.  
  654. From c2876d941a02fc352d38a4a70655c093d666a4c0 Mon Sep 17 00:00:00 2001
  655. From: Roland Mainz <roland.mainz@nrubsig.org>
  656. Date: Mon, 17 Feb 2025 16:07:42 +0100
  657. Subject: [PATCH 6/8] cygwin: Need workaround for mount_sshnfs failure with
  658.  newer Cygwin/ksh93 combination
  659.  
  660. Need workaround for mount_sshnfs failure with newer Cygwin/ksh93
  661. combination, e.g. that sometimes stdout="${ cmd ; }" only reads the
  662. first character (which breaks extraction of the DOS device letter
  663. from nfs_mount output).
  664.  
  665. Observed with ksh93u+m/1.0.10 2024-08-01+Cygwin 3.6.0-0.374.g4dd859d01c22.x86_64
  666.  
  667. Reported-by: Takeshi Nishimura <takeshi.nishimura.linux@gmail.com>
  668. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  669. ---
  670. cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 17 ++++++++++++++++-
  671.  1 file changed, 16 insertions(+), 1 deletion(-)
  672.  
  673. diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  674. index 316b999..25af7e3 100644
  675. --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  676. +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  677. @@ -692,7 +692,22 @@ function cmd_mount
  678.  
  679.                                 # fixme: we should set LC_ALL=C because below we depend on
  680.                                 # a l10n message
  681. -                               stdout="${ "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" ; (( retval=$? )) ;}"
  682. +                               if false ; then
  683. +                                       stdout="${ "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" ; (( retval=$? )) ;}"
  684. +                               else
  685. +                                       #
  686. +                                       # FIXME: workaround for Cygwin 3.6 issue that
  687. +                                       # stdout="${ cmd ; }" only reads the first character
  688. +                                       # Observed with ksh93u+m/1.0.10 2024-08-01+Cygwin
  689. +                                       # 3.6.0-0.374.g4dd859d01c22.x86_64
  690. +                                       #
  691. +                                       typeset tmpfilename="$(mktemp '/tmp/mount_sshnfs_XXXXXXXXXX.tmp')"
  692. +
  693. +                                       "${c.msnfsv41_nfsmountcmd}" "${mount_args[@]}" >"${tmpfilename}" ; (( retval=$? ))
  694. +                                       IFS='' read stdout <"${tmpfilename}"
  695. +                                       rm -f -- "${tmpfilename}"
  696. +                               fi
  697. +
  698.                                 cat <<<"$stdout"
  699.  
  700.                                 if (( retval == 0 )) ; then
  701. --
  702. 2.45.1
  703.  
  704. From a302c2f2c571e1ca5d10f4ce36aab13a26454814 Mon Sep 17 00:00:00 2001
  705. From: Roland Mainz <roland.mainz@nrubsig.org>
  706. Date: Mon, 17 Feb 2025 16:22:33 +0100
  707. Subject: [PATCH 7/8] cygwin: mount_sshnfs+sshnfs should use /tmp as prefix for
  708.  temporary mount point for r/o root fs
  709.  
  710. mount_sshnfs+sshnfs should use /tmp as prefix for temporary mount point
  711. to handle the case that the systems's root filesystem is read-only.
  712.  
  713. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  714. ---
  715. cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 24 +++++++++++-----------
  716.  cygwin/utils/sshnfs/sshnfs.ksh             |  8 ++++----
  717.  2 files changed, 16 insertions(+), 16 deletions(-)
  718.  
  719. diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  720. index 25af7e3..2426b5f 100644
  721. --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  722. +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  723. @@ -32,15 +32,15 @@
  724.  # Example usage:
  725.  #
  726.  # 1. UNIX/Linux: Mount&&unmount /export/home/rmainz on NFS server "/export/home/rmainz":
  727. -# $ mkdir -p /foobarmnt
  728. -# $ ksh mount_sshnfs.ksh mount ssh+nfs://rmainz@derfwpc5131//export/home/rmainz /foobarmnt
  729. -# $ mount_sshnfs.ksh umount /foobarmnt
  730. +# $ mkdir -p /tmp/foobarmnt
  731. +# $ ksh mount_sshnfs.ksh mount ssh+nfs://rmainz@derfwpc5131//export/home/rmainz /tmp/foobarmnt
  732. +# $ mount_sshnfs.ksh umount /tmp/foobarmnt
  733.  #
  734.  #
  735.  # 2. UNIX/Linux: Mount&&unmount /export/home/rmainz on NFS server "/export/home/rmainz" via SSH jumphost rmainz@10.49.20.131:
  736. -# $ mkdir -p /foobarmnt
  737. -# $ ksh mount_sshnfs.ksh mount -o ro,mount_sshnfs_jumphost=rmainz@10.49.20.131 ssh+nfs://rmainz@derfwpc5131//export/home/rmainz /foobarmnt
  738. -# $ mount_sshnfs.ksh umount /foobarmnt
  739. +# $ mkdir -p /tmp/foobarmnt
  740. +# $ ksh mount_sshnfs.ksh mount -o ro,mount_sshnfs_jumphost=rmainz@10.49.20.131 ssh+nfs://rmainz@derfwpc5131//export/home/rmainz /tmp/foobarmnt
  741. +# $ mount_sshnfs.ksh umount /tmp/foobarmnt
  742.  #
  743.  
  744.  #
  745. @@ -927,15 +927,15 @@ function main
  746.  
  747.         [+EXAMPLES]{
  748.                 [+?Example 1:][+?Mount&&unmount /export/home/rmainz on NFS server "/export/home/rmainz"]{
  749. -[+\n# mkdir -p /foobarmnt
  750. -# mount_sshnfs mount ssh+nfs:://rmainz@derfwpc5131//export/home/rmainz /foobarmnt
  751. -# mount_sshnfs umount /foobarmnt
  752. +[+\n# mkdir -p /tmp/foobarmnt
  753. +# mount_sshnfs mount ssh+nfs:://rmainz@derfwpc5131//export/home/rmainz /tmp/foobarmnt
  754. +# mount_sshnfs umount /tmp/foobarmnt
  755.  ]
  756.  }
  757.                 [+?Example 2:][+?Mount&&unmount /export/home/rmainz on NFS server "/export/home/rmainz" via SSH jumphost rmainz@10.49.20.131]{
  758. -[+\n# mkdir -p /foobarmnt
  759. -# mount_sshnfs mount -o ro,mount_sshnfs_jumphost=rmainz@10.49.20.131 ssh+nfs:://rmainz@derfwpc5131//export/home/rmainz /foobarmnt
  760. -# mount_sshnfs umount /foobarmnt
  761. +[+\n# mkdir -p /tmp/foobarmnt
  762. +# mount_sshnfs mount -o ro,mount_sshnfs_jumphost=rmainz@10.49.20.131 ssh+nfs:://rmainz@derfwpc5131//export/home/rmainz /tmp/foobarmnt
  763. +# mount_sshnfs umount /tmp/foobarmnt
  764.  ]
  765.                 }
  766.         }
  767. diff --git a/cygwin/utils/sshnfs/sshnfs.ksh b/cygwin/utils/sshnfs/sshnfs.ksh
  768. index b6c1a3d..80bc52e 100644
  769. --- a/cygwin/utils/sshnfs/sshnfs.ksh
  770. +++ b/cygwin/utils/sshnfs/sshnfs.ksh
  771. @@ -513,8 +513,8 @@ function main
  772.                                                 "${c.nfsserver_ssh_login_name}@${c.nfs_server.host}"
  773.  
  774.                                 print -u2 -f $"# Linux: Use this to mount the directory:\n"
  775. -                               print -u2 -f $"# $ mkdir /mnt_nfs\n"
  776. -                               print -u2 -f $"# $ mount -vvv -t nfs -o vers=4.2,port=%d localhost:%s /mnt_nfs\n" \
  777. +                               print -u2 -f $"# $ mkdir /tmp/mnt_nfs\n"
  778. +                               print -u2 -f $"# $ mount -vvv -t nfs -o vers=4.2,port=%d localhost:%s /tmp/mnt_nfs\n" \
  779.                                         c.destination_nfs_port \
  780.                                         "${c.nfs_server.uripath}"
  781.                                 print -u2 -f $"\n"
  782. @@ -585,8 +585,8 @@ function main
  783.                                 (( c.destination_nfs_port += (mypid+myuid+PPID) % 16381 ))
  784.  
  785.                                 print -u2 -f $"# Use this to mount the directory:\n"
  786. -                               print -u2 -f $"# $ mkdir /mnt_nfs\n"
  787. -                               print -u2 -f $"# $ mount -vvv -t nfs -o vers=4.2,port=%d localhost:%s /mnt_nfs\n" \
  788. +                               print -u2 -f $"# $ mkdir /tmp/mnt_nfs\n"
  789. +                               print -u2 -f $"# $ mount -vvv -t nfs -o vers=4.2,port=%d localhost:%s /tmp/mnt_nfs\n" \
  790.                                         c.destination_nfs_port \
  791.                                         "${c.nfs_server.uripath}"
  792.  
  793. --
  794. 2.45.1
  795.  
  796. From c9a0b68a85747609e84142962a1c839a4e4f657a Mon Sep 17 00:00:00 2001
  797. From: Roland Mainz <roland.mainz@nrubsig.org>
  798. Date: Mon, 17 Feb 2025 16:33:07 +0100
  799. Subject: [PATCH 8/8] cygwin: Add requirements for full sparse file support
  800.  
  801. Add requirements (Cygwin >= 3.6+NFSv4.2 server) for full sparse
  802. file support.
  803.  
  804. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  805. ---
  806. cygwin/README.bintarball.txt | 1 +
  807.  1 file changed, 1 insertion(+)
  808.  
  809. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  810. index c40c24f..1958023 100644
  811. --- a/cygwin/README.bintarball.txt
  812. +++ b/cygwin/README.bintarball.txt
  813. @@ -68,6 +68,7 @@ NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11&Windows Server 2019
  814.      - Windows Explorer ACL dialog
  815.  
  816.  - Sparse file support
  817. +    - Requires Cygwin 3.6 and a MFSv4.2 server
  818.      - Full sparse file support, including creation, punching holes
  819.        (via NFSv4.2 DEALLOCATE), enumeration of hole&data ranges etc.
  820.      - Supports Win32 APIs |FSCTL_QUERY_ALLOCATED_RANGES|,
  821. --
  822. 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