- From fe91d8b2cfb0891f57f9cb4617bf2f67bcd62a90 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 30 Jun 2025 13:36:47 +0200
- Subject: [PATCH 1/5] daemon: |UPCALL_BUF_SIZE| is too small to fit two
- |PATH_MAX| paths
- |UPCALL_BUF_SIZE| is too small to fit two |PATH_MAX| paths, because
- there needs to be room for the header, too.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_const.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h
- index ee9674a..02e7954 100644
- --- a/daemon/nfs41_const.h
- +++ b/daemon/nfs41_const.h
- @@ -59,7 +59,7 @@
- * This must fit at least twice the maximum path length
- * (for rename) plus header
- */
- -#define UPCALL_BUF_SIZE 8192
- +#define UPCALL_BUF_SIZE ((2*4096)+1024)
- /*
- * NFS41_MAX_COMPONENT_LEN - MaximumComponentNameLength
- --
- 2.45.1
- From e362d22b9f4687403beb160b092f5a425db6cf58 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 30 Jun 2025 13:41:25 +0200
- Subject: [PATCH 2/5] daemon,docs: nfs://-URLs for public NFS must be relative
- nfs://-URLs for public NFS must be relative (to the pubfh handle).
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/mount.c | 40 ++++++++++++++++++++++++++++++++--------
- docs/README.xml | 2 +-
- mount/enum.c | 16 +++++++++++-----
- mount/mount.c | 33 +++++++++++++++++++++++++++------
- 4 files changed, 71 insertions(+), 20 deletions(-)
- diff --git a/daemon/mount.c b/daemon/mount.c
- index 10dad58..11f9a8b 100644
- --- a/daemon/mount.c
- +++ b/daemon/mount.c
- @@ -80,27 +80,47 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- nfs41_root *root = NULL;
- nfs41_client *client;
- nfs41_path_fh file;
- +#ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- + LUID authenticationid = { .LowPart = 0, .HighPart = 0L };
- +#endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- EASSERT(args->hostport != NULL);
- -#ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- - LUID authenticationid = { .LowPart = 0, .HighPart = 0L };
- + if (args->use_nfspubfh) {
- + if (args->path[0] != '\\') {
- + eprintf("handle_mount: "
- + "public mount ('%s') root passed without backslash\n",
- + args->path);
- + status = ERROR_BAD_NETPATH;
- + goto out;
- + }
- +
- + /*
- + * public mounts should be relative to the pubfh. nfs_mount.exe
- + * added the slash in front do the Win32 API can handle the path,
- + * but for the NFS protocol only relative paths are allowed
- + */
- + args->path++;
- + }
- +#ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- /* We ignore errors here since this is for logging only */
- (void)get_token_authenticationid(upcall->currentthread_token,
- &authenticationid);
- logprintf("mount(hostport='%s', "
- - "use_nfspubfh=%d, path='%s', "
- + "use_nfspubfh=%d, %s='%s', "
- "authid=(0x%lx.0x%lx)) request\n",
- args->hostport?args->hostport:"<NULL>",
- (int)args->use_nfspubfh,
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>",
- (long)authenticationid.HighPart,
- (long)authenticationid.LowPart);
- #else
- - logprintf("mount(hostport='%s', path='%s') request\n",
- + logprintf("mount(hostport='%s', %s='%s') request\n",
- args->hostport?args->hostport:"<NULL>",
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>");
- #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- @@ -199,20 +219,22 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- out:
- if (status == 0) {
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- - logprintf("mount(hostport='%s', use_nfspubfh=%d, path='%s', "
- + logprintf("mount(hostport='%s', use_nfspubfh=%d, %s='%s', "
- "authid=(0x%lx.0x%lx)) success, root=0x%p, NFS version=4.%d\n",
- args->hostport?args->hostport:"<NULL>",
- (int)args->use_nfspubfh,
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>",
- (long)authenticationid.HighPart,
- (long)authenticationid.LowPart,
- root,
- (int)root->nfsminorvers);
- #else
- - logprintf("mount(hostport='%s', use_nfspubfh=%d, path='%s') success, "
- + logprintf("mount(hostport='%s', use_nfspubfh=%d, %s='%s') success, "
- "root=0x%p, NFS version=4.%d\n",
- args->hostport?args->hostport:"<NULL>",
- (int)args->use_nfspubfh,
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>",
- root,
- (int)root->nfsminorvers);
- @@ -220,19 +242,21 @@ out:
- }
- else {
- #ifdef NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE
- - logprintf("mount(hostport='%s', use_nfspubfh=%d, path='%s', "
- + logprintf("mount(hostport='%s', use_nfspubfh=%d, %s='%s', "
- "authid=(0x%lx.0x%lx))) failed, status=%d\n",
- args->hostport?args->hostport:"<NULL>",
- (int)args->use_nfspubfh,
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>",
- (long)authenticationid.HighPart,
- (long)authenticationid.LowPart,
- (int)status);
- #else
- - logprintf("mount(hostport='%s', use_nfspubfh=%d, path='%s') "
- + logprintf("mount(hostport='%s', use_nfspubfh=%d, %s='%s') "
- "failed, status=%d\n",
- args->hostport?args->hostport:"<NULL>",
- (int)args->use_nfspubfh,
- + (args->use_nfspubfh?"relative_path":"path"),
- args->path?args->path:"<NULL>",
- (int)status);
- #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- diff --git a/docs/README.xml b/docs/README.xml
- index be0949e..86f783e 100644
- --- a/docs/README.xml
- +++ b/docs/README.xml
- @@ -184,7 +184,7 @@
- </para>
- </listitem>
- <listitem>
- - <para>Support for NFSv4 public mounts (i.e., use the NFSv4 public file handle lookup protocol via <command>$ nfs_mount -o public ... #</command>)</para>
- + <para>Support for NFSv4 public mounts (i.e., use the NFSv4 public file handle lookup protocol via <command>$ nfs_mount -o public ... relative-path-or-url#</command>)</para>
- </listitem>
- <listitem>
- <para>Support for NFSv4 referrals
- diff --git a/mount/enum.c b/mount/enum.c
- index 455b888..11f8a6d 100644
- --- a/mount/enum.c
- +++ b/mount/enum.c
- @@ -159,19 +159,25 @@ void PrintMountLine(
- */
- if (slash_counter == 1) {
- *us++ = uc;
- - if (*utf8unc_p == 'p') {
- - /* Skip "pubnfs4" */
- - utf8unc_p += 7;
- + if (strncmp(utf8unc_p, "pubnfs4/", 8) == 0) {
- + /*
- + * Skip "pubnfs4/", the trailing slash is skipped
- + * because public nfs://-URLs must be relative to
- + * the pubfh
- + */
- + utf8unc_p += 8;
- + slash_counter++;
- is_pubfh = true;
- }
- - else if (*utf8unc_p == 'n') {
- + else if (strncmp(utf8unc_p, "nfs4/", 5) == 0) {
- /* Skip "nfs4" */
- utf8unc_p += 4;
- }
- else {
- (void)fwprintf(stderr,
- L"PrintMountLine: ## Internal error, "
- - "unknown provider prefix\n");
- + "unknown provider prefix, utf8unc_p='%s'\n",
- + utf8unc_p);
- return;
- }
- diff --git a/mount/mount.c b/mount/mount.c
- index d731a77..5fd1dda 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -191,7 +191,8 @@ void PrintMountUsage(LPWSTR pProcess)
- "\tnfs_mount.exe -o sec=sys,rw nfs://myhost1//dirwithspace/dir%%20space/test2\n"
- "\tnfs_mount.exe -o sec=sys,rw S nfs://myhost1//dirwithspace/dir+space/test2\n"
- "\tnfs_mount.exe -o sec=sys S nfs://myhost1//dirwithspace/dir+space/test2?rw=1\n"
- - "\tnfs_mount.exe -o sec=sys nfs://myhost1//dirwithspace/dir+space/test2?rw=1\n",
- + "\tnfs_mount.exe -o sec=sys nfs://myhost1//dirwithspace/dir+space/test2?rw=1\n"
- + "\tnfs_mount.exe -o public,sec=sys P nfs://myhost1/net_tmpfs2/test2\n",
- pProcess, pProcess, pProcess, pProcess,
- (int)NFS41_DRIVER_DEFAULT_DIR_CREATE_MODE,
- (int)NFS41_DRIVER_DEFAULT_FILE_CREATE_MODE,
- @@ -915,13 +916,33 @@ static DWORD ParseRemoteName(
- goto out;
- }
- - if (uctx->path[0] != '/') {
- - result = ERROR_BAD_ARGUMENTS;
- - (void)fwprintf(stderr, L"Relative nfs://-URLs are not supported\n");
- - goto out;
- + if (use_nfspubfh) {
- + if (uctx->path[0] == '/') {
- + result = ERROR_BAD_ARGUMENTS;
- + (void)fwprintf(stderr, L"Absolute nfs://-URLs are not permitted for public mounts\n");
- + goto out;
- + }
- +
- + /*
- + * Put '/' in front of the path to make sure the Network Provider
- + * API&co can handle it, the daemon code will treat the
- + * path as relative
- + */
- + char *tmppathbuff = _alloca(strlen(uctx->path)+2);
- + (void)sprintf(tmppathbuff, "/%s", uctx->path);
- +
- + pEnd = mountstrmem = utf8str2wcs(tmppathbuff);
- + }
- + else {
- + if (uctx->path[0] != '/') {
- + result = ERROR_BAD_ARGUMENTS;
- + (void)fwprintf(stderr, L"Relative nfs://-URLs are not permitted for non-public mounts\n");
- + goto out;
- + }
- +
- + pEnd = mountstrmem = utf8str2wcs(uctx->path);
- }
- - pEnd = mountstrmem = utf8str2wcs(uctx->path);
- if (!mountstrmem) {
- result = GetLastError();
- (void)fwprintf(stderr, L"Cannot convert URL path '%s', lasterr=%d\n",
- --
- 2.45.1
- From 93d09f5ff2bd10ec49a4a08c301ec5f525f09ca3 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 30 Jun 2025 14:42:08 +0200
- Subject: [PATCH 3/5] daemon: Fix error handling in |handle_mount()|
- Fix error handling in |handle_mount()|
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/mount.c | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
- diff --git a/daemon/mount.c b/daemon/mount.c
- index 11f9a8b..89f555c 100644
- --- a/daemon/mount.c
- +++ b/daemon/mount.c
- @@ -84,9 +84,12 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- LUID authenticationid = { .LowPart = 0, .HighPart = 0L };
- #endif /* NFS41_DRIVER_USE_AUTHENTICATIONID_FOR_MOUNT_NAMESPACE */
- - EASSERT(args->hostport != NULL);
- -
- - if (args->use_nfspubfh) {
- + /*
- + * Handle relative paths for public NFS
- + * (|args->path==NULL| should be logged below, but we bail out with
- + * an error immediately after that)
- + */
- + if (args->path && args->use_nfspubfh) {
- if (args->path[0] != '\\') {
- eprintf("handle_mount: "
- "public mount ('%s') root passed without backslash\n",
- @@ -130,8 +133,14 @@ static int handle_mount(void *daemon_context, nfs41_upcall *upcall)
- goto out;
- }
- + if (args->hostport == NULL) {
- + eprintf("handle_mount: hostport==NULL\n");
- + status = ERROR_BAD_NETPATH;
- + goto out;
- + }
- +
- if ((args->path == NULL) || (strlen(args->path) == 0)) {
- - DPRINTF(1, ("handle_mount: empty mount root\n"));
- + eprintf("handle_mount: empty mount root\n");
- status = ERROR_BAD_NETPATH;
- goto out;
- }
- --
- 2.45.1
- From 60cfa045d3840a44b76eeedb787d068999be08eb Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 30 Jun 2025 16:53:23 +0200
- Subject: [PATCH 4/5] tests: winfsinfo subcmd getvolumeinfo should support more
- data fields
- winfsinfo subcmd "getvolumeinfo" should support more data fields.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winfsinfo1/winfsinfo.c | 19 +++++++++++++++++--
- 1 file changed, 17 insertions(+), 2 deletions(-)
- diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
- index 8e28205..c72d606 100644
- --- a/tests/winfsinfo1/winfsinfo.c
- +++ b/tests/winfsinfo1/winfsinfo.c
- @@ -61,6 +61,10 @@ bool getvolumeinfo(const char *progname, const char *filename)
- {
- int res = EXIT_FAILURE;
- bool ok;
- + wchar_t volumeNameBuffer[MAX_PATH+1];
- + wchar_t fileSystemNameBuffer[MAX_PATH+1];
- + DWORD volumeSerialNumber = 0ULL;
- + DWORD maximumComponentLength = 0ULL;
- HANDLE fileHandle = CreateFileA(filename,
- GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- @@ -75,8 +79,14 @@ bool getvolumeinfo(const char *progname, const char *filename)
- }
- DWORD volumeFlags = 0;
- - ok = GetVolumeInformationByHandleW(fileHandle, NULL, 0,
- - NULL, NULL, &volumeFlags, NULL, 0);
- + ok = GetVolumeInformationByHandleW(fileHandle,
- + volumeNameBuffer,
- + sizeof(volumeNameBuffer),
- + &volumeSerialNumber,
- + &maximumComponentLength,
- + &volumeFlags,
- + fileSystemNameBuffer,
- + sizeof(fileSystemNameBuffer));
- if (!ok) {
- (void)fprintf(stderr, "%s: GetVolumeInformationByHandleW() "
- @@ -89,6 +99,11 @@ bool getvolumeinfo(const char *progname, const char *filename)
- (void)printf("(\n");
- (void)printf("\tfilename='%s'\n", filename);
- + (void)printf("\tvolumename='%ls'\n", volumeNameBuffer);
- + (void)printf("\tvolumeserialnumber=0x%lx\n", (long)volumeSerialNumber);
- + (void)printf("\tmaximumcomponentlength='%lu'\n", (long)maximumComponentLength);
- + (void)printf("\tfilesystemname='%ls'\n", fileSystemNameBuffer);
- +
- (void)printf("\ttypeset -A volumeflags=(\n");
- #define TESTVOLFLAG(s) \
- --
- 2.45.1
- From afa5df075f300ffaf846fcc2423a99ab02463482 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 30 Jun 2025 20:26:24 +0200
- Subject: [PATCH 5/5] daemon,include,sys: Win32 VolumeLabel should be unique
- Win32 VolumeLabel should be unique.
- We do this by constructing a nfs://-URL for the volume label's
- value.
- This is still a bit problematic: Windows 10 Explorer has a 32
- character limit for volume values, and it completly omits any
- volume name/label information if the string is longer.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/upcall.h | 8 ++++++++
- daemon/volume.c | 41 ++++++++++++++++++++++++++++++++++++++++-
- include/from_kernel.h | 8 ++++++++
- sys/nfs41sys_driver.c | 2 --
- sys/nfs41sys_driver.h | 9 ---------
- sys/nfs41sys_volinfo.c | 26 +-------------------------
- 6 files changed, 57 insertions(+), 37 deletions(-)
- diff --git a/daemon/upcall.h b/daemon/upcall.h
- index c14adc7..6575243 100644
- --- a/daemon/upcall.h
- +++ b/daemon/upcall.h
- @@ -172,6 +172,14 @@ typedef struct __volume_upcall_args {
- FS_INFORMATION_CLASS query;
- int len;
- union {
- +#pragma warning( push )
- +/* Disable warning C4201 ("nonstandard extension used: nameless struct/union") */
- +#pragma warning (disable : 4201)
- + struct {
- + FILE_FS_VOLUME_INFORMATION volume_info;
- + wchar_t volumelabelbuffer[MAX_PATH+1];
- + };
- +#pragma warning( pop )
- FILE_FS_SIZE_INFORMATION size;
- FILE_FS_ATTRIBUTE_INFORMATION attribute;
- FILE_FS_FULL_SIZE_INFORMATION fullsize;
- diff --git a/daemon/volume.c b/daemon/volume.c
- index f279e8e..2867386 100644
- --- a/daemon/volume.c
- +++ b/daemon/volume.c
- @@ -1,8 +1,10 @@
- /* NFSv4.1 client for Windows
- - * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2012 The Regents of the University of Michigan
- + * Copyright (C) 2023-2025 Roland Mainz <roland.mainz@nrubsig.org>
- *
- * Olga Kornievskaia <aglo@umich.edu>
- * Casey Bodley <cbodley@umich.edu>
- + * Roland Mainz <roland.mainz@nrubsig.org>
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- @@ -115,9 +117,46 @@ out:
- static int handle_volume(void *daemon_context, nfs41_upcall *upcall)
- {
- volume_upcall_args *args = &upcall->args.volume;
- + nfs41_session *session = upcall->state_ref->session;
- int status = NO_ERROR;
- switch (args->query) {
- + case FileFsVolumeInformation:
- + PFILE_FS_VOLUME_INFORMATION vi = &args->info.volume_info;
- +
- + vi->VolumeCreationTime.QuadPart = 0LL;
- + vi->VolumeSerialNumber = 0xBABAFACE;
- + vi->SupportsObjects = FALSE;
- +
- + /*
- + * |VolumeLabel| should be unique per volume, so we construct
- + * a nfs://-URL (without path)
- + *
- + * FIXME:
- + * - We should really work on |session->client->rpc->addrs| to
- + * peel-off the port number
- + */
- + (void)swprintf(vi->VolumeLabel,
- +#if 1
- + /*
- + * Windows bug:
- + * Windows Explorer can only handle up to 31 characters per label
- + * FIXME:
- + * Maybe a "workaround" would be to get the "naked" IPv4/IPv6 address
- + * from libtirpc's universal address
- + */
- + 31,
- +#else
- + (MAX_PATH*sizeof(wchar_t)),
- +#endif
- + L"nfs://%s:%d/%s",
- + session->client->rpc->server_name,
- + 2049,
- + (session->client->root->use_nfspubfh?"":""));
- + vi->VolumeLabelLength = (ULONG)(wcslen(vi->VolumeLabel)*sizeof(wchar_t));
- + args->len = sizeof(args->info.volume_info) + vi->VolumeLabelLength;
- + break;
- +
- case FileFsSizeInformation:
- args->len = sizeof(args->info.size);
- args->info.size.SectorsPerAllocationUnit = SECTORS_PER_UNIT;
- diff --git a/include/from_kernel.h b/include/from_kernel.h
- index db8817c..7a305bc 100644
- --- a/include/from_kernel.h
- +++ b/include/from_kernel.h
- @@ -456,6 +456,14 @@ typedef struct _FILE_FS_ATTRIBUTE_INFORMATION {
- } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
- /* ntddk.h */
- +typedef struct _FILE_FS_VOLUME_INFORMATION {
- + LARGE_INTEGER VolumeCreationTime;
- + ULONG VolumeSerialNumber;
- + ULONG VolumeLabelLength;
- + BOOLEAN SupportsObjects;
- + WCHAR VolumeLabel[1];
- +} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
- +
- typedef struct _FILE_FS_SIZE_INFORMATION {
- LARGE_INTEGER TotalAllocationUnits;
- LARGE_INTEGER AvailableAllocationUnits;
- diff --git a/sys/nfs41sys_driver.c b/sys/nfs41sys_driver.c
- index 3300723..20ac368 100644
- --- a/sys/nfs41sys_driver.c
- +++ b/sys/nfs41sys_driver.c
- @@ -1377,8 +1377,6 @@ NTSTATUS DriverEntry(
- RxDefineNode(dev_exts, NFS41_DEVICE_EXTENSION);
- dev_exts->DeviceObject = nfs41_dev;
- - nfs41_create_volume_info((PFILE_FS_VOLUME_INFORMATION)dev_exts->VolAttrs,
- - &dev_exts->VolAttrsLen);
- RtlInitUnicodeString(&user_dev_name, NFS41_SHADOW_DEVICE_NAME);
- DbgP("calling IoCreateSymbolicLink '%wZ' '%wZ'\n", &user_dev_name, &dev_name);
- diff --git a/sys/nfs41sys_driver.h b/sys/nfs41sys_driver.h
- index b8b3447..a40406d 100644
- --- a/sys/nfs41sys_driver.h
- +++ b/sys/nfs41sys_driver.h
- @@ -410,11 +410,6 @@ typedef struct _NFS41_NETROOT_EXTENSION {
- #define FS_NAME_LEN (sizeof(FS_NAME) - sizeof(WCHAR))
- #define FS_ATTR_LEN (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + FS_NAME_LEN)
- -/* FileSystemName as reported by FileFsAttributeInfo query */
- -#define VOL_NAME L"PnfsVolume"
- -#define VOL_NAME_LEN (sizeof(VOL_NAME) - sizeof(WCHAR))
- -#define VOL_ATTR_LEN (sizeof(FILE_FS_VOLUME_INFORMATION) + VOL_NAME_LEN)
- -
- typedef struct _NFS41_V_NET_ROOT_EXTENSION {
- NODE_TYPE_CODE NodeTypeCode;
- NODE_BYTE_SIZE NodeByteSize;
- @@ -484,8 +479,6 @@ typedef struct _NFS41_DEVICE_EXTENSION {
- ULONG ActiveNodes;
- HANDLE SharedMemorySection;
- DWORD nfs41d_version;
- - BYTE VolAttrs[VOL_ATTR_LEN];
- - DWORD VolAttrsLen;
- HANDLE openlistHandle;
- } NFS41_DEVICE_EXTENSION, *PNFS41_DEVICE_EXTENSION;
- @@ -896,7 +889,5 @@ NTSTATUS marshal_nfs41_volume(
- ULONG *len);
- NTSTATUS nfs41_QueryVolumeInformation(
- IN OUT PRX_CONTEXT RxContext);
- -void nfs41_create_volume_info(
- - PFILE_FS_VOLUME_INFORMATION pVolInfo, DWORD *len);
- #endif /* !_NFS41SYS_DRIVER_H_ */
- diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
- index a8435b9..d78a3da 100644
- --- a/sys/nfs41sys_volinfo.c
- +++ b/sys/nfs41sys_volinfo.c
- @@ -128,18 +128,6 @@ NTSTATUS map_volume_errors(
- }
- }
- -void nfs41_create_volume_info(PFILE_FS_VOLUME_INFORMATION pVolInfo, DWORD *len)
- -{
- - DECLARE_CONST_UNICODE_STRING(VolName, VOL_NAME);
- -
- - RtlZeroMemory(pVolInfo, sizeof(FILE_FS_VOLUME_INFORMATION));
- - pVolInfo->VolumeSerialNumber = 0xBABAFACE;
- - pVolInfo->VolumeLabelLength = VolName.Length;
- - RtlCopyMemory(&pVolInfo->VolumeLabel[0], (PVOID)VolName.Buffer,
- - VolName.MaximumLength);
- - *len = sizeof(FILE_FS_VOLUME_INFORMATION) + VolName.Length;
- -}
- -
- NTSTATUS nfs41_QueryVolumeInformation(
- IN OUT PRX_CONTEXT RxContext)
- {
- @@ -153,7 +141,6 @@ NTSTATUS nfs41_QueryVolumeInformation(
- __notnull PNFS41_NETROOT_EXTENSION pNetRootContext =
- NFS41GetNetRootExtension(SrvOpen->pVNetRoot->pNetRoot);
- __notnull PNFS41_FOBX nfs41_fobx = NFS41GetFobxExtension(RxContext->pFobx);
- - NFS41GetDeviceExtension(RxContext, DevExt);
- #ifdef ENABLE_TIMINGS
- LARGE_INTEGER t1, t2;
- @@ -171,18 +158,6 @@ NTSTATUS nfs41_QueryVolumeInformation(
- RtlZeroMemory(RxContext->Info.Buffer, RxContext->Info.LengthRemaining);
- switch (InfoClass) {
- - case FileFsVolumeInformation:
- - if ((ULONG)RxContext->Info.LengthRemaining >= DevExt->VolAttrsLen) {
- - RtlCopyMemory(RxContext->Info.Buffer, DevExt->VolAttrs,
- - DevExt->VolAttrsLen);
- - RxContext->Info.LengthRemaining -= DevExt->VolAttrsLen;
- - status = STATUS_SUCCESS;
- - } else {
- - RtlCopyMemory(RxContext->Info.Buffer, DevExt->VolAttrs,
- - RxContext->Info.LengthRemaining);
- - status = STATUS_BUFFER_OVERFLOW;
- - }
- - goto out;
- case FileFsDeviceInformation:
- {
- PFILE_FS_DEVICE_INFORMATION pDevInfo = RxContext->Info.Buffer;
- @@ -229,6 +204,7 @@ NTSTATUS nfs41_QueryVolumeInformation(
- case FileFsSizeInformation:
- case FileFsFullSizeInformation:
- case FileFsSectorSizeInformation:
- + case FileFsVolumeInformation:
- break;
- default:
- --
- 2.45.1
msnfs41client: Patches for upcall size increase, relative paths in public nfs://-URLs, unique volume labels+misc, 2025-06-30
Posted by Anonymous on Mon 30th Jun 2025 19:39
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.