pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


experiment (does NOT work) to fix $ svn checkout ... # and VC19 incremental linker
Posted by Anonymous on Mon 30th Sep 2024 12:00
raw | new post

  1. # experiment (does NOT work) to fix $ svn checkout ... # and VC19 incremental linker
  2. diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
  3. index 8143840..53b3754 100644
  4. --- a/sys/nfs41_driver.c
  5. +++ b/sys/nfs41_driver.c
  6. @@ -467,6 +467,7 @@ typedef struct _NFS41_FOBX {
  7.      BOOLEAN write_thru;
  8.      BOOLEAN nocache;
  9.      BOOLEAN timebasedcoherency;
  10. +    LONGLONG writes_in_progress;
  11.  } NFS41_FOBX, *PNFS41_FOBX;
  12.  #define NFS41GetFobxExtension(pFobx)  \
  13.          (((pFobx) == NULL) ? NULL : (PNFS41_FOBX)((pFobx)->Context))
  14. @@ -4486,6 +4487,7 @@ retry_on_link:
  15.      print_std_info(1, &nfs41_fcb->StandardInfo);
  16.  #endif
  17.  
  18. +#if 0
  19.      /* aglo: 05/10/2012. it seems like always have to invalid the cache if the
  20.       * file has been opened before and being opened again for data access.
  21.       * If the file was opened before, RDBSS might have cached (unflushed) data
  22. @@ -4502,6 +4504,7 @@ retry_on_link:
  23.  #endif
  24.          RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  25.      }
  26. +#endif
  27.      if (!nfs41_fcb->StandardInfo.Directory &&
  28.              isDataAccess(params->DesiredAccess)) {
  29.          nfs41_fobx->deleg_type = entry->u.Open.deleg_type;
  30. @@ -4751,6 +4754,17 @@ static NTSTATUS nfs41_CloseSrvOpen(
  31.      DbgEn();
  32.      print_debug_header(RxContext);
  33.  #endif
  34. +
  35. +#if 1
  36. +    LONGLONG writes_in_progress;
  37. +    LARGE_INTEGER poll_delay = { .QuadPart=1000 };
  38. +
  39. +    while ((writes_in_progress = InterlockedOr64(&nfs41_fobx->writes_in_progress, 0LL)) != 0LL) {
  40. +        DbgP("nfs41_CloseSrvOpen: waiting for writes_in_progress=%lld: FOBX=0x%p\n",
  41. +            writes_in_progress, (void *)nfs41_fobx);
  42. +        (void)KeDelayExecutionThread(KernelMode, FALSE, &poll_delay);
  43. +    }
  44. +#endif
  45.  
  46.      if (!nfs41_fobx->deleg_type && !nfs41_fcb->StandardInfo.Directory &&
  47.              !RxContext->pFcb->OpenCount) {
  48. @@ -4800,6 +4814,23 @@ static NTSTATUS nfs41_Flush(
  49.      DbgP("nfs41_Flush: FileName='%wZ'\n",
  50.          GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext));
  51.  
  52. +#if 1
  53. +    __notnull PMRX_SRV_OPEN SrvOpen = RxContext->pRelevantSrvOpen;
  54. +    ULONG flag = DISABLE_CACHING;
  55. +    RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  56. +#endif
  57. +#if 1                                                                                                                                                                                                                  
  58. +    __notnull PNFS41_FOBX nfs41_fobx = NFS41GetFobxExtension(RxContext->pFobx);
  59. +    LONGLONG writes_in_progress;                                                                                                                                                                                        
  60. +    LARGE_INTEGER poll_delay = { .QuadPart=10000 };                                                                                                                                                                      
  61. +                                                                                                                                                                                                                        
  62. +    while ((writes_in_progress = InterlockedOr64(&nfs41_fobx->writes_in_progress, 0LL)) != 0LL) {                                                                                                                      
  63. +        DbgP("nfs41_Flush: waiting for writes_in_progress=%lld: FOBX=0x%p\n",                                                                                                                                    
  64. +            writes_in_progress, (void *)nfs41_fobx);                                                                                                                                                                    
  65. +        (void)KeDelayExecutionThread(KernelMode, FALSE, &poll_delay);                                                                                                                                                  
  66. +    }                                                                                                                                                                                                                  
  67. +#endif
  68. +
  69.      return STATUS_SUCCESS;
  70.  }
  71.  
  72. @@ -6831,6 +6862,10 @@ static NTSTATUS nfs41_Write(
  73.      print_readwrite_args(RxContext);
  74.  #endif
  75.  
  76. +
  77. +#if 1
  78. +    (void)InterlockedIncrement64(&nfs41_fobx->writes_in_progress);
  79. +#endif
  80.      status = check_nfs41_write_args(RxContext);
  81.      if (status) goto out;
  82.  
  83. @@ -6897,6 +6932,9 @@ static NTSTATUS nfs41_Write(
  84.      }
  85.      nfs41_UpcallDestroy(entry);
  86.  out:
  87. +#if 1
  88. +    (void)InterlockedDecrement64(&nfs41_fobx->writes_in_progress);
  89. +#endif
  90.  #ifdef ENABLE_TIMINGS
  91.      t2 = KeQueryPerformanceCounter(NULL);
  92.      InterlockedIncrement(&write.tops);

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