- From f1a72eb40fbd9fd8c39d00a9cb75f6d5767efe35 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 28 Feb 2025 10:15:57 +0100
- Subject: [PATCH 1/5] tests: nfsbuildtest.ksh93 should install always in
- builddir/install_root
- nfsbuildtest.ksh93 should install always in builddir/install_root,
- otherwise we affect the system installation.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/nfsbuildtest/nfsbuildtest.ksh93 | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
- diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
- index 3f3e653..92d0cf7 100644
- --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
- +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
- @@ -174,7 +174,7 @@ function gcc_build
- set -o xtrace
- time ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make --load-average 32 -j12 all)'
- printf "######## gcc build make all returned %d\n" $?
- - time ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make --load-average 32 -j12 install)'
- + time ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make --load-average 32 -j12 install DESTDIR="$PWD/install_root")'
- printf "######## gcc build make install returned %d\n" $?
- )
- @@ -331,15 +331,15 @@ function bash_build
- #
- if $config_use_posix_ksh93_builtins ; then
- if is_cygwin && (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
- - time ksh93 -c 'export SHELL=/bin/ksh93 ; bmake -j16 install DESTDIR=$PWD/install_root'
- + time ksh93 -c 'export SHELL=/bin/ksh93 ; bmake -j16 install DESTDIR="$PWD/install_root"'
- else
- - time ksh93 -c 'export SHELL=/bin/ksh93 ; make -j16 install DESTDIR=$PWD/install_root'
- + time ksh93 -c 'export SHELL=/bin/ksh93 ; make -j16 install DESTDIR="$PWD/install_root"'
- fi
- else
- if is_cygwin && (( (cygwin_vers.major*1000+cygwin_vers.minor) >= 3005 )) ; then
- - time bash -c 'export SHELL=/bin/bash ; bmake -j16 install DESTDIR=$PWD/install_root'
- + time bash -c 'export SHELL=/bin/bash ; bmake -j16 install DESTDIR="$PWD/install_root"'
- else
- - time bash -c 'export SHELL=/bin/bash ; make -j16 install DESTDIR=$PWD/install_root'
- + time bash -c 'export SHELL=/bin/bash ; make -j16 install DESTDIR="$PWD/install_root"'
- fi
- fi
- echo $?
- --
- 2.45.1
- From cfcd5cec5ab0ea45ceead923404fedf165ac01df Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 28 Feb 2025 10:28:48 +0100
- Subject: [PATCH 2/5] daemon: Fix "'>': signed/unsigned mismatch" warning in
- |query_sparsefile_datasections()|
- Fix "'>': signed/unsigned mismatch" warning in
- |query_sparsefile_datasections()|, |LARGE_INTEGER.QuadPart| is
- |signed int64_t|, the the other argument was |uint64_t|
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 12fc2ce..2ff49b2 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -176,7 +176,7 @@ int query_sparsefile_datasections(nfs41_open_state *state,
- outbuffer[i].Length.QuadPart = data_size;
- (*res_num_records)++;
- - if (outbuffer[i].FileOffset.QuadPart > end_offset) {
- + if ((uint64_t)outbuffer[i].FileOffset.QuadPart > end_offset) {
- DPRINTF(QARLVL,
- ("end offset reached, "
- "outbuffer[%d].FileOffset.QuadPart(=%lld) > end_offset(=%lld)\n",
- --
- 2.45.1
- From 528b944a5d50ad29c5500ccd4cb59fb9eaf9a063 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 28 Feb 2025 11:27:33 +0100
- Subject: [PATCH 3/5] daemon: Replace manual attrmask count/arr attr tests with
- |bitmap_isset()|
- Replace manual attrmask count/arr attr tests with |bitmap_isset()|.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/acl.c | 12 ++++++------
- daemon/ea.c | 3 +--
- daemon/fileinfoutil.c | 14 +++++---------
- daemon/fsctl.c | 3 +--
- daemon/getattr.c | 3 +--
- daemon/open.c | 36 ++++++++++++------------------------
- daemon/readwrite.c | 6 ++----
- daemon/setattr.c | 9 +++------
- 8 files changed, 31 insertions(+), 55 deletions(-)
- diff --git a/daemon/acl.c b/daemon/acl.c
- index e69c81c..dbfa975 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -368,17 +368,18 @@ use_nfs41_getattr:
- * (usually for new files). In this case do a full
- * roundtrip to the NFS server to get the data...
- */
- - if ((info.attrmask.arr[1] &
- - (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP)) != (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP)) {
- + if (bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_OWNER) &&
- + bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_OWNER_GROUP)) {
- DPRINTF(ACLLVL2, ("handle_getattr: owner/owner_group not in cache, doing full lookup...\n"));
- goto use_nfs41_getattr;
- }
- }
- EASSERT(info.attrmask.count > 1);
- - EASSERT((info.attrmask.arr[1] & (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP)) == (FATTR4_WORD1_OWNER|FATTR4_WORD1_OWNER_GROUP));
- + EASSERT(bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_OWNER) &&
- + bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_OWNER_GROUP));
- if (args->query & DACL_SECURITY_INFORMATION) {
- - EASSERT((info.attrmask.arr[0] & (FATTR4_WORD0_ACL)) == (FATTR4_WORD0_ACL));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_ACL));
- }
- status = InitializeSecurityDescriptor(&sec_desc,
- @@ -1480,8 +1481,7 @@ static int handle_setacl(void *daemon_context, nfs41_upcall *upcall)
- else {
- args->ctime = info.change;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- if (DPRINTF_LEVEL_ENABLED(ACLLVL1)) {
- print_nfs41_file_info("handle_setacl: nfs41_setattr() success info OUT:", &info);
- diff --git a/daemon/ea.c b/daemon/ea.c
- index bca060c..00211a9 100644
- --- a/daemon/ea.c
- +++ b/daemon/ea.c
- @@ -203,8 +203,7 @@ static int handle_setexattr(void *daemon_context, nfs41_upcall *upcall)
- goto out;
- }
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- goto out;
- }
- diff --git a/daemon/fileinfoutil.c b/daemon/fileinfoutil.c
- index bb23b41..be684fc 100644
- --- a/daemon/fileinfoutil.c
- +++ b/daemon/fileinfoutil.c
- @@ -60,8 +60,7 @@ ULONG nfs_file_info_to_attributes(
- info->type));
- }
- - EASSERT((info->attrmask.count > 0) &&
- - (info->attrmask.arr[1] & FATTR4_WORD1_MODE));
- + EASSERT(bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_MODE));
- if (info->mode == 0444) /* XXX: 0444 for READONLY */
- attrs |= FILE_ATTRIBUTE_READONLY;
- @@ -137,11 +136,9 @@ void nfs_to_standard_info(
- const ULONG FileAttributes =
- nfs_file_info_to_attributes(superblock, info);
- - EASSERT(info->attrmask.arr[0] & FATTR4_WORD0_SIZE);
- - EASSERT((info->attrmask.count > 0) &&
- - (info->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS));
- - EASSERT((info->attrmask.count > 0) &&
- - (info->attrmask.arr[1] & FATTR4_WORD1_SPACE_USED));
- + EASSERT(bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_SIZE));
- + EASSERT(bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_NUMLINKS));
- + EASSERT(bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_SPACE_USED));
- std_out->EndOfFile.QuadPart = (LONGLONG)info->size;
- std_out->AllocationSize.QuadPart = (LONGLONG)info->space_used;
- @@ -402,8 +399,7 @@ void nfs_to_stat_lx_info(
- break;
- }
- - EASSERT((info->attrmask.count > 0) &&
- - (info->attrmask.arr[1] & FATTR4_WORD1_MODE));
- + EASSERT(bitmap_isset(&info->attrmask, 1, FATTR4_WORD1_MODE));
- if (info->mode & MODE4_RUSR)
- stat_lx_out->LxMode |= LX_MODE_S_IREAD;
- if (info->mode & MODE4_WUSR)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index 2ff49b2..29092b2 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -355,8 +355,7 @@ int handle_setzerodata(void *daemon_context,
- }
- /* Update ctime on success */
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- DPRINTF(SZDLVL,
- diff --git a/daemon/getattr.c b/daemon/getattr.c
- index 2a8e037..c3c8741 100644
- --- a/daemon/getattr.c
- +++ b/daemon/getattr.c
- @@ -178,8 +178,7 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall)
- }
- }
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- switch (args->query_class) {
- diff --git a/daemon/open.c b/daemon/open.c
- index 2fbea48..f63b6ae 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -878,18 +878,14 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- nfs_to_standard_info(state->file.fh.superblock,
- &info,
- &args->std_info);
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FILEID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FILEID));
- args->fileid = info.fileid;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FSID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FSID));
- args->fsid_major = info.fsid.major;
- args->fsid_minor = info.fsid.minor;
- - EASSERT((info.attrmask.count > 1) &&
- - (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- + EASSERT(bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- } else if (open_for_attributes(state->type, args->access_mask,
- args->disposition, status)) {
- @@ -905,18 +901,14 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- nfs_to_standard_info(state->file.fh.superblock,
- &info,
- &args->std_info);
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FILEID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FILEID));
- args->fileid = info.fileid;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FSID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FSID));
- args->fsid_major = info.fsid.major;
- args->fsid_minor = info.fsid.minor;
- - EASSERT((info.attrmask.count > 1) &&
- - (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- + EASSERT(bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- @@ -1149,18 +1141,14 @@ create_chgrp_out:
- nfs_to_standard_info(state->file.fh.superblock,
- &info,
- &args->std_info);
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FILEID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FILEID));
- args->fileid = info.fileid;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_FSID));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_FSID));
- args->fsid_major = info.fsid.major;
- args->fsid_minor = info.fsid.minor;
- - EASSERT((info.attrmask.count > 1) &&
- - (info.attrmask.arr[1] & FATTR4_WORD1_MODE));
- + EASSERT(bitmap_isset(&info.attrmask, 1, FATTR4_WORD1_MODE));
- args->mode = info.mode;
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->changeattr = info.change;
- }
- diff --git a/daemon/readwrite.c b/daemon/readwrite.c
- index 99afd58..a474904 100644
- --- a/daemon/readwrite.c
- +++ b/daemon/readwrite.c
- @@ -307,8 +307,7 @@ retry_write:
- goto out;
- }
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- @@ -342,8 +341,7 @@ static int write_to_pnfs(
- status = ERROR_WRITE_FAULT;
- goto out;
- }
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- return status;
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index d42612e..1e2bfdd 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -171,8 +171,7 @@ static int handle_nfs41_setattr_basicinfo(void *daemon_context, setattr_upcall_a
- status = nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
- goto out;
- }
- - EASSERT((info.attrmask.count > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- return status;
- @@ -533,8 +532,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 > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- return status = nfs_to_windows_error(status, ERROR_NOT_SUPPORTED);
- @@ -647,8 +645,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 > 0) &&
- - (info.attrmask.arr[0] & FATTR4_WORD0_CHANGE));
- + EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
- args->ctime = info.change;
- out:
- return status;
- --
- 2.45.1
- From 0023467d2bae35d4bbc7b71e513eda2bf3ea43d4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 28 Feb 2025 15:14:56 +0100
- Subject: [PATCH 4/5] daemon: |nfs41_superblock_getattr()| should handle
- unexpected errors from |OP_OPENATTR|
- |nfs41_superblock_getattr()| should handle unexpected errors from
- |OP_OPENATTR|.
- Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/nfs41_ops.c | 6 ++++++
- 1 file changed, 6 insertions(+)
- diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
- index 7f8f870..36a4b40 100644
- --- a/daemon/nfs41_ops.c
- +++ b/daemon/nfs41_ops.c
- @@ -1251,6 +1251,12 @@ int nfs41_superblock_getattr(
- if (status) goto out;
- switch (status = openattr_res.status) {
- + default:
- + eprintf("nfs41_superblock_getattr: "
- + "Unexpected NFS error '%s' while probing named attr "
- + "support\n",
- + nfs_error_string(status));
- + /* fall-through */
- case NFS4ERR_NOTSUPP:
- *supports_named_attrs = 0;
- status = NFS4_OK;
- --
- 2.45.1
- From 6ae0cde5e94693cec99071d59aeadb48f7c133ec Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 28 Feb 2025 17:32:40 +0100
- Subject: [PATCH 5/5] cygwin: Add more cdb debugging comments to
- msnfs41client.bash
- Add more cdb debugging comments to msnfs41client.bash
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 42b4a86..e812c83 100755
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -467,7 +467,13 @@ function nfsclient_rundeamon
- "${nfsd_args[@]}"
- elif false ; then
- export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD");srv*https://msdl.microsoft.com/download/symbols"
- - # use '!gflag +full;g' for heap tests, eats lots of memory
- + #
- + # Useful cdb cmds:
- + # - heap tests (eats lots of memory):
- + # '-c' '!gflag +full;g' for heap tests
- + # - log all |malloc()|/|calloc()| calls:
- + # '-c' 'bp ucrtbase!malloc "kp; g" ; bp ucrtbased!_malloc_dbg "kp; g" ; bp ucrtbase!calloc "kp; g" ; bp ucrtbased!_calloc_dbg "kp; g" ; g'
- + #
- nfsd_args=(
- 'cdb'
- '-c' '!gflag +soe;sxe -c "kp;gn" *;.lines -e;g'
- @@ -595,7 +601,11 @@ function nfsclient_system_rundeamon
- "${nfsd_args[@]}"
- elif false ; then
- export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD");srv*https://msdl.microsoft.com/download/symbols"
- - # use '!gflag +full;g' for heap tests, eats lots of memory
- + # - heap tests (eats lots of memory):
- + # '-c' '!gflag +full;g' for heap tests
- + # - log all |malloc()|/|calloc()| calls:
- + # '-c' 'bp ucrtbase!malloc "kp; g" ; bp ucrtbased!_malloc_dbg "kp; g" ; bp ucrtbase!calloc "kp; g" ; bp ucrtbased!_calloc_dbg "kp; g" ; g'
- + #
- nfsd_args=(
- 'cdb'
- '-c' '!gflag +soe;sxe -c "kp;gn" *;.lines -e;g'
- --
- 2.45.1
msnfs41client: Patches for tests, cleanup+misc, 2025-02-28
Posted by Anonymous on Fri 28th Feb 2025 17:52
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.