pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


prototype wait-for-lazywriter patch
Posted by Anonymous on Mon 17th Mar 2025 16:36
raw | new post

  1. From 525a9b45be6fd515d358d350b6cd81d4170d0089 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 12 Mar 2025 14:54:44 +0100
  4. Subject: [PATCH 2/2] sys: |MRxCreate()|/|MRxCloseSrvOpen()| should sync with
  5.  lazywriter
  6.  
  7. |MRxCreate()|/|MRxCloseSrvOpen()| should sync with lazywriter,
  8. so all outstanding dirty pages are written to the NFS server before
  9. we close the file.
  10.  
  11. This also fixes svn checkouts like
  12. $ svn checkout https://svn.FreeBSD.org/base/head/share/man #,
  13. which previously failed with
  14. "sqlite[S11]: database disk image is malformed".
  15.  
  16. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  17. ---
  18. cygwin/README.bintarball.txt | 33 ---------------------------------
  19.  sys/nfs41sys_openclose.c     |  6 ++++++
  20.  tests/manual_testing.txt     | 34 ----------------------------------
  21.  3 files changed, 6 insertions(+), 67 deletions(-)
  22.  
  23. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  24. index 407576a..6a5c025 100644
  25. --- a/cygwin/README.bintarball.txt
  26. +++ b/cygwin/README.bintarball.txt
  27. @@ -597,39 +597,6 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  28.  - Win10/32bit-only: $ net use H: /delete # does not work,
  29.    use $ nfs_umount 'H' instead #
  30.  
  31. -- Bug: Subversion checkout can fail with
  32. -  "sqlite[S11]: database disk image is malformed" like this:
  33. -  # ---- snip ----
  34. -  $ svn --version
  35. -  svn, version 1.14.2 (r1899510)
  36. -    compiled May 20 2023, 11:51:30 on x86_64-pc-cygwin
  37. -  $ svn checkout https://svn.FreeBSD.org/base/head/share/man
  38. -  A    man/man4
  39. -  A    man/man4/tcp.4
  40. -  A    man/man4/ndis.4
  41. -  A    man/man4/Makefile
  42. -  A    man/man4/altq.4
  43. -  A    man/man4/miibus.4
  44. -  A    man/man4/vlan.4
  45. -  A    man/man4/ng_macfilter.4
  46. -  A    man/man4/mn.4
  47. -  A    man/man4/ossl.4
  48. -  A    man/man4/ktls.4
  49. -  A    man/man4/ftwd.4
  50. -  A    man/man4/inet6.4
  51. -  A    man/man4/crypto.4
  52. -  A    man/man4/rtsx.4
  53. -  A    man/man4/isp.4
  54. -  svn: E200030: sqlite[S11]: database disk image is malformed
  55. -  svn: E200042: Additional errors:
  56. -  svn: E200030: sqlite[S11]: database disk image is malformed
  57. -  svn: E200030: sqlite[S11]: database disk image is malformed
  58. -  svn: E200030: sqlite[S11]: database disk image is malformed
  59. -  # ---- snip ----
  60. -  Workaround is to mount the NFS filesystem with the "writethru"
  61. -  option, e.g.
  62. -  $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
  63. -
  64.  - Windows event log can list errors like "MUP 0xc0000222"
  65.    (|STATUS_LOST_WRITEBEHIND_DATA|) in case the disk on the NFSv4 server
  66.    is full and outstanding writes from a memory-mapped file fail.
  67. diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
  68. index 4d61e42..23e7930 100644
  69. --- a/sys/nfs41sys_openclose.c
  70. +++ b/sys/nfs41sys_openclose.c
  71. @@ -912,6 +912,9 @@ retry_on_link:
  72.              SrvOpen->pAlreadyPrefixedName);
  73.  #endif
  74.          RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
  75. +
  76. +        /* Wait for lazywriter */
  77. +        (void)RxFlushFcbInSystemCache((PFCB)RxContext->pFcb, TRUE);
  78.      }
  79.  
  80.      if (!nfs41_fcb->StandardInfo.Directory &&
  81. @@ -1096,6 +1099,9 @@ NTSTATUS nfs41_CloseSrvOpen(
  82.          nfs41_remove_fcb_entry(RxContext->pFcb);
  83.      }
  84.  
  85. +    /* Wait for lazywriter */
  86. +    (void)RxFlushFcbInSystemCache((PFCB)RxContext->pFcb, TRUE);
  87. +
  88.      status = nfs41_UpcallCreate(NFS41_SYSOP_CLOSE, &nfs41_fobx->sec_ctx,
  89.          pVNetRootContext->session, nfs41_fobx->nfs41_open_state,
  90.          pNetRootContext->nfs41d_version, SrvOpen->pAlreadyPrefixedName, &entry);
  91. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  92. index 0bf5029..09ef4a6 100644
  93. --- a/tests/manual_testing.txt
  94. +++ b/tests/manual_testing.txt
  95. @@ -496,40 +496,6 @@ chmod a+rx setup-x86_64.exe
  96.  #
  97.  # Subversion checkout:
  98.  #
  99. -# Currently fails like this:
  100. -# ---- snip ----
  101. -# $ svn --version
  102. -# svn, version 1.14.2 (r1899510)
  103. -#   compiled May 20 2023, 11:51:30 on x86_64-pc-cygwin
  104. -#
  105. -# $ svn checkout https://svn.FreeBSD.org/base/head/share/man
  106. -# A    man/man4
  107. -# A    man/man4/tcp.4
  108. -# A    man/man4/ndis.4
  109. -# A    man/man4/Makefile
  110. -# A    man/man4/altq.4
  111. -# A    man/man4/miibus.4
  112. -# A    man/man4/vlan.4
  113. -# A    man/man4/ng_macfilter.4
  114. -# A    man/man4/mn.4
  115. -# A    man/man4/ossl.4
  116. -# A    man/man4/ktls.4
  117. -# A    man/man4/ftwd.4
  118. -# A    man/man4/inet6.4
  119. -# A    man/man4/crypto.4
  120. -# A    man/man4/rtsx.4
  121. -# A    man/man4/isp.4
  122. -# svn: E200030: sqlite[S11]: database disk image is malformed
  123. -# svn: E200042: Additional errors:
  124. -# svn: E200030: sqlite[S11]: database disk image is malformed
  125. -# svn: E200030: sqlite[S11]: database disk image is malformed
  126. -# svn: E200030: sqlite[S11]: database disk image is malformed
  127. -# ---- snip ----
  128. -#
  129. -# Workaround is to mount the NFS filesystem with the "writethru"
  130. -# option, e.g.
  131. -# $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
  132. -#
  133.  # Test:
  134.  svn checkout https://svn.FreeBSD.org/base/head/share/man
  135.  
  136. --
  137. 2.45.1

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