pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS

Difference between
modified post 4ceb32ca by Anonymous on Thu 30th Nov 2023 02:57
original post a62062 by Anonymous on Wed 29th Nov 2023 15:52
Download diff
Show old version | new version | both versions

    
11
diff --git a/daemon/getattr.c b/daemon/getattr.c
22
index 7c5f241..7621dba 100644
33
--- a/daemon/getattr.c
44
+++ b/daemon/getattr.c
55
@@ -59,8 +59,19 @@ int nfs41_cached_getattr(
66
 static int parse_getattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
77
 {
88
     int status;
99
+#if 1
1010
+    EASSERT(length > 4);
1111
+    if (length <= 4) {
1212
+        status = ERROR_INVALID_PARAMETER;
1313
+        goto out;
1414
+    }
1515
+    EASSERT(upcall->state_ref != NULL);
1616
+    if (upcall->state_ref == NULL) {
1717
+        status = ERROR_INVALID_PARAMETER;
1818
+        goto out;
1919
+    }
2020
+#endif
2121
     getattr_upcall_args *args = &upcall->args.getattr;
2222
-
2323
     status = safe_read(&buffer, &length, &args->query_class, sizeof(args->query_class));
2424
     if (status) goto out;
2525
     status = safe_read(&buffer, &length, &args->buf_len, sizeof(args->buf_len));
2626
@@ -80,6 +91,21 @@ static int handle_getattr(void *daemon_context, nfs41_upcall *upcall)
2727
     nfs41_open_state *state = upcall->state_ref;
2828
     nfs41_file_info info = { 0 };
2929
3030
+#if 1
3131
+    if (((char *)state->session) == ((char *)0xdddddddddddddddd)) {
3232
+        eprintf("handle_getattr: Invalid session pointer 0xdddddddddddddddd\n");
3333
+        status = ERROR_INVALID_PARAMETER;
3434
+        goto out;
3535
+    }
3636
+
3737
+    EASSERT(state->file.fh.superblock != NULL);
3838
+    if (state->file.fh.superblock == NULL) {
3939
+        /* gisburn: fixme: maybe this should be |ERROR_INTERNAL_ERROR| ? */
4040
+        status = ERROR_INVALID_PARAMETER;
4141
+        goto out;
4242
+    }
4343
+#endif
4444
+
4545
     status = nfs41_cached_getattr(state->session, &state->file, &info);
4646
     if (status) {
4747
         eprintf("nfs41_cached_getattr() failed with %d\n", status);
4848
diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c
4949
index bcca070..f2a4f22 100644
5050
--- a/daemon/nfs41_ops.c
5151
+++ b/daemon/nfs41_ops.c
5252
@@ -400,6 +400,9 @@ int nfs41_open(
5353
     bool_t already_delegated = delegation->type == OPEN_DELEGATE_READ
5454
         || delegation->type == OPEN_DELEGATE_WRITE;
5555
5656
+    EASSERT(parent);
5757
+    EASSERT(parent->fh.superblock);
5858
+
5959
     /* depending on the claim type, OPEN expects CURRENT_FH set
6060
      * to either the parent directory, or to the file itself */
6161
     switch (claim->claim) {
6262
diff --git a/daemon/open.c b/daemon/open.c
6363
index 4b2a335..487c341 100644
6464
--- a/daemon/open.c
6565
+++ b/daemon/open.c
6666
@@ -99,6 +99,24 @@ static void open_state_free(
6767
 void nfs41_open_state_ref(
6868
     IN nfs41_open_state *state)
6969
 {
7070
+#if 1
7171
+    /*
7272
+     * gisburn: fixme: sometimes this happens under high parallel
7373
+     * usage with multiple mounts - but why ?
7474
+     * 0:038> kp
7575
+     * Child-SP          RetAddr           Call Site
7676
+     * 0000006d`431fde10 00007ff7`32f7d905 nfsd!nfs41_open_state_ref(struct __nfs41_open_state * state = 0x00000000`00000000)+0x31
7777
+     * 0000006d`431fdf30 00007ff7`32f4d284 nfsd!upcall_parse(unsigned char * buffer = 0x0000006d`431fe180 "???", unsigned int length = 8, struct __nfs41_upcall * upcall = 0x0000006d`431ff1e0)+0x2e5
7878
+     * 0000006d`431fe0b0 00007ffc`1ca24c7c nfsd!thread_main(void * args = 0x00007ff7`32fb6080)+0x144
7979
+     * 0000006d`431ffe00 00007ffc`4d4b7344 ucrtbased!thread_start<unsigned int (void * parameter = 0x0000025d`a9c6def0)+0x9c
8080
+     * 0000006d`431ffe60 00007ffc`4efc26b1 KERNEL32!BaseThreadInitThunk+0x14
8181
+     * 0000006d`431ffe90 00000000`00000000 ntdll!RtlUserThreadStart+0x21
8282
+     */
8383
+    EASSERT(state != NULL);
8484
+    if (state == NULL)
8585
+        return;
8686
+#endif
8787
+
8888
     const LONG count = InterlockedIncrement(&state->ref_count);
8989
9090
     dprintf(2, "nfs41_open_state_ref(%s) count %d\n", state->path.path, count);
9191
diff --git a/daemon/upcall.c b/daemon/upcall.c
9292
index bd13c61..7778429 100644
9393
--- a/daemon/upcall.c
9494
+++ b/daemon/upcall.c
9595
@@ -121,6 +121,7 @@ int upcall_parse(
9696
     /* parse the operation's arguments */
9797
     op = g_upcall_op_table[upcall->opcode];
9898
     if (op && op->parse) {
9999
+        EASSERT(length > 0);
100100
         status = op->parse(buffer, length, upcall);
101101
         if (status) {
102102
             eprintf("parsing of upcall '%s' failed with %d.\n",
103103
diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c
104104
index 8b259bb..6d3429f 100644
105105
--- a/dll/nfs41_np.c
106106
+++ b/dll/nfs41_np.c
107107
@@ -28,6 +28,8 @@
108108
 #include "nfs41_np.h"
109109
 #include "options.h"
110110
111111
+#define DBG 1
112112
+
113113
 #ifdef DBG
114114
 #define DbgP(_x_) NFS41DbgPrint _x_
115115
 #else
116116
diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h
117117
index 93ee7a9..d43334a 100644
118118
--- a/sys/nfs41_build_features.h
119119
+++ b/sys/nfs41_build_features.h
120120
@@ -32,19 +32,19 @@
121121
 /*
122122
  * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values
123123
  */
124124
-// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1
125125
+#define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1
126126
127127
 /*
128128
  * NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID - give NFS
129129
  * files which do not map to a local account a SID in the
130130
  * Unix_User+x/Unix_Group+x range
131131
  */
132132
-// #define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1
133133
+#define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1
134134
135135
 /*
136136
  * NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN - use Cygwin /usr/bin/getent
137137
  * as "name service"
138138
  */
139139
-// #define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1
140140
+#define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1
141141
142142
 #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
143143
diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
144-
index 526b064..e005972 100644
144+
index 526b064..db62b56 100644
145145
--- a/sys/nfs41_driver.c
146146
+++ b/sys/nfs41_driver.c
147147
@@ -54,7 +54,7 @@
148148
 //#define DEBUG_LOCK
149149
 //#define DEBUG_MISC
150150
 #define DEBUG_TIME_BASED_COHERENCY
151151
-//#define DEBUG_MOUNT
152152
+#define DEBUG_MOUNT
153153
 //#define DEBUG_VOLUME_QUERY
154154
155155
 //#define ENABLE_TIMINGS
156-
@@ -267,6 +267,8 @@ typedef struct _nfs41_mount_entry {
156+
@@ -260,6 +260,40 @@ typedef struct _updowncall_list {
157-
     HANDLE gss_session;
157+
 } nfs41_updowncall_list;
158-
     HANDLE gssi_session;
158+
 nfs41_updowncall_list upcall, downcall;
163159
164-
 typedef struct _nfs41_mount_list {
160+
+
165-
@@ -2739,6 +2741,10 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
161+
+
166-
     IN ULONG EaLength,
162+
+/* In order to cooperate with other network providers,
167-
     IN OUT PNFS41_MOUNT_CONFIG Config)
163+
+ * we only claim paths of the format '\\server\nfs4\path' */
168-
 {
164+
+DECLARE_CONST_UNICODE_STRING(NfsPrefix, L"\\nfs4");
169-
+    DbgP("----> nfs41_MountConfig_ParseOptions(EaBuffer=%p,EaLength=%ld)\n",
165+
+DECLARE_CONST_UNICODE_STRING(AUTH_SYS_NAME, L"sys");
170-
+        (void *)EaBuffer,
166+
+DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5_NAME, L"krb5");
171-
+        (long)EaLength);
167+
+DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME, L"krb5i");
172-
+    DbgP("max_address=%p\n", (void *)(((char *)EaBuffer)+EaLength));
168+
+DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME, L"krb5p");
173-
     NTSTATUS  status = STATUS_SUCCESS;
169+
+DECLARE_CONST_UNICODE_STRING(SLASH, L"\\");
174-
     PFILE_FULL_EA_INFORMATION Option;
170+
+DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L"");
175-
     LPWSTR Name;
171+
+
176-
@@ -2746,13 +2752,20 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
172+
+#define SERVER_NAME_BUFFER_SIZE         1024
177-
     UNICODE_STRING  usValue;
173+
+#define MOUNT_CONFIG_RW_SIZE_MIN        1024
178-
     Option = EaBuffer;
174+
+#define MOUNT_CONFIG_RW_SIZE_DEFAULT    1048576
179-
     while (status == STATUS_SUCCESS) {
175+
+#define MOUNT_CONFIG_RW_SIZE_MAX        1048576
180-
+        DbgP("Option=%p\n", (void *)Option);
176+
+#define MAX_SEC_FLAVOR_LEN              12
181-
         Name = (LPWSTR)Option->EaName;
177+
+#define UPCALL_TIMEOUT_DEFAULT          50  /* in seconds */
186178
+
187-
         usValue.Length = usValue.MaximumLength = Option->EaValueLength;
179+
+typedef struct _NFS41_MOUNT_CONFIG {
188-
         usValue.Buffer = (PWCH)(Option->EaName +
180+
+    DWORD ReadSize;
189-
             Option->EaNameLength + sizeof(WCHAR));
181+
+    DWORD WriteSize;
190-
182+
+    BOOLEAN ReadOnly;
191-
+        DbgP("nfs41_MountConfig_ParseOptions: option/usValue='%wZ'/%ld\n",
183+
+    BOOLEAN write_thru;
192-
+            &usValue, (long)usValue.Length);
184+
+    BOOLEAN nocache;
185+
+    WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE];
193193
+
194-
         if (wcsncmp(L"ro", Name, NameLen) == 0) {
194+
 typedef struct _nfs41_mount_entry {
195-
             status = nfs41_MountConfig_ParseBoolean(Option, &usValue,
195+
     LIST_ENTRY next;
196-
                 FALSE, &Config->ReadOnly);
196+
     LUID login_id;
197-
@@ -2834,6 +2847,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
197+
@@ -267,6 +301,7 @@ typedef struct _nfs41_mount_entry {
198-
             ((PBYTE)Option + Option->NextEntryOffset);
198+
     HANDLE gss_session;
199-
     }
199+
     HANDLE gssi_session;
200+
     HANDLE gssp_session;
200203
201-
+    DbgP("<---- nfs41_MountConfig_ParseOptions, status=%ld\n", (long)status);
204+
 typedef struct _nfs41_mount_list {
202-
     return status;
205+
@@ -310,37 +345,6 @@ typedef struct _nfs41_mount_list {
203-
 }
206+
                                   next)));                  \
207+
             ExReleaseFastMutex(&lock);
204208
205-
@@ -2996,6 +3010,9 @@ NTSTATUS nfs41_CreateVNetRoot(
209+
-/* In order to cooperate with other network providers,
206-
210+
- * we only claim paths of the format '\\server\nfs4\path' */
207-
     if (pCreateNetRootContext->RxContext->Create.EaLength) {
211+
-DECLARE_CONST_UNICODE_STRING(NfsPrefix, L"\\nfs4");
208-
         /* Codepath for nfs_mount.exe */
212+
-DECLARE_CONST_UNICODE_STRING(AUTH_SYS_NAME, L"sys");
209-
+        DbgP("Codepath for nfs_mount.exe, %p/%ld\n",
213+
-DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5_NAME, L"krb5");
210-
+            pCreateNetRootContext->RxContext->Create.EaBuffer,
214+
-DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5I_NAME, L"krb5i");
211-
+            (long)pCreateNetRootContext->RxContext->Create.EaLength);
215+
-DECLARE_CONST_UNICODE_STRING(AUTHGSS_KRB5P_NAME, L"krb5p");
212-
216+
-DECLARE_CONST_UNICODE_STRING(SLASH, L"\\");
213-
         /* parse the extended attributes for mount options */
217+
-DECLARE_CONST_UNICODE_STRING(EMPTY_STRING, L"");
214-
         status = nfs41_MountConfig_ParseOptions(
218+
-
215-
@@ -3009,6 +3026,7 @@ NTSTATUS nfs41_CreateVNetRoot(
219+
-#define SERVER_NAME_BUFFER_SIZE         1024
216-
         pVNetRootContext->nocache = Config->nocache;
220+
-#define MOUNT_CONFIG_RW_SIZE_MIN        1024
217-
     } else {
221+
-#define MOUNT_CONFIG_RW_SIZE_DEFAULT    1048576
218-
         /* Codepath for \\server:port\nfs4\path */
222+
-#define MOUNT_CONFIG_RW_SIZE_MAX        1048576
219-
+        DbgP("Codepath for \\\\server:port\\nfs4\\path\n");
223+
-#define MAX_SEC_FLAVOR_LEN              12
220-
224+
-#define UPCALL_TIMEOUT_DEFAULT          50  /* in seconds */
221-
         /* use the SRV_CALL name (without leading \) as the hostname */
225+
-
222-
         Config->SrvName.Buffer = pSrvCall->pSrvCallName->Buffer + 1;
226+
-typedef struct _NFS41_MOUNT_CONFIG {
223-
@@ -3016,16 +3034,70 @@ NTSTATUS nfs41_CreateVNetRoot(
227+
-    DWORD ReadSize;
224-
             pSrvCall->pSrvCallName->Length - sizeof(WCHAR);
228+
-    DWORD WriteSize;
225-
         Config->SrvName.MaximumLength =
229+
-    BOOLEAN ReadOnly;
226-
             pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR);
230+
-    BOOLEAN write_thru;
227-
+#define MNTXXX 1
231+
-    BOOLEAN nocache;
228-
+#ifdef MNTXXX
232+
-    WCHAR srv_buffer[SERVER_NAME_BUFFER_SIZE];
229-
+        status = nfs41_GetLUID(&luid);
233+
-    UNICODE_STRING SrvName; /* hostname, or hostname@port */
230-
+        if (status)
234+
-    WCHAR mntpt_buffer[MAX_PATH];
231-
+            goto out_free;
235+
-    UNICODE_STRING MntPt;
232-
+
236+
-    WCHAR sec_flavor[MAX_SEC_FLAVOR_LEN];
233-
+        PLIST_ENTRY pEntry;
237+
-    UNICODE_STRING SecFlavor;
238+
-    DWORD timeout;
234247
+
235-
+        ExAcquireFastMutex(&pNetRootContext->mountLock);
248+
+void copy_nfs41_mount_config(NFS41_MOUNT_CONFIG *dest, NFS41_MOUNT_CONFIG *src)
236-
+        pEntry = &pNetRootContext->mounts.head;
249+
+{
237-
+        pEntry = pEntry->Flink;
250+
+    RtlCopyMemory(dest, src, sizeof(NFS41_MOUNT_CONFIG));
238-
+        while (pEntry != NULL) {
251+
+    dest->SrvName.Buffer = dest->srv_buffer;
239-
+            existing_mount = (nfs41_mount_entry *)CONTAINING_RECORD(pEntry,
252+
+    dest->MntPt.Buffer = dest->mntpt_buffer;
240-
+                    nfs41_mount_entry, next);
253+
+}
241254
+
242-
+            if (RtlEqualLuid(&luid, &existing_mount->login_id)) {
255+
 void print_debug_header(
243-
+                DbgP("MNTXXX: Found a matching LUID entry\n");
256+
     PRX_CONTEXT RxContext)
244-
+
257+
 {
245-
+                /* found existing mount */
258+
@@ -2739,6 +2751,10 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
246-
+                RtlCopyMemory(Config->mntpt_buffer, existing_mount->mntpt_buffer, sizeof(Config->mntpt_buffer));
259+
     IN ULONG EaLength,
247-
+                Config->MntPt.Buffer = Config->mntpt_buffer;
260+
     IN OUT PNFS41_MOUNT_CONFIG Config)
248-
+                Config->MntPt.MaximumLength = MAX_PATH;
261+
 {
249-
+                Config->MntPt.Length = wcslen(Config->mntpt_buffer)*2;
262+
+    DbgP("----> nfs41_MountConfig_ParseOptions(EaBuffer=%p,EaLength=%ld)\n",
250-
+                DbgP("MNTXXX: Found entry Config->MntPt.Buffer='%S', bytelen=%ld\n",
263+
+        (void *)EaBuffer,
251-
+                    Config->MntPt.Buffer,
264+
+        (long)EaLength);
252-
+                    (long)Config->MntPt.Length);
265+
+    DbgP("max_address=%p\n", (void *)(((char *)EaBuffer)+EaLength));
253-
+                status = STATUS_SUCCESS;
266+
     NTSTATUS  status = STATUS_SUCCESS;
254-
+                break;
267+
     PFILE_FULL_EA_INFORMATION Option;
255-
+            }
268+
     LPWSTR Name;
256-
+            if (pEntry->Flink == &pNetRootContext->mounts.head)
269+
@@ -2746,13 +2762,20 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
257-
+                break;
270+
     UNICODE_STRING  usValue;
258-
+            pEntry = pEntry->Flink;
271+
     Option = EaBuffer;
259-
+        }
272+
     while (status == STATUS_SUCCESS) {
260-
+        ExReleaseFastMutex(&pNetRootContext->mountLock);
273+
+        DbgP("Option=%p\n", (void *)Option);
274+
         Name = (LPWSTR)Option->EaName;
261279
+
262-
+        DbgP("MNTXXX: mark #1\n");
280+
         usValue.Length = usValue.MaximumLength = Option->EaValueLength;
281+
         usValue.Buffer = (PWCH)(Option->EaName +
263286
+
264-
+        if (status != STATUS_SUCCESS)
287+
         if (wcsncmp(L"ro", Name, NameLen) == 0) {
265-
+            goto out_free;
288+
             status = nfs41_MountConfig_ParseBoolean(Option, &usValue,
266-
+        pVNetRootContext->read_only = Config->ReadOnly;
289+
                 FALSE, &Config->ReadOnly);
267-
+        pVNetRootContext->write_thru = Config->write_thru;
290+
@@ -2834,6 +2857,7 @@ NTSTATUS nfs41_MountConfig_ParseOptions(
268-
+        pVNetRootContext->nocache = Config->nocache;
291+
             ((PBYTE)Option + Option->NextEntryOffset);
278292
     }
279-
     pVNetRootContext->MountPathLen = Config->MntPt.Length;
280-
     pVNetRootContext->timeout = Config->timeout;
281293
282-
     status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
294+
+    DbgP("<---- nfs41_MountConfig_ParseOptions, status=%ld\n", (long)status);
283-
     if (status != STATUS_SUCCESS) {
295+
     return status;
287296
     }
288297
289-
+DbgP("MNTXXX: mark #4\n");
298+
@@ -2996,6 +3020,9 @@ NTSTATUS nfs41_CreateVNetRoot(
297299
298-
+DbgP("MNTXXX: mark #5\n");
300+
     if (pCreateNetRootContext->RxContext->Create.EaLength) {
299-
     /* send the mount upcall */
301+
         /* Codepath for nfs_mount.exe */
300-
     status = nfs41_mount(Config, pVNetRootContext->sec_flavor,
302+
+        DbgP("Codepath for nfs_mount.exe, %p/%ld\n",
301-
         &pVNetRootContext->session, &nfs41d_version,
303+
+            pCreateNetRootContext->RxContext->Create.EaBuffer,
302-
         &pVNetRootContext->FsAttrs);
304+
+            (long)pCreateNetRootContext->RxContext->Create.EaLength);
303-
+DbgP("status(=%ld) = nfs41_mount()\n", (long)status);
305+
304-
     if (status != STATUS_SUCCESS) {
306+
         /* parse the extended attributes for mount options */
305-
         BOOLEAN MountsEmpty;
307+
         status = nfs41_MountConfig_ParseOptions(
306-
         nfs41_IsListEmpty(pNetRootContext->mountLock,
308+
@@ -3009,6 +3036,7 @@ NTSTATUS nfs41_CreateVNetRoot(
307-
@@ -3127,6 +3201,9 @@ NTSTATUS nfs41_CreateVNetRoot(
309+
         pVNetRootContext->nocache = Config->nocache;
308-
             entry->gssp_session = pVNetRootContext->session; break;
310+
     } else {
309-
         }
311+
         /* Codepath for \\server:port\nfs4\path */
310-
         RtlCopyLuid(&entry->login_id, &luid);
312+
+        DbgP("Codepath for \\\\server:port\\nfs4\\path\n");
320313
321-
314+
         /* use the SRV_CALL name (without leading \) as the hostname */
322-
315+
         Config->SrvName.Buffer = pSrvCall->pSrvCallName->Buffer + 1;
323-
316+
@@ -3016,16 +3044,73 @@ NTSTATUS nfs41_CreateVNetRoot(
324-
317+
             pSrvCall->pSrvCallName->Length - sizeof(WCHAR);
325-
318+
         Config->SrvName.MaximumLength =
326-
319+
             pSrvCall->pSrvCallName->MaximumLength - sizeof(WCHAR);
327-
320+
+#define MNTXXX 1
328-
321+
+#ifdef MNTXXX
329-
322+
+        status = nfs41_GetLUID(&luid);
330-
323+
+        if (status)
331-
324+
+            goto out_free;
332-
325+
+
333-
326+
+        PLIST_ENTRY pEntry;
334-
327+
+
335-
328+
+        ExAcquireFastMutex(&pNetRootContext->mountLock);
336-
329+
+        pEntry = &pNetRootContext->mounts.head;
337-
330+
+        pEntry = pEntry->Flink;
338-
331+
+        while (pEntry != NULL) {
339-
332+
+            existing_mount = (nfs41_mount_entry *)CONTAINING_RECORD(pEntry,
340-
333+
+                    nfs41_mount_entry, next);
341-
334+
+
342-
335+
+            if (RtlEqualLuid(&luid, &existing_mount->login_id)) {
343-
336+
+                DbgP("MNTXXX: Found a matching LUID entry\n");
344-
337+
+
345-
338+
+                /* found existing mount */
346-
339+
+                copy_nfs41_mount_config(Config, &existing_mount->Config);
347-
340+
+#if 0
348-
341+
+                RtlCopyMemory(Config->mntpt_buffer, existing_mount->mntpt_buffer, sizeof(Config->mntpt_buffer));
349-
342+
+                Config->MntPt.Buffer = Config->mntpt_buffer;
350-
343+
+                Config->MntPt.MaximumLength = MAX_PATH;
351-
344+
+                Config->MntPt.Length = wcslen(Config->mntpt_buffer)*2;
352-
345+
+#endif
353-
346+
+                DbgP("MNTXXX: Found entry Config->MntPt='%wZ', bytelen=%ld\n",
354-
347+
+                    &Config->MntPt,
355-
348+
+                    (long)Config->MntPt.Length);
356-
349+
+                status = STATUS_SUCCESS;
357-
350+
+                break;
358-
351+
+            }
359-
352+
+            if (pEntry->Flink == &pNetRootContext->mounts.head)
360-
353+
+                break;
361-
354+
+            pEntry = pEntry->Flink;
362-
355+
+        }
363-
356+
+        ExReleaseFastMutex(&pNetRootContext->mountLock);
364-
357+
+
365-
358+
+        DbgP("MNTXXX: mark #1\n");
366-
359+
+
367-
360+
+        if (status != STATUS_SUCCESS)
368-
361+
+            goto out_free;
369-
362+
+        pVNetRootContext->read_only = Config->ReadOnly;
370-
363+
+        pVNetRootContext->write_thru = Config->write_thru;
371-
364+
+        pVNetRootContext->nocache = Config->nocache;
372-
365+
+
373-
366+
+        DbgP("MNTXXX: mark #2\n");
374-
367+
+        DbgP("Codepath for \\\\server:port\\nfs4\\path: Config->MntPt='%wZ'\n",
375-
368+
+            &Config->MntPt);
376-
369+
+
377-
370+
+        DbgP("Codepath for \\\\server:port\\nfs4\\path: Config->SrvName='%wZ'\n",
378-
371+
+            &Config->SrvName);
379-
372+
+        DbgP("MNTXXX: mark #3\n");
380-
373+
+#endif /* MNTXXX */
381-
374+
     }
382-
375+
     pVNetRootContext->MountPathLen = Config->MntPt.Length;
383-
376+
     pVNetRootContext->timeout = Config->timeout;
384377
385-
378+
     status = map_sec_flavor(&Config->SecFlavor, &pVNetRootContext->sec_flavor);
386-
379+
     if (status != STATUS_SUCCESS) {
387-
380+
+        DbgP("map_sec_flavor() failed\n");
388-
381+
         DbgP("Invalid rpcsec security flavor %wZ\n", &Config->SecFlavor);
389-
382+
         goto out_free;
390-
383+
     }
391384
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+
     }
400393
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
426419

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