- From 43888120cdcaa7f8a6ec28b542afd4f6072cc728 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 30 Aug 2024 11:27:56 +0200
- Subject: [PATCH] daemon: Fix |bitmap4| |.count| |EASSERT()| tests in
- daemon/util.c
- Fix regression from "daemon: Add more asserts to verify
- whether nfs41_file_info data are valid", where the |EASSERT()|
- tests for |bitmap4| |.count| were off by one.
- Reviewed-by: Dan Shelton <dan.f.shelton@gmail.com>
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/util.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
- diff --git a/daemon/util.c b/daemon/util.c
- index c0d0f15..fd56972 100644
- --- a/daemon/util.c
- +++ b/daemon/util.c
- @@ -158,7 +158,7 @@ ULONG nfs_file_info_to_attributes(
- info->type));
- }
- - EASSERT((info->attrmask.count > 1) &&
- + EASSERT((info->attrmask.count > 0) &&
- (info->attrmask.arr[1] & FATTR4_WORD1_MODE));
- if (info->mode == 0444) /* XXX: 0444 for READONLY */
- attrs |= FILE_ATTRIBUTE_READONLY;
- @@ -177,7 +177,7 @@ void nfs_to_basic_info(
- IN const nfs41_file_info *info,
- OUT PFILE_BASIC_INFO basic_out)
- {
- - EASSERT(info->attrmask.count > 1);
- + EASSERT(info->attrmask.count > 0);
- if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
- nfs_time_to_file_time(&info->time_create, &basic_out->CreationTime);
- @@ -226,7 +226,7 @@ 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) &&
- + EASSERT((info->attrmask.count > 0) &&
- (info->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS));
- std_out->AllocationSize.QuadPart =
- @@ -242,7 +242,7 @@ void nfs_to_network_openinfo(
- IN const nfs41_file_info *info,
- OUT PFILE_NETWORK_OPEN_INFORMATION net_out)
- {
- - EASSERT(info->attrmask.count > 1);
- + EASSERT(info->attrmask.count > 0);
- if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
- nfs_time_to_file_time(&info->time_create, &net_out->CreationTime);
- --
- 2.45.1
msnfs41client: Fix off-by-one regression in daemon/util.c's |bitmap4.count| |EASSERT()| tests
Posted by Anonymous on Fri 30th Aug 2024 10:40
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.