- From 7cb8cbf08bb255f64b9e0435c71bb27464c149c4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 5 Nov 2025 12:45:53 +0100
- Subject: [PATCH 1/5] daemon: Only use NFSv4.2 attributes if we use NFS >= v4.2
- Only use NFSv4.2 attributes (e.g. |FATTR4_WORD2_OFFLINE|) if we use
- NFS >= v4.2.
- Reported-by: Lionel Cons <lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/lookup.c | 8 ++++++--
- daemon/nfs41_superblock.c | 7 +++++--
- 2 files changed, 11 insertions(+), 4 deletions(-)
- diff --git a/daemon/lookup.c b/daemon/lookup.c
- index 3257eee..40ea2dd 100644
- --- a/daemon/lookup.c
- +++ b/daemon/lookup.c
- @@ -89,6 +89,7 @@ typedef struct __nfs41_lookup_component_res {
- static void init_component_args(
- + IN nfs41_session *session,
- IN nfs41_lookup_component_args *args,
- IN nfs41_lookup_component_res *res,
- IN nfs41_abs_path *path,
- @@ -107,7 +108,10 @@ static void init_component_args(
- | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE
- | FATTR4_WORD1_TIME_MODIFY
- | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
- - args->attr_request.arr[2] = FATTR4_WORD2_OFFLINE;
- + args->attr_request.arr[2] = 0;
- + if (session->client->root->nfsminorvers >= 2) {
- + args->attr_request.arr[2] |= FATTR4_WORD2_OFFLINE;
- + }
- args->getrootattr.attr_request = &args->attr_request;
- res->root.path = path;
- @@ -357,7 +361,7 @@ static int server_lookup_loop(
- uint32_t count;
- int status = NO_ERROR;
- - init_component_args(&args, &res, path, referral);
- + init_component_args(session, &args, &res, path, referral);
- parent = NULL;
- target = NULL;
- diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
- index 8777feb..7722048 100644
- --- a/daemon/nfs41_superblock.c
- +++ b/daemon/nfs41_superblock.c
- @@ -169,7 +169,7 @@ static int get_superblock_attrs(
- superblock->time_delta.seconds = 1;
- /* initialize the default getattr mask */
- - superblock->default_getattr.count = 2;
- + superblock->default_getattr.count = 3;
- superblock->default_getattr.arr[0] = FATTR4_WORD0_TYPE
- | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE
- | FATTR4_WORD0_FSID | FATTR4_WORD0_FILEID
- @@ -179,7 +179,10 @@ static int get_superblock_attrs(
- | FATTR4_WORD1_SYSTEM
- | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE
- | FATTR4_WORD1_TIME_MODIFY;
- - superblock->default_getattr.arr[2] = FATTR4_WORD2_OFFLINE;
- + superblock->default_getattr.arr[2] = 0;
- + if (root->nfsminorvers >= 2) {
- + superblock->default_getattr.arr[2] |= FATTR4_WORD2_OFFLINE;
- + }
- nfs41_superblock_supported_attrs(superblock, &superblock->default_getattr);
- --
- 2.51.0
- From 057d57883c3bcdfcb9b59b3f5281f053804e61cd Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 5 Nov 2025 12:58:10 +0100
- Subject: [PATCH 2/5] tests: winoffloadcopyfile should delete destination file
- on failure
- winoffloadcopyfile should delete destination file on failure.
- Reported-by: Lionel Cons <lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/winoffloadcopyfile/winoffloadcopyfile.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
- diff --git a/tests/winoffloadcopyfile/winoffloadcopyfile.c b/tests/winoffloadcopyfile/winoffloadcopyfile.c
- index 5669140..05ccf6a 100644
- --- a/tests/winoffloadcopyfile/winoffloadcopyfile.c
- +++ b/tests/winoffloadcopyfile/winoffloadcopyfile.c
- @@ -307,6 +307,19 @@ int main(int ac, char *av[])
- retval = EXIT_SUCCESS;
- cleanup:
- + if ((retval != EXIT_SUCCESS) && (hDest != INVALID_HANDLE_VALUE)) {
- + (void)printf("# Failure, deleting destination file...\n");
- +
- + FILE_DISPOSITION_INFO di = { .DeleteFile = TRUE };
- + bResult = SetFileInformationByHandle(hDest,
- + FileDispositionInfo, &di, sizeof(di));
- + if (!bResult) {
- + (void)fprintf(stderr,
- + "Cannot mark destination file for deletion, lasterr=%d\n",
- + (int)GetLastError());
- + }
- + }
- +
- if (hSrc != INVALID_HANDLE_VALUE) {
- (void)CloseHandle(hSrc);
- }
- --
- 2.51.0
- From 3ab905ee89516ed05c3a21c4c4f2946984917eb0 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 5 Nov 2025 13:10:28 +0100
- Subject: [PATCH 3/5] daemon: Only query |FATTR4_WORD2_CLONE_BLKSIZE| if we
- want to do a NFSv4.2 CLONE
- Only query |FATTR4_WORD2_CLONE_BLKSIZE| if we want to do a NFSv4.2 CLONE.
- Reported-by: Lionel Cons <lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 44f2f57..a8353c1 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -796,8 +796,13 @@ int handle_duplicatedata(void *daemon_context,
- .count = 3,
- .arr[0] = FATTR4_WORD0_SIZE|FATTR4_WORD0_FSID,
- .arr[1] = 0UL,
- - .arr[2] = FATTR4_WORD2_CLONE_BLKSIZE
- + .arr[2] = 0UL
- };
- +
- + if (upcall->opcode == NFS41_SYSOP_FSCTL_DUPLICATE_DATA) {
- + dst_attr_request.arr[2] |= FATTR4_WORD2_CLONE_BLKSIZE;
- + }
- +
- (void)memset(&info, 0, sizeof(info));
- status = nfs41_getattr(dst_session, dst_file, &dst_attr_request,
- &info);
- --
- 2.51.0
- From 2343f98303012e2b661623e6f5fc88ee3b8a738f Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 5 Nov 2025 13:20:46 +0100
- Subject: [PATCH 4/5] daemon: |get_superblock_attrs()| should report
- |FATTR4_WORD2_OFFLINE| support
- |get_superblock_attrs()| should report |FATTR4_WORD2_OFFLINE| support.
- Reported-by: Lionel Cons <lionelcons1972@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_superblock.c | 5 +++++
- 1 file changed, 5 insertions(+)
- diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
- index 7722048..3e64444 100644
- --- a/daemon/nfs41_superblock.c
- +++ b/daemon/nfs41_superblock.c
- @@ -237,6 +237,11 @@ static int get_superblock_attrs(
- *is++ = ',';
- is = stpcpy(is, "SYSTEM");
- }
- + if (bitmap_isset(&superblock->supported_attrs, 2, FATTR4_WORD2_OFFLINE)) {
- + if (is != infobuff)
- + *is++ = ',';
- + is = stpcpy(is, "OFFLINE");
- + }
- logprintf("get_superblock_attrs(fsid=(%llu,%llu)): "
- "Supported Windows/DOS attributes: { %s }\n",
- superblock->fsid.major, superblock->fsid.minor,
- --
- 2.51.0
- From a4f6da897b0dcdd98d98b3b5fc7cfd374edf90a4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 5 Nov 2025 13:41:37 +0100
- Subject: [PATCH 5/5] daemon: Cygwin idmapper should catch empty/invalid
- passwd+group names early
- Cygwin idmapper should catch empty/invalid passwd+group names early.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/idmap_cygwin.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
- diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c
- index d7b4fd4..64ede3a 100644
- --- a/daemon/idmap_cygwin.c
- +++ b/daemon/idmap_cygwin.c
- @@ -69,6 +69,14 @@ int cygwin_getent_passwd(const char *name, char *res_loginname, uid_t *res_uid,
- ("--> cygwin_getent_passwd(name='%s')\n",
- name));
- + if (name[0] == '\0') {
- + DPRINTF(0,
- + ("cygwin_getent_passwd(name='%s'): "
- + "ERROR: Empty user name.\n",
- + name));
- + goto fail;
- + }
- +
- /* fixme: better quoting for |name| needed */
- (void)snprintf(cmdbuff, sizeof(cmdbuff),
- "%s nfsserver_owner2localaccount \"%s\"",
- @@ -215,6 +223,14 @@ int cygwin_getent_group(const char* name, char* res_group_name, gid_t* res_gid)
- ("--> cygwin_getent_group(name='%s')\n",
- name));
- + if (name[0] == '\0') {
- + DPRINTF(0,
- + ("cygwin_getent_group(name='%s'): "
- + "ERROR: Empty group name.\n",
- + name));
- + goto fail;
- + }
- +
- /* fixme: better quoting for |name| needed */
- (void)snprintf(cmdbuff, sizeof(cmdbuff),
- "%s nfsserver_owner_group2localgroup \"%s\"",
- --
- 2.51.0
msnfs41client: Patches for NFSv4.2 attribute handling+misc, 2025-11-05
Posted by Anonymous on Wed 5th Nov 2025 12:54
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