- From 597fcd878fc4f00503bfc83e983a4d92493735f5 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 6 Jan 2026 19:16:17 +0100
- Subject: [PATCH 1/7] daemon: Fix lock setup in |nfs41_lookup()|
- Fix lock setup in |nfs41_lookup()|, a SRWLock cannot be copied.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/lookup.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
- diff --git a/daemon/lookup.c b/daemon/lookup.c
- index 39074e2..6dd5905 100644
- --- a/daemon/lookup.c
- +++ b/daemon/lookup.c
- @@ -539,12 +539,13 @@ int nfs41_lookup(
- /*
- * Recursively lookup the base file ...
- */
- - nfs41_abs_path base_path = path;
- + nfs41_abs_path base_path;
- size_t base_len = strlen(base_name);
- (void)memcpy(base_path.path, base_name, base_len);
- base_path.path[base_len] = '\0';
- base_path.len = (unsigned short)base_len;
- + InitializeSRWLock(&base_path.lock);
- nfs41_path_fh attr_target;
- if (target_out == NULL) {
- --
- 2.51.0
- From d4b0f4c3c07a4608e9d25ec280ff73128c6f4002 Mon Sep 17 00:00:00 2001
- From: Cedric Blancher <cedric.blancher@gmail.com>
- Date: Tue, 6 Jan 2026 19:22:40 +0100
- Subject: [PATCH 2/7] tests: Update FreeBSD NFS server setup instructions for
- FreeBSD 15.0 with NFSv4.1 named attributes
- Update FreeBSD NFS server setup instructions for FreeBSD 15.0 with
- NFSv4/NFSv4.1 named attributes.
- Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
- ---
- tests/nfs_server_setup.txt | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
- diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
- index cafdaeb..65512aa 100644
- --- a/tests/nfs_server_setup.txt
- +++ b/tests/nfs_server_setup.txt
- @@ -205,7 +205,7 @@ See https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/man
- #
- # FreeBSD NFSv4.2 server setup
- -# (tested with FreeBSD 14.3)
- +# (tested with FreeBSD 14.3 and FreeBSD 15.0)
- #
- ##### 1. Server setup
- @@ -239,6 +239,11 @@ printf 'vfs.nfsd.issue_delegations=1\n' >>'/etc/sysctl.conf'
- mkdir /nfsdata
- chmod a+rwxt /nfsdata
- +# configure ZFS pool so it can support NFSv4 named attributes
- +# (NFSv4 named attributes require FreeBSD >= 15.0-only)
- +zfs set xattr=dir zroot
- +zfs set xattr=dir zroot/ROOT/default
- +
- # NFSv4.1 exports must come after the 'V4: /' line,
- # otherwise you get a NFS4ERR_NOFILEHANDLE
- printf 'V4: /\n' >'/etc/exports'
- @@ -251,6 +256,8 @@ service nfsd start
- $ printf 'wheel:S-1-0-0:0:\n' >>'/etc/group'
- ##### 3. Misc FreeBSD commands:
- +# (assumes we want to add an account+groups for a Windows user called "ced"
- +# on a Windows with English locale)
- pw groupadd group -n None -g 197121
- pw groupadd group -n ced -g 197608
- pw useradd -n ced -u 197608 -g None -G None,ced -m -s /bin/sh
- --
- 2.51.0
- From c9e04a1324c7c26401755ec806832839850be473 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 6 Jan 2026 19:25:00 +0100
- Subject: [PATCH 3/7] daemon: Fix typo s/stream into/stream info/ in debug
- message
- Fix typo s/stream into/stream info/ in debug message.
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/winstreams.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/daemon/winstreams.c b/daemon/winstreams.c
- index 929fb81..c7ece55 100644
- --- a/daemon/winstreams.c
- +++ b/daemon/winstreams.c
- @@ -470,7 +470,7 @@ int get_streaminformation(
- if (basefile_info->type == NF4NAMEDATTR) {
- DPRINTF(0,
- ("get_streaminformation(name='%.*s'): "
- - "stream into for NF4NAMEDATTR not implemented yet\n",
- + "stream info for NF4NAMEDATTR not implemented yet\n",
- (int)state->file.name.len, state->file.name.name));
- return ERROR_NOT_SUPPORTED;
- }
- --
- 2.51.0
- From a919962cfe4f2d038c52f1ab9092b34a6b8e138e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 6 Jan 2026 19:47:38 +0100
- Subject: [PATCH 4/7] daemon: |FileStreamInformation| should return a default
- "::$DATA" entry if there is no NFSv4.1 named attr dir
- |FileStreamInformation| should return a default "::$DATA" entry if there is no NFSv4.1
- named attr dir.
- Solaris+Illumos always have an NFSv4.1 attribute directory because
- they store their SUNW_* attribute data there, but FreeBSD 15.0 does
- not have an attribute directory by default.
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/winstreams.c | 37 +++++++++++++++++++++++++++++++++++--
- 1 file changed, 35 insertions(+), 2 deletions(-)
- diff --git a/daemon/winstreams.c b/daemon/winstreams.c
- index c7ece55..1d42f6e 100644
- --- a/daemon/winstreams.c
- +++ b/daemon/winstreams.c
- @@ -478,13 +478,46 @@ int get_streaminformation(
- status = nfs41_rpc_openattr(state->session, &state->file, FALSE,
- &parent.fh);
- - /* No named attribute directory ? */
- + /*
- + * No named attribute directory ?
- + *
- + * (Solaris+Illumos always have an NFSv4.1 attribute directory because
- + * they store their SUNW_* attribute data there, but FreeBSD 15.0 does
- + * not have an attribute directory by default)
- + */
- if (status == NFS4ERR_NOENT) {
- - /* FIXME: We should return a default "file::$DATA" entry */
- + FILE_STREAM_INFORMATION *stream;
- + size_t streamsize;
- +
- + /* Return a default "file::$DATA" entry */
- DPRINTF(0,
- ("get_streaminformation(name='%.*s'): "
- "no named attribute directory\n",
- (int)state->file.name.len, state->file.name.name));
- +
- + FILE_STREAM_INFORMATION base_stream = {
- + .NextEntryOffset = 0,
- + /* "::$DATA" == 8*sizeof(wchar_t) */
- + .StreamNameLength = 8*sizeof(wchar_t),
- + .StreamSize.QuadPart = basefile_info->size,
- + .StreamAllocationSize.QuadPart = basefile_info->space_used
- + };
- +
- + streamsize = ALIGNED_STREAMINFOSIZE(base_stream.StreamNameLength);
- + stream = calloc(1, streamsize);
- + if (stream == NULL) {
- + status = GetLastError();
- + goto out;
- + }
- + (void)memcpy(stream, &base_stream, sizeof(base_stream));
- + (void)memcpy(stream->StreamName, L"::$DATA", 8*sizeof(wchar_t));
- + stream->NextEntryOffset = 0;
- +
- + *streamlist_out = stream;
- + *streamlist_out_size = (ULONG)streamsize;
- +
- + status = NO_ERROR;
- + goto out;
- } else if (status) {
- eprintf("get_streaminformation(name='%.*s'): "
- "nfs41_rpc_openattr() failed with '%s'\n",
- --
- 2.51.0
- From e53cb617eaaa8c1a498301aa4ae9bd5c3f374ac4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 7 Jan 2026 11:57:31 +0100
- Subject: [PATCH 5/7] daemon: Do not use |EXCLUSIVE4|/|EXCLUSIVE4_1| for
- NFSv4.1 named attributes
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- Do not use |EXCLUSIVE4|/|EXCLUSIVE4_1| for NFSv4.1 named attributes,
- as https://datatracker.ietf.org/doc/html/rfc8881#section-18.16.3 says:
- "... Note that exclusive create of a named attribute is not supported.
- If the createmode is EXCLUSIVE4 or EXCLUSIVE4_1 and the current filehandle
- is a named attribute directory, the server will return EINVAL. ...".
- Solaris 11.4 nfsd does not do that check, but FreeBSD 15.0 does
- enforce it.
- Reported-by: Aurelien Couderc <aurelien.couderc2002@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/open.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
- diff --git a/daemon/open.c b/daemon/open.c
- index 7010e17..c67c86a 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -1247,6 +1247,15 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- if (status)
- goto out_free_state;
- + if (is_stream_path(&state->path)) {
- + /*
- + * NFSv4.1 does not allow |EXCLUSIVE4|/|EXCLUSIVE4_1| for NFS
- + * named attributes
- + */
- + if (createhowmode == EXCLUSIVE4_1)
- + createhowmode = GUARDED4;
- + }
- +
- if (args->access_mask & FILE_EXECUTE && state->file.fh.len) {
- status = check_execute_access(state);
- if (status)
- --
- 2.51.0
- From 3f4ccee8dbb218630d1eccdd0f8545973a25dc06 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 7 Jan 2026 12:02:59 +0100
- Subject: [PATCH 6/7] daemon: Do not do access checks for X bit on NFS named
- attributes
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- Do not do access checks for X bit on NFS named attributes.
- Windows fsutil can set the |FILE_EXECUTE| bit when opening Win32
- named streams, but Solaris and FreeBSD NFS servers does not allow
- access checks with the X bit for NFS named attributes.
- Reported-by: Aurelien Couderc <aurelien.couderc2002@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/open.c | 7 +++++++
- 1 file changed, 7 insertions(+)
- diff --git a/daemon/open.c b/daemon/open.c
- index c67c86a..a86824c 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -1254,6 +1254,13 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- */
- if (createhowmode == EXCLUSIVE4_1)
- createhowmode = GUARDED4;
- +
- + /*
- + * Windows fsutil can set the |FILE_EXECUTE| bit when opening
- + * Win32 named streams, but NFS does not allow access checks
- + * with the X bit for NFS named attributes
- + */
- + args->access_mask &= ~FILE_EXECUTE;
- }
- if (args->access_mask & FILE_EXECUTE && state->file.fh.len) {
- --
- 2.51.0
- From 65c48cf88ae199e3a103ff9a51905a2f245e904a Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 7 Jan 2026 13:43:46 +0100
- Subject: [PATCH 7/7] README.md,docs: Document support for Win32 sparse named
- streams
- Document support for Win32 sparse named streams.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- README.md | 4 ++++
- docs/README.xml | 3 +++
- 2 files changed, 7 insertions(+)
- diff --git a/README.md b/README.md
- index df37c7b..49ce9c3 100644
- --- a/README.md
- +++ b/README.md
- @@ -145,6 +145,10 @@ NFSv4.2/NFSv4.1 filesystem driver for Windows 10/11 & Windows Server
- - Supports Win32 APIs `|FileStreamInformation|`
- + - Supports sparse streams (e.g. supports Win32 APIs
- + `|FSCTL_QUERY_ALLOCATED_RANGES|`, `|FSCTL_SET_SPARSE|`,
- + `|FSCTL_SET_ZERO_DATA|` etc. on Win32 named streams)
- +
- - Requires NFSv4.1 server which supports the NFSv4.1 named attributes.
- - Case-insensitive filesystem support
- diff --git a/docs/README.xml b/docs/README.xml
- index 39e1fdf..fc8b96e 100644
- --- a/docs/README.xml
- +++ b/docs/README.xml
- @@ -147,6 +147,9 @@
- <listitem>
- <para>Supports Win32 APIs <literal>|<link xl:href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_stream_information">FileStreamInformation</link>|</literal></para>
- </listitem>
- + <listitem>
- + <para>Supports sparse streams (e.g. supports Win32 APIs <literal>|FSCTL_QUERY_ALLOCATED_RANGES|</literal>, <literal>|FSCTL_SET_SPARSE|</literal>, <literal>|FSCTL_SET_ZERO_DATA|</literal> etc. on Win32 named streams)</para>
- + </listitem>
- <listitem>
- <para>Requires NFSv4.1 server which supports the NFSv4.1 named attributes.</para>
- </listitem>
- --
- 2.51.0
msnfs41client: Patches for Win32 named stream support, FreeBSD fixes, sparse streams, docs+misc, 2026-01-07
Posted by Anonymous on Wed 7th Jan 2026 12:50
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rovema.kpaste.net RSS