- diff --git a/daemon/lookup.c b/daemon/lookup.c
- index be88a09..0045fad 100644
- --- a/daemon/lookup.c
- +++ b/daemon/lookup.c
- @@ -181,7 +181,7 @@ static int map_lookup_error(int status, bool_t last_component)
- case NFS4ERR_NOENT:
- if (last_component) return ERROR_FILE_NOT_FOUND;
- else return ERROR_PATH_NOT_FOUND;
- - case NFS4ERR_SYMLINK: return ERROR_REPARSE;
- + case NFS4ERR_SYMLINK: return ERROR_REPARSE_OBJECT;
- case NFS4ERR_MOVED: return ERROR_FILESYSTEM_ABSENT;
- default: return nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
- }
- @@ -363,7 +363,8 @@ static int server_lookup_loop(
- status = server_lookup(session, dir, path->path, path_end, count,
- &args, &res, &parent, &target, info_out);
- - if (status == ERROR_REPARSE) {
- + if ((status == ERROR_REPARSE) ||
- + (status == ERROR_REPARSE_OBJECT)) {
- /* copy the component name of the symlink */
- if (parent_out && parent) {
- const ptrdiff_t offset = parent->name.name - path->path;
- diff --git a/daemon/open.c b/daemon/open.c
- index f63b6ae..8b8e2ca 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -733,7 +733,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- status = nfs41_lookup(upcall->root_ref, nfs41_root_session(upcall->root_ref),
- &state->path, &state->parent, &state->file, &info, &state->session);
- - if (status == ERROR_REPARSE) {
- + if ((status == ERROR_REPARSE) ||
- + (status == ERROR_REPARSE_OBJECT)) {
- uint32_t depth = 0;
- /* one of the parent components was a symlink */
- do {
- @@ -754,12 +755,13 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- /* redo the lookup until it doesn't return REPARSE */
- status = nfs41_lookup(upcall->root_ref, state->session,
- &state->path, &state->parent, NULL, NULL, &state->session);
- - } while (status == ERROR_REPARSE);
- + } while ((status == ERROR_REPARSE) ||
- + (status == ERROR_REPARSE_OBJECT));
- if (status == NO_ERROR || status == ERROR_FILE_NOT_FOUND) {
- abs_path_copy(&args->symlink, &state->path);
- status = NO_ERROR;
- - upcall->last_error = ERROR_REPARSE;
- + upcall->last_error = ERROR_REPARSE_OBJECT;
- args->symlink_embedded = TRUE;
- args->symlinktarget_type =
- NFS41_SYMLINKTARGET_FILESYSTEM_ABSOLUTE;
- @@ -813,7 +815,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
- } else {
- symlink2ntpath(&args->symlink, &args->symlinktarget_type);
- /* tell the driver to call RxPrepareToReparseSymbolicLink() */
- - upcall->last_error = ERROR_REPARSE;
- + upcall->last_error = ERROR_REPARSE_OBJECT;
- args->symlink_embedded = FALSE;
- }
- goto out_free_state;
- @@ -1213,7 +1215,8 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
- if (status) goto out;
- status = safe_write(&buffer, length, &args->deleg_type, sizeof(args->deleg_type));
- if (status) goto out;
- - if (upcall->last_error == ERROR_REPARSE) {
- + if ((upcall->last_error == ERROR_REPARSE) ||
- + (upcall->last_error == ERROR_REPARSE_OBJECT)) {
- unsigned short len = (args->symlink.len + 1) * sizeof(WCHAR);
- status = safe_write(&buffer, length, &args->symlink_embedded, sizeof(BOOLEAN));
- if (status) goto out;
- diff --git a/daemon/setattr.c b/daemon/setattr.c
- index 1e2bfdd..4ab7971 100644
- --- a/daemon/setattr.c
- +++ b/daemon/setattr.c
- @@ -408,7 +408,8 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
- status = nfs41_lookup(args->root, nfs41_root_session(args->root),
- &dst_path, &dst_dir, &dst, NULL, &dst_session);
- - while (status == ERROR_REPARSE) {
- + while ((status == ERROR_REPARSE) ||
- + (status == ERROR_REPARSE_OBJECT)) {
- if (++depth > NFS41_MAX_SYMLINK_DEPTH) {
- status = ERROR_TOO_MANY_LINKS;
- goto out;
- @@ -574,7 +575,8 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
- status = nfs41_lookup(args->root, nfs41_root_session(args->root),
- &dst_path, &dst_dir, &dst, NULL, &dst_session);
- - while (status == ERROR_REPARSE) {
- + while ((status == ERROR_REPARSE) ||
- + (status == ERROR_REPARSE_OBJECT)) {
- if (++depth > NFS41_MAX_SYMLINK_DEPTH) {
- status = ERROR_TOO_MANY_LINKS;
- goto out;
- diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
- index 93a6d34..5aa0753 100644
- --- a/sys/nfs41sys_mount.c
- +++ b/sys/nfs41sys_mount.c
- @@ -1201,6 +1201,18 @@ NTSTATUS nfs41_CreateVNetRoot(
- DbgP("Saving new session 0x%p\n", pVNetRootContext->session);
- #endif
- +#if 1
- +DbgP("#### old pNetRoot->DiskParameters=(ClusterSize=%lu, ReadAheadGranularity=%lu)\n",
- + pNetRoot->DiskParameters.ClusterSize,
- + pNetRoot->DiskParameters.ReadAheadGranularity);
- +
- +pNetRoot->DiskParameters.ReadAheadGranularity = 4096 * 1024;
- +
- +DbgP("#### new pNetRoot->DiskParameters=(ClusterSize=%lu, ReadAheadGranularity=%lu)\n",
- + pNetRoot->DiskParameters.ClusterSize,
- + pNetRoot->DiskParameters.ReadAheadGranularity);
- +#endif
- +
- out_free:
- RxFreePool(Config);
- out:
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index 4d61e42..8fe59c8 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -285,7 +285,8 @@ NTSTATUS unmarshal_nfs41_open(
- *buf += sizeof(ULONGLONG);
- RtlCopyMemory(&cur->u.Open.deleg_type, *buf, sizeof(DWORD));
- *buf += sizeof(DWORD);
- - if (cur->errno == ERROR_REPARSE) {
- + if ((cur->errno == ERROR_REPARSE) ||
- + (cur->errno == ERROR_REPARSE_OBJECT)) {
- RtlCopyMemory(&cur->u.Open.symlink_embedded, *buf, sizeof(BOOLEAN));
- *buf += sizeof(BOOLEAN);
- BYTE tmp_symlinktarget_type;
- @@ -307,7 +308,9 @@ NTSTATUS unmarshal_nfs41_open(
- RtlCopyMemory(cur->u.Open.symlink.Buffer, *buf,
- cur->u.Open.symlink.MaximumLength);
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
- + DbgP("unmarshal_nfs41_open: "
- + "ERROR_REPARSE/ERROR_REPARSE_OBJECT -> '%wZ'\n",
- + &cur->u.Open.symlink);
- #endif
- }
- #ifdef DEBUG_MARSHAL_DETAIL
- @@ -407,6 +410,7 @@ NTSTATUS map_open_errors(
- case ERROR_BAD_NETPATH: return STATUS_BAD_NETWORK_PATH;
- case ERROR_SHARING_VIOLATION: return STATUS_SHARING_VIOLATION;
- case ERROR_REPARSE: return STATUS_REPARSE;
- + case ERROR_REPARSE_OBJECT: return STATUS_REPARSE_OBJECT;
- case ERROR_TOO_MANY_LINKS: return STATUS_TOO_MANY_LINKS;
- case ERROR_DIRECTORY: return STATUS_FILE_IS_A_DIRECTORY;
- case ERROR_BAD_FILE_TYPE: return STATUS_NOT_A_DIRECTORY;
- @@ -726,12 +730,17 @@ retry_on_link:
- if (status) goto out;
- - if (entry->status == NO_ERROR && entry->errno == ERROR_REPARSE) {
- - /* symbolic link handling. when attempting to open a symlink when the
- + if ((entry->status == NO_ERROR) &&
- + ((entry->errno == ERROR_REPARSE) ||
- + (entry->errno == ERROR_REPARSE_OBJECT))) {
- + /*
- + * symbolic link handling. when attempting to open a symlink when the
- * FILE_OPEN_REPARSE_POINT flag is not set, replace the filename with
- * the symlink target's by calling RxPrepareToReparseSymbolicLink()
- - * and returning STATUS_REPARSE. the object manager will attempt to
- - * open the new path, and return its handle for the original open */
- + * and returning STATUS_REPARSE/STATUS_REPARSE_OBJECT. the object
- + * manager will attempt to open the new path, and return its handle
- + * for the original open
- + */
- PRDBSS_DEVICE_OBJECT DeviceObject = RxContext->RxDeviceObject;
- PV_NET_ROOT VNetRoot = (PV_NET_ROOT)
- RxContext->pRelevantSrvOpen->pVNetRoot;
- @@ -812,7 +821,11 @@ retry_on_link:
- entry->u.Open.copts |= FILE_OPEN_REPARSE_POINT;
- goto retry_on_link;
- }
- - status = STATUS_REPARSE;
- + status = STATUS_REPARSE_OBJECT;
- + }
- +
- + if (status == STATUS_REPARSE_OBJECT) {
- + RxContext->CurrentIrp->IoStatus.Information = IO_REMOUNT;
- }
- goto out_free;
- }
prototype STATUS_REPARSE_OBJECT
Posted by Anonymous on Tue 4th Mar 2025 16:27
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.