pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


prototype STATUS_REPARSE_OBJECT
Posted by Anonymous on Tue 4th Mar 2025 16:27
raw | new post

  1. diff --git a/daemon/lookup.c b/daemon/lookup.c
  2. index be88a09..0045fad 100644
  3. --- a/daemon/lookup.c
  4. +++ b/daemon/lookup.c
  5. @@ -181,7 +181,7 @@ static int map_lookup_error(int status, bool_t last_component)
  6.      case NFS4ERR_NOENT:
  7.          if (last_component)     return ERROR_FILE_NOT_FOUND;
  8.          else                    return ERROR_PATH_NOT_FOUND;
  9. -    case NFS4ERR_SYMLINK:       return ERROR_REPARSE;
  10. +    case NFS4ERR_SYMLINK:       return ERROR_REPARSE_OBJECT;
  11.      case NFS4ERR_MOVED:         return ERROR_FILESYSTEM_ABSENT;
  12.      default: return nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
  13.      }
  14. @@ -363,7 +363,8 @@ static int server_lookup_loop(
  15.          status = server_lookup(session, dir, path->path, path_end, count,
  16.              &args, &res, &parent, &target, info_out);
  17.  
  18. -        if (status == ERROR_REPARSE) {
  19. +        if ((status == ERROR_REPARSE) ||
  20. +            (status == ERROR_REPARSE_OBJECT)) {
  21.              /* copy the component name of the symlink */
  22.              if (parent_out && parent) {
  23.                  const ptrdiff_t offset = parent->name.name - path->path;
  24. diff --git a/daemon/open.c b/daemon/open.c
  25. index f63b6ae..8b8e2ca 100644
  26. --- a/daemon/open.c
  27. +++ b/daemon/open.c
  28. @@ -733,7 +733,8 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  29.      status = nfs41_lookup(upcall->root_ref, nfs41_root_session(upcall->root_ref),
  30.          &state->path, &state->parent, &state->file, &info, &state->session);
  31.  
  32. -    if (status == ERROR_REPARSE) {
  33. +    if ((status == ERROR_REPARSE) ||
  34. +        (status == ERROR_REPARSE_OBJECT)) {
  35.          uint32_t depth = 0;
  36.          /* one of the parent components was a symlink */
  37.          do {
  38. @@ -754,12 +755,13 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  39.              /* redo the lookup until it doesn't return REPARSE */
  40.              status = nfs41_lookup(upcall->root_ref, state->session,
  41.                  &state->path, &state->parent, NULL, NULL, &state->session);
  42. -        } while (status == ERROR_REPARSE);
  43. +        } while ((status == ERROR_REPARSE) ||
  44. +            (status == ERROR_REPARSE_OBJECT));
  45.  
  46.          if (status == NO_ERROR || status == ERROR_FILE_NOT_FOUND) {
  47.              abs_path_copy(&args->symlink, &state->path);
  48.              status = NO_ERROR;
  49. -            upcall->last_error = ERROR_REPARSE;
  50. +            upcall->last_error = ERROR_REPARSE_OBJECT;
  51.              args->symlink_embedded = TRUE;
  52.              args->symlinktarget_type =
  53.                  NFS41_SYMLINKTARGET_FILESYSTEM_ABSOLUTE;
  54. @@ -813,7 +815,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  55.                  } else {
  56.                      symlink2ntpath(&args->symlink, &args->symlinktarget_type);
  57.                      /* tell the driver to call RxPrepareToReparseSymbolicLink() */
  58. -                    upcall->last_error = ERROR_REPARSE;
  59. +                    upcall->last_error = ERROR_REPARSE_OBJECT;
  60.                      args->symlink_embedded = FALSE;
  61.                  }
  62.                  goto out_free_state;
  63. @@ -1213,7 +1215,8 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
  64.      if (status) goto out;
  65.      status = safe_write(&buffer, length, &args->deleg_type, sizeof(args->deleg_type));
  66.      if (status) goto out;
  67. -    if (upcall->last_error == ERROR_REPARSE) {
  68. +    if ((upcall->last_error == ERROR_REPARSE) ||
  69. +        (upcall->last_error == ERROR_REPARSE_OBJECT)) {
  70.          unsigned short len = (args->symlink.len + 1) * sizeof(WCHAR);
  71.          status = safe_write(&buffer, length, &args->symlink_embedded, sizeof(BOOLEAN));
  72.          if (status) goto out;
  73. diff --git a/daemon/setattr.c b/daemon/setattr.c
  74. index 1e2bfdd..4ab7971 100644
  75. --- a/daemon/setattr.c
  76. +++ b/daemon/setattr.c
  77. @@ -408,7 +408,8 @@ static int handle_nfs41_rename(void *daemon_context, setattr_upcall_args *args)
  78.      status = nfs41_lookup(args->root, nfs41_root_session(args->root),
  79.          &dst_path, &dst_dir, &dst, NULL, &dst_session);
  80.  
  81. -    while (status == ERROR_REPARSE) {
  82. +    while ((status == ERROR_REPARSE) ||
  83. +        (status == ERROR_REPARSE_OBJECT)) {
  84.          if (++depth > NFS41_MAX_SYMLINK_DEPTH) {
  85.              status = ERROR_TOO_MANY_LINKS;
  86.              goto out;
  87. @@ -574,7 +575,8 @@ static int handle_nfs41_link(void *daemon_context, setattr_upcall_args *args)
  88.      status = nfs41_lookup(args->root, nfs41_root_session(args->root),
  89.          &dst_path, &dst_dir, &dst, NULL, &dst_session);
  90.  
  91. -    while (status == ERROR_REPARSE) {
  92. +    while ((status == ERROR_REPARSE) ||
  93. +        (status == ERROR_REPARSE_OBJECT)) {
  94.          if (++depth > NFS41_MAX_SYMLINK_DEPTH) {
  95.              status = ERROR_TOO_MANY_LINKS;
  96.              goto out;
  97. diff --git a/sys/nfs41sys_mount.c b/sys/nfs41sys_mount.c
  98. index 93a6d34..5aa0753 100644
  99. --- a/sys/nfs41sys_mount.c
  100. +++ b/sys/nfs41sys_mount.c
  101. @@ -1201,6 +1201,18 @@ NTSTATUS nfs41_CreateVNetRoot(
  102.      DbgP("Saving new session 0x%p\n", pVNetRootContext->session);
  103.  #endif
  104.  
  105. +#if 1
  106. +DbgP("#### old pNetRoot->DiskParameters=(ClusterSize=%lu, ReadAheadGranularity=%lu)\n",
  107. +    pNetRoot->DiskParameters.ClusterSize,
  108. +    pNetRoot->DiskParameters.ReadAheadGranularity);
  109. +
  110. +pNetRoot->DiskParameters.ReadAheadGranularity = 4096 * 1024;
  111. +
  112. +DbgP("#### new pNetRoot->DiskParameters=(ClusterSize=%lu, ReadAheadGranularity=%lu)\n",
  113. +    pNetRoot->DiskParameters.ClusterSize,
  114. +    pNetRoot->DiskParameters.ReadAheadGranularity);
  115. +#endif
  116. +
  117.  out_free:
  118.      RxFreePool(Config);
  119.  out:
  120. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  121. index 4d61e42..8fe59c8 100644
  122. --- a/sys/nfs41sys_openclose.c
  123. +++ b/sys/nfs41sys_openclose.c
  124. @@ -285,7 +285,8 @@ NTSTATUS unmarshal_nfs41_open(
  125.      *buf += sizeof(ULONGLONG);
  126.      RtlCopyMemory(&cur->u.Open.deleg_type, *buf, sizeof(DWORD));
  127.      *buf += sizeof(DWORD);
  128. -    if (cur->errno == ERROR_REPARSE) {
  129. +    if ((cur->errno == ERROR_REPARSE) ||
  130. +        (cur->errno == ERROR_REPARSE_OBJECT)) {
  131.          RtlCopyMemory(&cur->u.Open.symlink_embedded, *buf, sizeof(BOOLEAN));
  132.          *buf += sizeof(BOOLEAN);
  133.          BYTE tmp_symlinktarget_type;
  134. @@ -307,7 +308,9 @@ NTSTATUS unmarshal_nfs41_open(
  135.          RtlCopyMemory(cur->u.Open.symlink.Buffer, *buf,
  136.              cur->u.Open.symlink.MaximumLength);
  137.  #ifdef DEBUG_MARSHAL_DETAIL
  138. -        DbgP("unmarshal_nfs41_open: ERROR_REPARSE -> '%wZ'\n", &cur->u.Open.symlink);
  139. +        DbgP("unmarshal_nfs41_open: "
  140. +            "ERROR_REPARSE/ERROR_REPARSE_OBJECT -> '%wZ'\n",
  141. +            &cur->u.Open.symlink);
  142.  #endif
  143.      }
  144.  #ifdef DEBUG_MARSHAL_DETAIL
  145. @@ -407,6 +410,7 @@ NTSTATUS map_open_errors(
  146.      case ERROR_BAD_NETPATH:             return STATUS_BAD_NETWORK_PATH;
  147.      case ERROR_SHARING_VIOLATION:       return STATUS_SHARING_VIOLATION;
  148.      case ERROR_REPARSE:                 return STATUS_REPARSE;
  149. +    case ERROR_REPARSE_OBJECT:          return STATUS_REPARSE_OBJECT;
  150.      case ERROR_TOO_MANY_LINKS:          return STATUS_TOO_MANY_LINKS;
  151.      case ERROR_DIRECTORY:               return STATUS_FILE_IS_A_DIRECTORY;
  152.      case ERROR_BAD_FILE_TYPE:           return STATUS_NOT_A_DIRECTORY;
  153. @@ -726,12 +730,17 @@ retry_on_link:
  154.  
  155.      if (status) goto out;
  156.  
  157. -    if (entry->status == NO_ERROR && entry->errno == ERROR_REPARSE) {
  158. -        /* symbolic link handling. when attempting to open a symlink when the
  159. +    if ((entry->status == NO_ERROR) &&
  160. +        ((entry->errno == ERROR_REPARSE) ||
  161. +            (entry->errno == ERROR_REPARSE_OBJECT))) {
  162. +        /*
  163. +         * symbolic link handling. when attempting to open a symlink when the
  164.           * FILE_OPEN_REPARSE_POINT flag is not set, replace the filename with
  165.           * the symlink target's by calling RxPrepareToReparseSymbolicLink()
  166. -         * and returning STATUS_REPARSE. the object manager will attempt to
  167. -         * open the new path, and return its handle for the original open */
  168. +         * and returning STATUS_REPARSE/STATUS_REPARSE_OBJECT. the object
  169. +         * manager will attempt to open the new path, and return its handle
  170. +         * for the original open
  171. +         */
  172.          PRDBSS_DEVICE_OBJECT DeviceObject = RxContext->RxDeviceObject;
  173.          PV_NET_ROOT VNetRoot = (PV_NET_ROOT)
  174.              RxContext->pRelevantSrvOpen->pVNetRoot;
  175. @@ -812,7 +821,11 @@ retry_on_link:
  176.                  entry->u.Open.copts |= FILE_OPEN_REPARSE_POINT;
  177.                  goto retry_on_link;
  178.              }
  179. -            status = STATUS_REPARSE;
  180. +            status = STATUS_REPARSE_OBJECT;
  181. +        }
  182. +
  183. +        if (status == STATUS_REPARSE_OBJECT) {
  184. +            RxContext->CurrentIrp->IoStatus.Information = IO_REMOUNT;
  185.          }
  186.          goto out_free;
  187.      }

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at