- From a4df2b5d735d8b0e1028686679b84c74f187baaa Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 29 Aug 2024 12:51:42 +0200
- Subject: [PATCH 1/9] sys: Add infrastructure for file
- IOCTLs/|MRxLowIOSubmit[LOWIO_OP_IOCTL]|
- Add infrastructure for file IOCTLs/|MRxLowIOSubmit[LOWIO_OP_IOCTL]|
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 0c339d1..2a3f80a 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -64,6 +64,7 @@
- //#define DEBUG_EA_SET
- //#define DEBUG_LOCK
- #define DEBUG_FSCTL
- +#define DEBUG_IOCTL
- #define DEBUG_TIME_BASED_COHERENCY
- #define DEBUG_MOUNT
- //#define DEBUG_VOLUME_QUERY
- @@ -7383,6 +7384,26 @@ static NTSTATUS nfs41_FsCtl(
- return status;
- }
- +static NTSTATUS nfs41_IoCtl(
- + IN OUT PRX_CONTEXT RxContext)
- +{
- + NTSTATUS status = STATUS_INVALID_DEVICE_REQUEST;
- +#ifdef DEBUG_IOCTL
- + DbgEn();
- + print_debug_header(RxContext);
- +#endif /* DEBUG_IOCTL */
- + const ULONG iocontrolcode =
- + RxContext->LowIoContext.ParamsFor.IoCtl.IoControlCode;
- +
- + DbgP("nfs41_IoCtl: IoControlCode=0x%lx, status=0x%lx\n",
- + (unsigned long)iocontrolcode, (long)status);
- +
- +#ifdef DEBUG_IOCTL
- + DbgEx();
- +#endif
- + return status;
- +}
- +
- static NTSTATUS nfs41_CompleteBufferingStateChangeRequest(
- IN OUT PRX_CONTEXT RxContext,
- IN OUT PMRX_SRV_OPEN SrvOpen,
- @@ -7562,6 +7583,7 @@ static NTSTATUS nfs41_init_ops()
- nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK] = nfs41_Unlock;
- nfs41_ops.MRxLowIOSubmit[LOWIO_OP_UNLOCK_MULTIPLE] = nfs41_Unlock;
- nfs41_ops.MRxLowIOSubmit[LOWIO_OP_FSCTL] = nfs41_FsCtl;
- + nfs41_ops.MRxLowIOSubmit[LOWIO_OP_IOCTL] = nfs41_IoCtl;
- //
- // Miscellanous
- --
- 2.45.1
- From aa26f3d74bc843da596858f8eb6da3fd006e1d30 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 29 Aug 2024 13:11:49 +0200
- Subject: [PATCH 2/9] sys: |IOCTL_NFS41_INVALCACHE| should return errors
- |IOCTL_NFS41_INVALCACHE| should return errors, e.g. if passed
- |HANDLE| is invalid.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- sys/nfs41_driver.c | 18 ++++++++++++++----
- 1 file changed, 14 insertions(+), 4 deletions(-)
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 2a3f80a..83b415b 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -1419,23 +1419,34 @@ static NTSTATUS marshal_nfs41_shutdown(
- return marshal_nfs41_header(entry, buf, buf_len, len);
- }
- -static void nfs41_invalidate_cache(
- +static NTSTATUS nfs41_invalidate_cache(
- IN PRX_CONTEXT RxContext)
- {
- PLOWIO_CONTEXT LowIoContext = &RxContext->LowIoContext;
- unsigned char *buf = LowIoContext->ParamsFor.IoCtl.pInputBuffer;
- ULONG flag = DISABLE_CACHING;
- PMRX_SRV_OPEN srv_open;
- + NTSTATUS status;
- RtlCopyMemory(&srv_open, buf, sizeof(HANDLE));
- #ifdef DEBUG_INVALIDATE_CACHE
- DbgP("nfs41_invalidate_cache: received srv_open=0x%p '%wZ'\n",
- srv_open, srv_open->pAlreadyPrefixedName);
- #endif
- - if (MmIsAddressValid(srv_open))
- + if (MmIsAddressValid(srv_open)) {
- RxIndicateChangeOfBufferingStateForSrvOpen(
- srv_open->pFcb->pNetRoot->pSrvCall, srv_open,
- srv_open->Key, ULongToPtr(flag));
- + status = STATUS_SUCCESS;
- + }
- + else {
- + print_error("nfs41_invalidate_cache: "
- + "invalid ptr srv_open=0x%p file='%wZ'\n",
- + srv_open, srv_open->pAlreadyPrefixedName);
- + status = STATUS_INVALID_HANDLE;
- + }
- +
- + return status;
- }
- static NTSTATUS handle_upcall(
- @@ -2590,8 +2601,7 @@ static NTSTATUS nfs41_DevFcbXXXControlFile(
- print_fs_ioctl(0, fsop);
- switch (fsop) {
- case IOCTL_NFS41_INVALCACHE:
- - nfs41_invalidate_cache(RxContext);
- - status = STATUS_SUCCESS;
- + status = nfs41_invalidate_cache(RxContext);
- break;
- case IOCTL_NFS41_READ:
- status = nfs41_upcall(RxContext);
- --
- 2.45.1
- From baf9a85ffab7259ded12145513c8ce159b9d0385 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 29 Aug 2024 14:35:36 +0200
- Subject: [PATCH 3/9] daemon: Add more asserts to verify whether
- nfs41_file_info data are valid
- Add more asserts to verify whether nfs41_file_info data are valid
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/util.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
- diff --git a/daemon/util.c b/daemon/util.c
- index 178c285..30081c7 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -158,6 +158,8 @@ ULONG nfs_file_info_to_attributes(
- info->type));
- }
- + EASSERT((info->attrmask.count > 1) &&
- + (info->attrmask.arr[1] & FATTR4_WORD1_MODE));
- if (info->mode == 0444) /* XXX: 0444 for READONLY */
- attrs |= FILE_ATTRIBUTE_READONLY;
- @@ -175,6 +177,8 @@ void nfs_to_basic_info(
- IN const nfs41_file_info *info,
- OUT PFILE_BASIC_INFO basic_out)
- {
- + EASSERT(info->attrmask.count > 1);
- +
- if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
- nfs_time_to_file_time(&info->time_create, &basic_out->CreationTime);
- }
- @@ -221,6 +225,10 @@ void nfs_to_standard_info(
- {
- const ULONG FileAttributes = nfs_file_info_to_attributes(info);
- + EASSERT(info->attrmask.arr[0] & FATTR4_WORD0_SIZE);
- + EASSERT((info->attrmask.count > 1) &&
- + (info->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS));
- +
- std_out->AllocationSize.QuadPart =
- std_out->EndOfFile.QuadPart = (LONGLONG)info->size;
- std_out->NumberOfLinks = info->numlinks;
- @@ -234,6 +242,8 @@ void nfs_to_network_openinfo(
- IN const nfs41_file_info *info,
- OUT PFILE_NETWORK_OPEN_INFORMATION net_out)
- {
- + EASSERT(info->attrmask.count > 1);
- +
- if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
- nfs_time_to_file_time(&info->time_create, &net_out->CreationTime);
- }
- --
- 2.45.1
- From 70c42e3c36fb2ad1e8db57244108c577034ec620 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 29 Aug 2024 14:38:24 +0200
- Subject: [PATCH 4/9] daemon: Unify info.attrmask.count tests
- Unify info.attrmask.count tests
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 6 +++---
- daemon/ea.c | 2 +-
- daemon/getattr.c | 2 +-
- daemon/name_cache.c | 4 ++--
- daemon/nfs41_xdr.c | 6 +++---
- daemon/open.c | 12 ++++++------
- daemon/readwrite.c | 4 ++--
- daemon/setattr.c | 6 +++---
- 8 files changed, 21 insertions(+), 21 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index 3c5ba5b..8622678 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -332,7 +332,7 @@ use_nfs41_getattr:
- goto out;
- }
- - EASSERT(info.attrmask.count >= 2);
- + EASSERT(info.attrmask.count > 1);
- /*
- * In rare cases owner/owner_group are not in the cache
- @@ -346,7 +346,7 @@ use_nfs41_getattr:
- }
- }
- - EASSERT(info.attrmask.count >= 2);
- + EASSERT(info.attrmask.count > 1);
- EASSERT((info.attrmask.arr[1] & (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP)) == (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP));
- if (args->query & DACL_SECURITY_INFORMATION) {
- EASSERT((info.attrmask.arr[0] & (FATTR4_WORD0_ACL)) == (FATTR4_WORD0_ACL));
- @@ -1426,7 +1426,7 @@ static int handle_setacl(void *daemon_context, nfs41_upcall *upcall)
- else {
- args->ctime = info.change;
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- if (DPRINTF_LEVEL_ENABLED(ACLLVL1)) {
- diff --git a/daemon/ea.c b/daemon/ea.c
- index 7fb2091..ae967df 100644
- --- a/daemon/ea.c
- +++ b/daemon/ea.c
- @@ -193,7 +193,7 @@ static int handle_setexattr(void *daemon_context, nfs41_upcall *upcall)
- goto out;
- }
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- goto out;
- diff --git a/daemon/getattr.c b/daemon/getattr.c
- index c3b79b6..c193d40 100644
- --- a/daemon/getattr.c
- +++ b/daemon/getattr.c
- @@ -168,7 +168,7 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall)
- switch (args->query_class) {
- case FileBasicInformation:
- nfs_to_basic_info(state->file.name.name, &info, &args->basic_info);
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- break;
- diff --git a/daemon/name_cache.c b/daemon/name_cache.c
- index a21aaf2..dc0e615 100644
- --- a/daemon/name_cache.c
- +++ b/daemon/name_cache.c
- @@ -286,7 +286,7 @@ static void attr_cache_update(
- IN enum open_delegation_type4 delegation)
- {
- /* update the attributes present in mask */
- - if (info->attrmask.count >= 1) {
- + if (info->attrmask.count > 0) {
- if (info->attrmask.arr[0] & FATTR4_WORD0_TYPE)
- entry->type = (unsigned char)(info->type & NFS_FTYPE_MASK);
- if (info->attrmask.arr[0] & FATTR4_WORD0_CHANGE) {
- @@ -302,7 +302,7 @@ static void attr_cache_update(
- if (info->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE)
- entry->archive = info->archive;
- }
- - if (info->attrmask.count >= 2) {
- + if (info->attrmask.count > 1) {
- if (info->attrmask.arr[1] & FATTR4_WORD1_MODE)
- entry->mode = info->mode;
- if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
- diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
- index 2d3f11c..382feb7 100644
- --- a/daemon/nfs41_xdr.c
- +++ b/daemon/nfs41_xdr.c
- @@ -1735,7 +1735,7 @@ static bool_t decode_file_attrs(
- fattr4 *attrs,
- nfs41_file_info *info)
- {
- - if (attrs->attrmask.count >= 1) {
- + if (attrs->attrmask.count > 0) {
- if (attrs->attrmask.arr[0] & FATTR4_WORD0_SUPPORTED_ATTRS) {
- if (!xdr_bitmap4(xdr, info->supported_attrs))
- return FALSE;
- @@ -1819,7 +1819,7 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- }
- - if (attrs->attrmask.count >= 2) {
- + if (attrs->attrmask.count > 1) {
- if (attrs->attrmask.arr[1] & FATTR4_WORD1_MODE) {
- if (!xdr_u_int32_t(xdr, &info->mode))
- return FALSE;
- @@ -1901,7 +1901,7 @@ static bool_t decode_file_attrs(
- return FALSE;
- }
- }
- - if (attrs->attrmask.count >= 3) {
- + if (attrs->attrmask.count > 2) {
- if (attrs->attrmask.arr[2] & FATTR4_WORD2_MDSTHRESHOLD) {
- if (!xdr_mdsthreshold(xdr, &info->mdsthreshold))
- return FALSE;
- diff --git a/daemon/open.c b/daemon/open.c
- index 5b1bf49..545adf6 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -760,10 +760,10 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- }
- nfs_to_basic_info(state->file.name.name, &info, &args->basic_info);
- nfs_to_standard_info(&info, &args->std_info);
- - EASSERT((info.attrmask.count >= 2) &&
- + EASSERT((info.attrmask.count > 1) &&
- (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- } else if (open_for_attributes(state->type, args->access_mask,
- @@ -775,10 +775,10 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- nfs_to_basic_info(state->file.name.name, &info, &args->basic_info);
- nfs_to_standard_info(&info, &args->std_info);
- - EASSERT((info.attrmask.count >= 2) &&
- + EASSERT((info.attrmask.count > 1) &&
- (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- @@ -1005,10 +1005,10 @@ create_chgrp_out:
- nfs_to_basic_info(state->file.name.name, &info, &args->basic_info);
- nfs_to_standard_info(&info, &args->std_info);
- - EASSERT((info.attrmask.count >= 2) &&
- + EASSERT((info.attrmask.count > 1) &&
- (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- }
- diff --git a/daemon/readwrite.c b/daemon/readwrite.c
- index e8b5a8a..bdfb902 100644
- --- a/daemon/readwrite.c
- +++ b/daemon/readwrite.c
- @@ -240,7 +240,7 @@ retry_write:
- goto out;
- }
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- @@ -273,7 +273,7 @@ static int write_to_pnfs(
- status = ERROR_WRITE_FAULT;
- goto out;
- }
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index bd8c0e8..13dee18 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -145,7 +145,7 @@ static int handle_nfs41_setattr(void *daemon_context, setattr_upcall_args *args)
- status = nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
- goto out;
- }
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- @@ -385,7 +385,7 @@ static int handle_nfs41_set_size(void *daemon_context, setattr_upcall_args *args
- AcquireSRWLockExclusive(&state->lock);
- state->pnfs_last_offset = info.size ? info.size - 1 : 0;
- ReleaseSRWLockExclusive(&state->lock);
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- @@ -490,7 +490,7 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
- status = nfs_to_windows_error(status, ERROR_INVALID_PARAMETER);
- goto out;
- }
- - EASSERT((info.attrmask.count >= 1) &&
- + EASSERT((info.attrmask.count > 0) &&
- (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- --
- 2.45.1
- From f1e164e17528b8d9c57d3e2f4b39dc01b3a82458 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 29 Aug 2024 14:52:19 +0200
- Subject: [PATCH 5/9] daemon: nfs41_delegate_open() should use
- nfs41_file_info_cpy()
- nfs41_delegate_open() should use nfs41_file_info_cpy() to copy
- a nfs41_file_info.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/delegation.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
- diff --git a/daemon/delegation.c b/daemon/delegation.c
- index c3bf58c..0578618 100644
- --- a/daemon/delegation.c
- +++ b/daemon/delegation.c
- @@ -514,7 +514,8 @@ int nfs41_delegate_open(
- goto out_deleg;
- if (create == OPEN4_CREATE) {
- - memcpy(info, createattrs, sizeof(nfs41_file_info));
- + EASSERT(createattrs != NULL);
- + nfs41_file_info_cpy(info, createattrs);
- /* write delegations allow us to simulate OPEN4_CREATE with SETATTR */
- status = delegation_truncate(deleg, client, &stateid, info);
- --
- 2.45.1
- From 2c159da4d726c3d4f3de36259411e95c5da9ea61 Mon Sep 17 00:00:00 2001
- From: Dan Shelton <dan.f.shelton@gmail.com>
- Date: Thu, 29 Aug 2024 14:53:56 +0200
- Subject: [PATCH 6/9] daemon: do_open() should use stateid4_cpy() to copy a
- state id
- do_open() should use stateid4_cpy() to copy a state id
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/open.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/daemon/open.c b/daemon/open.c
- index 545adf6..04c40e0 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -326,7 +326,7 @@ static int do_open(
- AcquireSRWLockExclusive(&state->lock);
- /* update the stateid */
- - memcpy(&state->stateid, &open_stateid, sizeof(open_stateid));
- + stateid4_cpy(&state->stateid, &open_stateid);
- state->do_close = 1;
- state->delegation.state = deleg_state;
- ReleaseSRWLockExclusive(&state->lock);
- --
- 2.45.1
- From 9cb3c651fd11da123ef643ab1e9b4001fe9c162e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 29 Aug 2024 15:06:38 +0200
- Subject: [PATCH 7/9] daemon: Add |open_delegation4_cpy()| as a type-safe way
- to copy an |open_delegation4|
- Add |open_delegation4_cpy()| as a type-safe way to copy an
- |open_delegation4|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/delegation.c | 2 +-
- daemon/recovery.c | 6 +++---
- daemon/util.h | 7 +++++++
- 3 files changed, 11 insertions(+), 4 deletions(-)
- diff --git a/daemon/delegation.c b/daemon/delegation.c
- index 0578618..a9e72a8 100644
- --- a/daemon/delegation.c
- +++ b/daemon/delegation.c
- @@ -49,7 +49,7 @@ static int delegation_create(
- goto out;
- }
- - memcpy(&state->state, delegation, sizeof(open_delegation4));
- + open_delegation4_cpy(&state->state, delegation);
- abs_path_copy(&state->path, file->path);
- path_fh_init(&state->file, &state->path);
- diff --git a/daemon/recovery.c b/daemon/recovery.c
- index e784b2f..83d176e 100644
- --- a/daemon/recovery.c
- +++ b/daemon/recovery.c
- @@ -266,7 +266,7 @@ static int recover_open(
- eprintf("recover_open() got delegation type %u, "
- "expected %u\n", delegation.type, deleg->state.type);
- } else {
- - memcpy(&deleg->state, &delegation, sizeof(open_delegation4));
- + open_delegation4_cpy(&deleg->state, &delegation);
- deleg->revoked = FALSE;
- }
- ReleaseSRWLockExclusive(&deleg->lock);
- @@ -385,7 +385,7 @@ static int recover_delegation_want(
- eprintf("recover_delegation_want() got delegation type %u, "
- "expected %u\n", delegation.type, deleg->state.type);
- } else {
- - memcpy(&deleg->state, &delegation, sizeof(open_delegation4));
- + open_delegation4_cpy(&deleg->state, &delegation);
- deleg->revoked = FALSE;
- }
- ReleaseSRWLockExclusive(&deleg->lock);
- @@ -444,7 +444,7 @@ static int recover_delegation_open(
- eprintf("recover_delegation_open() got delegation type %u, "
- "expected %u\n", delegation.type, deleg->state.type);
- } else {
- - memcpy(&deleg->state, &delegation, sizeof(open_delegation4));
- + open_delegation4_cpy(&deleg->state, &delegation);
- deleg->revoked = FALSE;
- }
- ReleaseSRWLockExclusive(&deleg->lock);
- diff --git a/daemon/util.h b/daemon/util.h
- index a9053db..2b13d06 100644
- --- a/daemon/util.h
- +++ b/daemon/util.h
- @@ -164,6 +164,13 @@ static __inline int stateid4_cmp(
- return memcmp(s1, s2, sizeof(stateid4));
- }
- +static __inline void open_delegation4_cpy(
- + OUT open_delegation4 *restrict dst,
- + IN const open_delegation4 *restrict src)
- +{
- + (void)memcpy(dst, src, sizeof(open_delegation4));
- +}
- +
- ULONG nfs_file_info_to_attributes(
- IN const nfs41_file_info *info);
- void nfs_to_basic_info(
- --
- 2.45.1
- From 64552a0fddf26a8620e2349976d9b0265c1e3c34 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 29 Aug 2024 16:02:13 +0200
- Subject: [PATCH 8/9] daemon: Use |memcpy()|, not |CopyMemory()|
- Use |memcpy()|, not |CopyMemory()| - |CopyMemory()| is a define to
- |memcpy()| anyway, and just confuses people.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/util.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- diff --git a/daemon/util.c b/daemon/util.c
- index 30081c7..c0d0f15 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -43,7 +43,7 @@ int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t des
- if (*remaining < dest_len)
- return ERROR_BUFFER_OVERFLOW;
- - CopyMemory(dest, *pos, dest_len);
- + (void)memcpy(dest, *pos, dest_len);
- *pos += dest_len;
- *remaining -= dest_len;
- return 0;
- @@ -54,7 +54,7 @@ int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src
- if (*remaining < src_len)
- return ERROR_BUFFER_OVERFLOW;
- - CopyMemory(*pos, src, src_len);
- + (void)memcpy(*pos, src, src_len);
- *pos += src_len;
- *remaining -= src_len;
- return 0;
- --
- 2.45.1
- From 1156e51fd4d86a7b3489c900412729f277cdb30d Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Thu, 29 Aug 2024 16:37:29 +0200
- Subject: [PATCH 9/9] tests: Document Windows kernel debugger setup
- Document how to setup and use the Windows kernel debugger.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/manual_testing.txt | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 380d618..154b8d3 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -70,6 +70,22 @@
- # sc query cygserver
- # ---- snip ----
- #
- +# - Windows Kernel debugger setup:
- +# 1. Install "winsdksetup.exe" from
- +# https://go.microsoft.com/fwlink/?linkid=2164145 on all machines
- +# involved
- +# 2. Machine "A" runs ms-nfs41-client, and has the IPv4 address
- +# 10.49.202.87
- +# 3. Machine "B" runs the "kd" kernel debugger frontend, and has the
- +# IPv4 address 10.49.202.231
- +# 4. Setup on machine "A":
- +# $ PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
- +# $ bcdedit /dbgsettings net hostip:10.49.202.87 port:50000 key:1.1.1.1
- +# $ kdnet 10.49.202.231 50000
- +# 5. Run kernel debugger frontend on machine "B":
- +# $ PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
- +# $ kd -loga kdlog.log -k net:port=50000,key=1.1.1.1,target=10.49.202.87 #
- +#
- #
- # Tests for cp -p/mv/chmod/chgrp
- --
- 2.45.1
msnfs41client: Patches for cleanup, debuggging code, testing+misc, 2024-08-29
Posted by Anonymous on Thu 29th Aug 2024 15:45
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.