- From 01c5bf30401581c0c9eb6ccaee3bc1309b0f689e Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 4 Mar 2025 12:53:18 +0100
- Subject: [PATCH] daemon: Remove comment about Windows issue in
- |query_sparsefile_datasections()|
- Remove comment about Windows issue in |query_sparsefile_datasections()|,
- this was a misinterpretation how the API should work.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/fsctl.c | 34 ++++++++++++++--------------------
- 1 file changed, 14 insertions(+), 20 deletions(-)
- diff --git a/daemon/fsctl.c b/daemon/fsctl.c
- index bc74363..87937cc 100644
- --- a/daemon/fsctl.c
- +++ b/daemon/fsctl.c
- @@ -178,29 +178,23 @@ int query_sparsefile_datasections(nfs41_open_state *state,
- outbuffer[i].Length.QuadPart = data_size;
- }
- else {
- - error_more_data = true;
- -
- - /* Windows bug:
- - * Technically we should continue until we reach
- - * |end_offset| to return the correct size of the
- - * buffer with |DeviceIoControl(...,
- - * FSCTL_QUERY_ALLOCATED_RANGES,...)| ==
- - * |ERROR_MORE_DATA|.
- + /*
- + * Return |ERROR_MORE_DATA| if we reach end of the
- + * caller-supplied record array and still have more
- + * data sections (i.e. no EOF from
- + + |NFS4_CONTENT_HOLE|/|NFS4_CONTENT_DATA| yet).
- *
- - * Unfortunaely Win10 fsutil will then return
- - * random values after the first 64 entries, so the
- - * best we can do for bug-by-bug compatibility is
- - * to do the same: Stop counting here, and
- - * therefore return
- - * |out_maxrecords*sizeof(FILE_ALLOCATED_RANGE_BUFFER)|,
- - * which is exactly the same number of bytes of the
- - * original buffer passed as argument
- + * FIXME: We should also implement |out_maxrecords==0|,
- + * and then return the size for an array to store
- + * all records.
- + * This can still be too small if between the first
- + * FSCTL call (to get the needed size of the array)
- + * and second FSCTL call to enumerate the
- + * |FILE_ALLOCATED_RANGE_BUFFER| someone adds more
- + * data sections.
- */
- -#define WINDOWS_FSUTILSPARSEQUERYRANGE_MOREDATA_BUG 1
- -
- -#ifdef WINDOWS_FSUTILSPARSEQUERYRANGE_MOREDATA_BUG
- + error_more_data = true;
- break;
- -#endif /* WINDOWS_FSUTILSPARSEQUERYRANGE_MOREDATA_BUG */
- }
- (*res_num_records)++;
- --
- 2.45.1
msnfs41client: Patch to fix the comments for |ERROR_MORE_DATA|, 2025-03-04
Posted by Anonymous on Tue 4th Mar 2025 12:33
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.