Difference between
modified post 4a7fd by Anonymous on Thu 30th Nov 2023 05:57
original post 4ceb32ca by Anonymous on Thu 30th Nov 2023 02:57
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | diff --git a/daemon/getattr.c b/daemon/getattr.c | |
| 2 | 2 | index 7c5f241..7621dba 100644 | |
| 3 | 3 | --- a/daemon/getattr.c | |
| 4 | 4 | +++ b/daemon/getattr.c | |
| 5 | 5 | @@ -59,8 +59,19 @@ int nfs41_cached_getattr( | |
| 6 | 6 | static int parse_getattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall) | |
| 7 | 7 | { | |
| 8 | 8 | int status; | |
| 9 | 9 | +#if 1 | |
| 10 | 10 | + EASSERT(length > 4); | |
| 11 | 11 | + if (length <= 4) { | |
| 12 | 12 | + status = ERROR_INVALID_PARAMETER; | |
| 13 | 13 | + goto out; | |
| 14 | 14 | + } | |
| 15 | 15 | + EASSERT(upcall->state_ref != NULL); | |
| 16 | 16 | + if (upcall->state_ref == NULL) { | |
| 17 | 17 | + status = ERROR_INVALID_PARAMETER; | |
| 18 | 18 | + goto out; | |
| 19 | 19 | + } | |
| 20 | 20 | +#endif | |
| 21 | 21 | getattr_upcall_args *args = &upcall->args.getattr; | |
| 22 | 22 | - | |
| 23 | 23 | status = safe_read(&buffer, &length, &args->query_class, sizeof(args->query_class)); | |
| 24 | 24 | if (status) goto out; | |
| 25 | 25 | status = safe_read(&buffer, &length, &args->buf_len, sizeof(args->buf_len)); | |
| 26 | 26 | @@ -80,6 +91,21 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall) | |
| 27 | 27 | nfs41_open_state *state = upcall->state_ref; | |
| 28 | 28 | nfs41_file_info info = { 0 }; | |
| 29 | 29 | ||
| 30 | 30 | +#if 1 | |
| 31 | 31 | + if (((char *)state->session) == ((char *)0xdddddddddddddddd)) { | |
| 32 | 32 | + eprintf("handle_getattr: Invalid session pointer 0xdddddddddddddddd\n"); | |
| 33 | 33 | + status = ERROR_INVALID_PARAMETER; | |
| 34 | 34 | + goto out; | |
| 35 | 35 | + } | |
| 36 | 36 | + | |
| 37 | 37 | + EASSERT(state->file.fh.superblock != NULL); | |
| 38 | 38 | + if (state->file.fh.superblock == NULL) { | |
| 39 | 39 | + /* gisburn: fixme: maybe this should be |ERROR_INTERNAL_ERROR| ? */ | |
| 40 | 40 | + status = ERROR_INVALID_PARAMETER; | |
| 41 | 41 | + goto out; | |
| 42 | 42 | + } | |
| 43 | 43 | +#endif | |
| 44 | 44 | + | |
| 45 | 45 | status = nfs41_cached_getattr(state->session, &state->file, &info); | |
| 46 | 46 | if (status) { | |
| 47 | 47 | eprintf("nfs41_cached_getattr() failed with %d\n", status); | |
| 48 | 48 | diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c | |
| 49 | 49 | index bcca070..f2a4f22 100644 | |
| 50 | 50 | --- a/daemon/nfs41_ops.c | |
| 51 | 51 | +++ b/daemon/nfs41_ops.c | |
| 52 | 52 | @@ -400,6 +400,9 @@ int nfs41_open( | |
| 53 | 53 | bool_t already_delegated = delegation->type == OPEN_DELEGATE_READ | |
| 54 | 54 | || delegation->type == OPEN_DELEGATE_WRITE; | |
| 55 | 55 | ||
| 56 | 56 | + EASSERT(parent); | |
| 57 | 57 | + EASSERT(parent->fh.superblock); | |
| 58 | 58 | + | |
| 59 | 59 | /* depending on the claim type, OPEN expects CURRENT_FH set | |
| 60 | 60 | * to either the parent directory, or to the file itself */ | |
| 61 | 61 | switch (claim->claim) { | |
| 62 | 62 | diff --git a/daemon/open.c b/daemon/open.c | |
| 63 | 63 | index 4b2a335..487c341 100644 | |
| 64 | 64 | --- a/daemon/open.c | |
| 65 | 65 | +++ b/daemon/open.c | |
| 66 | 66 | @@ -99,6 +99,24 @@ static void open_state_free( | |
| 67 | 67 | void nfs41_open_state_ref( | |
| 68 | 68 | IN nfs41_open_state *state) | |
| 69 | 69 | { | |
| 70 | 70 | +#if 1 | |
| 71 | 71 | + /* | |
| 72 | 72 | + * gisburn: fixme: sometimes this happens under high parallel | |
| 73 | 73 | + * usage with multiple mounts - but why ? | |
| 74 | 74 | + * 0:038> kp | |
| 75 | 75 | + * Child-SP RetAddr Call Site | |
| 76 | 76 | + * 0000006d`431fde10 00007ff7`32f7d905 nfsd!nfs41_open_state_ref(struct __nfs41_open_state * state = 0x00000000`00000000)+0x31 | |
| 77 | 77 | + * 0000006d`431fdf30 00007ff7`32f4d284 nfsd!upcall_parse(unsigned char * buffer = 0x0000006d`431fe180 "???", unsigned int length = 8, struct __nfs41_upcall * upcall = 0x0000006d`431ff1e0)+0x2e5 | |
| 78 | 78 | + * 0000006d`431fe0b0 00007ffc`1ca24c7c nfsd!thread_main(void * args = 0x00007ff7`32fb6080)+0x144 | |
| 79 | 79 | + * 0000006d`431ffe00 00007ffc`4d4b7344 ucrtbased!thread_start<unsigned int (void * parameter = 0x0000025d`a9c6def0)+0x9c | |
| 80 | 80 | + * 0000006d`431ffe60 00007ffc`4efc26b1 KERNEL32!BaseThreadInitThunk+0x14 | |
| 81 | 81 | + * 0000006d`431ffe90 00000000`00000000 ntdll!RtlUserThreadStart+0x21 | |
| 82 | 82 | + */ | |
| 83 | 83 | + EASSERT(state != NULL); | |
| 84 | 84 | + if (state == NULL) | |
| 85 | 85 | + return; | |
| 86 | 86 | +#endif | |
| 87 | 87 | + | |
| 88 | 88 | const LONG count = InterlockedIncrement(&state->ref_count); | |
| 89 | 89 | ||
| 90 | 90 | dprintf(2, "nfs41_open_state_ref(%s) count %d\n", state->path.path, count); | |
| 91 | 91 | diff --git a/daemon/upcall.c b/daemon/upcall.c | |
| 92 | 92 | index bd13c61..7778429 100644 | |
| 93 | 93 | --- a/daemon/upcall.c | |
| 94 | 94 | +++ b/daemon/upcall.c | |
| 95 | 95 | @@ -121,6 +121,7 @@ int upcall_parse( | |
| 96 | 96 | /* parse the operation's arguments */ | |
| 97 | 97 | op = g_upcall_op_table[upcall->opcode]; | |
| 98 | 98 | if (op && op->parse) { | |
| 99 | 99 | + EASSERT(length > 0); | |
| 100 | 100 | status = op->parse(buffer, length, upcall); | |
| 101 | 101 | if (status) { | |
| 102 | 102 | eprintf("parsing of upcall '%s' failed with %d.\n", | |
| 103 | 103 | diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c | |
| 104 | 104 | index 8b259bb..6d3429f 100644 | |
| 105 | 105 | --- a/dll/nfs41_np.c | |
| 106 | 106 | +++ b/dll/nfs41_np.c | |
| 107 | 107 | @@ -28,6 +28,8 @@ | |
| 108 | 108 | #include "nfs41_np.h" | |
| 109 | 109 | #include "options.h" | |
| 110 | 110 | ||
| 111 | 111 | +#define DBG 1 | |
| 112 | 112 | + | |
| 113 | 113 | #ifdef DBG | |
| 114 | 114 | #define DbgP(_x_) NFS41DbgPrint _x_ | |
| 115 | 115 | #else | |
| 116 | 116 | diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h | |
| 117 | 117 | index 93ee7a9..d43334a 100644 | |
| 118 | 118 | --- a/sys/nfs41_build_features.h | |
| 119 | 119 | +++ b/sys/nfs41_build_features.h | |
| 120 | 120 | @@ -32,19 +32,19 @@ | |
| 121 | 121 | /* | |
| 122 | 122 | * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values | |
| 123 | 123 | */ | |
| 124 | 124 | -// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 125 | 125 | +#define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1 | |
| 126 | 126 | ||
| 127 | 127 | /* | |
| 128 | 128 | * NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID - give NFS | |
| 129 | 129 | * files which do not map to a local account a SID in the | |
| 130 | 130 | * Unix_User+x/Unix_Group+x range | |
| 131 | 131 | */ | |
| 132 | 132 | -// #define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 133 | 133 | +#define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1 | |
| 134 | 134 | ||
| 135 | 135 | /* | |
| 136 | 136 | * NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN - use Cygwin /usr/bin/getent | |
| 137 | 137 | * as "name service" | |
| 138 | 138 | */ | |
| 139 | 139 | -// #define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 140 | 140 | +#define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1 | |
| 141 | 141 | ||
| 142 | 142 | #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */ | |
| 143 | 143 | diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c | |
| 144 | - | index 526b064..db62b56 100644 | |
| 144 | + | index 526b064..db4ed28 100644 | |
| 145 | 145 | --- a/sys/nfs41_driver.c | |
| 146 | 146 | +++ b/sys/nfs41_driver.c | |
| 147 | 147 | @@ -54,7 +54,7 @@ | |
| 148 | 148 | //#define DEBUG_LOCK | |
| 149 | 149 | //#define DEBUG_MISC | |
| 150 | 150 | #define DEBUG_TIME_BASED_COHERENCY | |
| 151 | 151 | -//#define DEBUG_MOUNT | |
| 152 | 152 | +#define DEBUG_MOUNT | |
| 153 | 153 | //#define DEBUG_VOLUME_QUERY | |
| 154 | 154 | ||
| 155 | 155 | //#define ENABLE_TIMINGS | |
| 156 | 156 | @@ -260,6 +260,40 @@ typedef struct _updowncall_list { | |
| 157 | 157 | } nfs41_updowncall_list; | |
| 158 | 158 | nfs41_updowncall_list upcall, downcall; | |
| 159 | 159 | ||
| 160 | 160 | + | |
| 161 | 161 | + | |
| 162 | 162 | +/* In order to cooperate with other network providers, | |
| 163 | 163 | + * we only claim paths of the format '\\server\nfs4\path' */ | |
| 164 | 164 | +DECLARE_CONST_UNICODE_STRING(NfsPrefix, L"\\nfs4"); | |
| 165 | 165 | +DECLARE_CONST_UNICODE_STRING(AUTH_SYS_NAME, L"sys"); | |
| 166 | 166 | +DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5_NAME, L"krb5"); | |
| 167 | 167 | +DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME, L"krb5i"); | |
| 168 | 168 | +DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME, L"krb5p"); | |
| 169 | 169 | +DECLARE_CONST_UNICODE_STRING(SLASH, L"\\"); | |
| 170 | 170 | +DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L""); | |
| 171 | 171 | + | |
| 172 | 172 | +#define SERVER_NAME_BUFFER_SIZE 1024 | |
| 173 | 173 | +#define MOUNT_CONFIG_RW_SIZE_MIN 1024 | |
| 174 | 174 | +#define MOUNT_CONFIG_RW_SIZE_DEFAULT 1048576 | |
| 175 | 175 | +#define MOUNT_CONFIG_RW_SIZE_MAX 1048576 | |
| 176 | 176 | +#define MAX_SEC_FLAVOR_LEN 12 | |
| 177 | 177 | +#define UPCALL_TIMEOUT_DEFAULT 50 /* in seconds */ | |
| 178 | 178 | + | |
| 179 | 179 | +typedef struct _NFS41_MOUNT_CONFIG { | |
| 180 | 180 | + DWORD ReadSize; | |
| 181 | 181 | + DWORD WriteSize; | |
| 182 | 182 | + BOOLEAN ReadOnly; | |
| 183 | 183 | + BOOLEAN write_thru; | |
| 184 | 184 | + BOOLEAN nocache; | |
| 185 | 185 | + WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE]; | |
| 186 | 186 | + UNICODE_STRING SrvName; /* hostname, or hostname@port */ | |
| 187 | 187 | + WCHAR mntpt_buffer[MAX_PATH]; | |
| 188 | 188 | + UNICODE_STRING MntPt; | |
| 189 | 189 | + WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN]; | |
| 190 | 190 | + UNICODE_STRING SecFlavor; | |
| 191 | 191 | + DWORD timeout; | |
| 192 | 192 | +} NFS41_MOUNT_CONFIG, *PNFS41_MOUNT_CONFIG; | |
| 193 | 193 | + | |
| 194 | 194 | typedef struct _nfs41_mount_entry { | |
| 195 | 195 | LIST_ENTRY next; | |
| 196 | 196 | LUID login_id; | |
| 197 | 197 | @@ -267,6 +301,7 @@ typedef struct _nfs41_mount_entry { | |
| 198 | 198 | HANDLE gss_session; | |
| 199 | 199 | HANDLE gssi_session; | |
| 200 | 200 | HANDLE gssp_session; | |
| 201 | 201 | + NFS41_MOUNT_CONFIG Config; | |
| 202 | 202 | } nfs41_mount_entry; | |
| 203 | 203 | ||
| 204 | 204 | typedef struct _nfs41_mount_list { | |
| 205 | 205 | @@ -310,37 +345,6 @@ typedef struct _nfs41_mount_list { | |
| 206 | 206 | next))); \ | |
| 207 | 207 | ExReleaseFastMutex(&lock); | |
| 208 | 208 | ||
| 209 | 209 | -/* In order to cooperate with other network providers, | |
| 210 | 210 | - * we only claim paths of the format '\\server\nfs4\path' */ | |
| 211 | 211 | -DECLARE_CONST_UNICODE_STRING(NfsPrefix, L"\\nfs4"); | |
| 212 | 212 | -DECLARE_CONST_UNICODE_STRING(AUTH_SYS_NAME, L"sys"); | |
| 213 | 213 | -DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5_NAME, L"krb5"); | |
| 214 | 214 | -DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME, L"krb5i"); | |
| 215 | 215 | -DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME, L"krb5p"); | |
| 216 | 216 | -DECLARE_CONST_UNICODE_STRING(SLASH, L"\\"); | |
| 217 | 217 | -DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L""); | |
| 218 | 218 | - | |
| 219 | 219 | -#define SERVER_NAME_BUFFER_SIZE 1024 | |
| 220 | 220 | -#define MOUNT_CONFIG_RW_SIZE_MIN 1024 | |
| 221 | 221 | -#define MOUNT_CONFIG_RW_SIZE_DEFAULT 1048576 | |
| 222 | 222 | -#define MOUNT_CONFIG_RW_SIZE_MAX 1048576 | |
| 223 | 223 | -#define MAX_SEC_FLAVOR_LEN 12 | |
| 224 | 224 | -#define UPCALL_TIMEOUT_DEFAULT 50 /* in seconds */ | |
| 225 | 225 | - | |
| 226 | 226 | -typedef struct _NFS41_MOUNT_CONFIG { | |
| 227 | 227 | - DWORD ReadSize; | |
| 228 | 228 | - DWORD WriteSize; | |
| 229 | 229 | - BOOLEAN ReadOnly; | |
| 230 | 230 | - BOOLEAN write_thru; | |
| 231 | 231 | - BOOLEAN nocache; | |
| 232 | 232 | - WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE]; | |
| 233 | 233 | - UNICODE_STRING SrvName; /* hostname, or hostname@port */ | |
| 234 | 234 | - WCHAR mntpt_buffer[MAX_PATH]; | |
| 235 | 235 | - UNICODE_STRING MntPt; | |
| 236 | 236 | - WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN]; | |
| 237 | 237 | - UNICODE_STRING SecFlavor; | |
| 238 | 238 | - DWORD timeout; | |
| 239 | 239 | -} NFS41_MOUNT_CONFIG, *PNFS41_MOUNT_CONFIG; | |
| 240 | 240 | ||
| 241 | 241 | typedef struct _NFS41_NETROOT_EXTENSION { | |
| 242 | 242 | NODE_TYPE_CODE NodeTypeCode; | |
| 243 | 243 | @@ -475,6 +479,14 @@ nfs41_start_driver_state nfs41_start_state = NFS41_START_DRIVER_STARTABLE; | |
| 244 | 244 | ||
| 245 | 245 | NTSTATUS map_readwrite_errors(DWORD status); | |
| 246 | 246 | ||
| 247 | 247 | + | |
| 248 | 248 | +void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src) | |
| 249 | 249 | +{ | |
| 250 | 250 | + RtlCopyMemory(dest, src, sizeof(NFS41_MOUNT_CONFIG)); | |
| 251 | 251 | + dest->SrvName.Buffer = dest->srv_buffer; | |
| 252 | 252 | + dest->MntPt.Buffer = dest->mntpt_buffer; | |
| 253 | 253 | +} | |
| 254 | 254 | + | |
| 255 | 255 | void print_debug_header( | |
| 256 | 256 | PRX_CONTEXT RxContext) | |
| 257 | 257 | { | |
| 258 | - | @@ -2739,6 +2751,10 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 258 | + | @@ -2739,6 +2751,9 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 259 | 259 | IN ULONG EaLength, | |
| 260 | 260 | IN OUT PNFS41_MOUNT_CONFIG Config) | |
| 261 | 261 | { | |
| 262 | 262 | + DbgP("----> nfs41_MountConfig_ParseOptions(EaBuffer=%p,EaLength=%ld)\n", | |
| 263 | 263 | + (void *)EaBuffer, | |
| 264 | 264 | + (long)EaLength); | |
| 266 | 265 | NTSTATUS status = STATUS_SUCCESS; | |
| 267 | 266 | PFILE_FULL_EA_INFORMATION Option; | |
| 268 | 267 | LPWSTR Name; | |
| 269 | - | @@ -2746,13 +2762,20 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 268 | + | @@ -2746,13 +2761,20 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 270 | 269 | UNICODE_STRING usValue; | |
| 271 | 270 | Option = EaBuffer; | |
| 272 | 271 | while (status == STATUS_SUCCESS) { | |
| 273 | 272 | + DbgP("Option=%p\n", (void *)Option); | |
| 274 | 273 | Name = (LPWSTR)Option->EaName; | |
| 275 | 274 | NameLen = Option->EaNameLength/sizeof(WCHAR); | |
| 276 | 275 | ||
| 277 | 276 | + DbgP("nfs41_MountConfig_ParseOptions: Name='%*S'/NameLen=%d\n", | |
| 278 | 277 | + (int)NameLen, Name, (int)NameLen); | |
| 279 | 278 | + | |
| 280 | 279 | usValue.Length = usValue.MaximumLength = Option->EaValueLength; | |
| 281 | 280 | usValue.Buffer = (PWCH)(Option->EaName + | |
| 282 | 281 | Option->EaNameLength + sizeof(WCHAR)); | |
| 283 | 282 | ||
| 284 | 283 | + DbgP("nfs41_MountConfig_ParseOptions: option/usValue='%wZ'/%ld\n", | |
| 285 | 284 | + &usValue, (long)usValue.Length); | |
| 286 | 285 | + | |
| 287 | 286 | if (wcsncmp(L"ro", Name, NameLen) == 0) { | |
| 288 | 287 | status = nfs41_MountConfig_ParseBoolean(Option, &usValue, | |
| 289 | 288 | FALSE, &Config->ReadOnly); | |
| 290 | - | @@ -2834,6 +2857,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 289 | + | @@ -2834,6 +2856,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions( | |
| 291 | 290 | ((PBYTE)Option + Option->NextEntryOffset); | |
| 292 | 291 | } | |
| 293 | 292 | ||
| 294 | 293 | + DbgP("<---- nfs41_MountConfig_ParseOptions, status=%ld\n", (long)status); | |
| 295 | 294 | return status; | |
| 296 | 295 | } | |
| 297 | 296 | ||
| 298 | - | @@ -2996,6 +3020,9 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 297 | + | @@ -2996,27 +3019,81 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 299 | 298 | ||
| 300 | 299 | if (pCreateNetRootContext->RxContext->Create.EaLength) { | |
| 301 | 300 | /* Codepath for nfs_mount.exe */ | |
| 302 | - | + DbgP("Codepath for nfs_mount.exe, %p/%ld\n", | |
| 301 | + | + DbgP("Codepath for nfs_mount.exe, Create->{ EaBuffer=%p, EaLength=%ld }\n", | |
| 303 | 302 | + pCreateNetRootContext->RxContext->Create.EaBuffer, | |
| 304 | 303 | + (long)pCreateNetRootContext->RxContext->Create.EaLength); | |
| 305 | 304 | ||
| 306 | 305 | /* parse the extended attributes for mount options */ | |
| 307 | 306 | status = nfs41_MountConfig_ParseOptions( | |
| 308 | - | @@ -3009,6 +3036,7 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 307 | + | pCreateNetRootContext->RxContext->Create.EaBuffer, | |
| 308 | + | pCreateNetRootContext->RxContext->Create.EaLength, | |
| 309 | 317 | pVNetRootContext->nocache = Config->nocache; | |
| 310 | 318 | } else { | |
| 311 | - | /* Codepath for \\server:port\nfs4\path */ | |
| 319 | + | - /* Codepath for \\server:port\nfs4\path */ | |
| 312 | - | + DbgP("Codepath for \\\\server:port\\nfs4\\path\n"); | |
| 320 | + | + /* Codepath for \\server@port\nfs4\path */ | |
| 321 | + | + DbgP("Codepath for \\\\server@port\\nfs4\\path\n"); | |
| 313 | 322 | ||
| 323 | + | +#if 0 | |
| 314 | 324 | /* use the SRV_CALL name (without leading \) as the hostname */ | |
| 315 | 325 | Config->SrvName.Buffer = pSrvCall->pSrvCallName->Buffer + 1; | |
| 316 | - | @@ -3016,16 +3044,73 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 326 | + | Config->SrvName.Length = | |
| 317 | 327 | pSrvCall->pSrvCallName->Length - sizeof(WCHAR); | |
| 318 | 328 | Config->SrvName.MaximumLength = | |
| 319 | 329 | pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR); | |
| 320 | - | +#define MNTXXX 1 | |
| 330 | + | +#endif | |
| 331 | + | + | |
| 322 | 332 | + status = nfs41_GetLUID(&luid); | |
| 323 | 333 | + if (status) | |
| 324 | 334 | + goto out_free; | |
| 325 | 335 | + | |
| 326 | 336 | + PLIST_ENTRY pEntry; | |
| 327 | 337 | + | |
| 338 | + | + status = STATUS_OBJECT_NAME_NOT_FOUND; | |
| 328 | 340 | + ExAcquireFastMutex(&pNetRootContext->mountLock); | |
| 329 | 341 | + pEntry = &pNetRootContext->mounts.head; | |
| 330 | 342 | + pEntry = pEntry->Flink; | |
| 331 | 343 | + while (pEntry != NULL) { | |
| 332 | 344 | + existing_mount = (nfs41_mount_entry *)CONTAINING_RECORD(pEntry, | |
| 333 | 345 | + nfs41_mount_entry, next); | |
| 334 | 346 | + | |
| 335 | 347 | + if (RtlEqualLuid(&luid, &existing_mount->login_id)) { | |
| 336 | - | + DbgP("MNTXXX: Found a matching LUID entry\n"); | |
| 337 | - | + | |
| 338 | 348 | + /* found existing mount */ | |
| 339 | 349 | + copy_nfs41_mount_config(Config, &existing_mount->Config); | |
| 340 | - | +#if 0 | |
| 350 | + | + DbgP("Found existing mount: Entry Config->MntPt='%wZ'\n", | |
| 341 | - | + RtlCopyMemory(Config->mntpt_buffer, existing_mount->mntpt_buffer, sizeof(Config->mntpt_buffer)); | |
| 351 | + | + &Config->MntPt); | |
| 349 | 352 | + status = STATUS_SUCCESS; | |
| 350 | 353 | + break; | |
| 351 | - | + } | |
| 354 | + | } | |
| 352 | 355 | + if (pEntry->Flink == &pNetRootContext->mounts.head) | |
| 353 | 356 | + break; | |
| 354 | 357 | + pEntry = pEntry->Flink; | |
| 355 | 358 | + } | |
| 356 | 359 | + ExReleaseFastMutex(&pNetRootContext->mountLock); | |
| 357 | 360 | + | |
| 358 | - | + DbgP("MNTXXX: mark #1\n"); | |
| 361 | + | + if (status != STATUS_SUCCESS) { | |
| 362 | + | + DbgP("No existing mount found\n"); | |
| 361 | 363 | + goto out_free; | |
| 364 | + | + } | |
| 362 | 366 | + pVNetRootContext->read_only = Config->ReadOnly; | |
| 363 | 367 | + pVNetRootContext->write_thru = Config->write_thru; | |
| 364 | 368 | + pVNetRootContext->nocache = Config->nocache; | |
| 369 | + | + } | |
| 365 | 370 | + | |
| 366 | - | + DbgP("MNTXXX: mark #2\n"); | |
| 371 | + | + DbgP("Config->{ MntPt='%wZ', SrvName='%wZ', ReadOnly=%d, write_thru=%d, nocache=%d }\n", | |
| 367 | - | + DbgP("Codepath for \\\\server:port\\nfs4\\path: Config->MntPt='%wZ'\n", | |
| 372 | + | + &Config->MntPt, | |
| 368 | - | + &Config->MntPt); | |
| 373 | + | + &Config->SrvName, | |
| 374 | + | + Config->ReadOnly?1:0, | |
| 369 | 377 | + | |
| 375 | 378 | pVNetRootContext->MountPathLen = Config->MntPt.Length; | |
| 376 | 379 | pVNetRootContext->timeout = Config->timeout; | |
| 377 | 380 | ||
| 378 | - | status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor); | |
| 381 | + | @@ -3127,6 +3204,7 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 379 | - | if (status != STATUS_SUCCESS) { | |
| 382 | + | entry->gssp_session = pVNetRootContext->session; break; | |
| 383 | 383 | } | |
| 384 | + | RtlCopyLuid(&entry->login_id, &luid); | |
| 384 | 392 | ||
| 385 | - | +DbgP("MNTXXX: mark #4\n"); | |
| 393 | + | ||
| 386 | - | + | |
| 394 | + | ||
| 387 | - | status = nfs41_GetLUID(&luid); | |
| 395 | + | ||
| 388 | - | if (status) | |
| 396 | + | ||
| 389 | - | goto out_free; | |
| 397 | + | ||
| 390 | - | @@ -3090,10 +3175,12 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 398 | + | ||
| 391 | - | #endif | |
| 399 | + | ||
| 392 | - | } | |
| 400 | + | ||
| 393 | 401 | ||
| 394 | - | +DbgP("MNTXXX: mark #5\n"); | |
| 402 | + | ||
| 395 | - | /* send the mount upcall */ | |
| 403 | + | ||
| 396 | - | status = nfs41_mount(Config, pVNetRootContext->sec_flavor, | |
| 404 | + | ||
| 397 | - | &pVNetRootContext->session, &nfs41d_version, | |
| 405 | + | ||
| 398 | - | &pVNetRootContext->FsAttrs); | |
| 406 | + | ||
| 399 | - | +DbgP("status(=%ld) = nfs41_mount()\n", (long)status); | |
| 407 | + | ||
| 400 | - | if (status != STATUS_SUCCESS) { | |
| 408 | + | ||
| 401 | - | BOOLEAN MountsEmpty; | |
| 409 | + | ||
| 402 | - | nfs41_IsListEmpty(pNetRootContext->mountLock, | |
| 410 | + | ||
| 403 | - | @@ -3127,6 +3214,12 @@ NTSTATUS nfs41_CreateVNetRoot( | |
| 411 | + | ||
| 404 | - | entry->gssp_session = pVNetRootContext->session; break; | |
| 412 | + | ||
| 405 | - | } | |
| 413 | + | ||
| 406 | - | RtlCopyLuid(&entry->login_id, &luid); | |
| 414 | + | ||
| 407 | - | + copy_nfs41_mount_config(&entry->Config, Config); | |
| 415 | + | ||
| 408 | - | +#if 0 | |
| 416 | + | ||
| 409 | - | + RtlCopyMemory(entry->mntpt_buffer, Config->mntpt_buffer, sizeof(entry->mntpt_buffer)); | |
| 417 | + | ||
| 410 | - | + entry->mntpt_buffer[Config->MntPt.Length] = L'\0'; | |
| 418 | + | ||
| 411 | - | +#endif | |
| 419 | + | ||
| 412 | - | + DbgP("NEW MOUNT '%wZ'\n", &entry->Config.MntPt); | |
| 420 | + | ||
| 413 | - | nfs41_AddEntry(pNetRootContext->mountLock, | |
| 421 | + | ||
| 414 | - | pNetRootContext->mounts, entry); | |
| 422 | + | ||
| 415 | - | } else if (!found_matching_flavor) { | |
| 423 | + | ||
| 416 | - | diff --git a/tests/winlocktest1/winlocktest1.ksh b/tests/winlocktest1/winlocktest1.ksh | |
| 424 | + | ||
| 417 | - | old mode 100644 | |
| 425 | + | ||
| 418 | - | new mode 100755 | |
| 426 | + | ||
| 419 | 427 |
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.
nrubsig.kpaste.net RSS