- From 525a9b45be6fd515d358d350b6cd81d4170d0089 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 12 Mar 2025 14:54:44 +0100
- Subject: [PATCH 2/2] sys: |MRxCreate()|/|MRxCloseSrvOpen()| should sync with
- lazywriter
- |MRxCreate()|/|MRxCloseSrvOpen()| should sync with lazywriter,
- so all outstanding dirty pages are written to the NFS server before
- we close the file.
- This also fixes svn checkouts like
- $ svn checkout https://svn.FreeBSD.org/base/head/share/man #,
- which previously failed with
- "sqlite[S11]: database disk image is malformed".
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 33 ---------------------------------
- sys/nfs41sys_openclose.c | 6 ++++++
- tests/manual_testing.txt | 34 ----------------------------------
- 3 files changed, 6 insertions(+), 67 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index 407576a..6a5c025 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -597,39 +597,6 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
- - Win10/32bit-only: $ net use H: /delete # does not work,
- use $ nfs_umount 'H' instead #
- -- Bug: Subversion checkout can fail with
- - "sqlite[S11]: database disk image is malformed" like this:
- - # ---- snip ----
- - $ svn --version
- - svn, version 1.14.2 (r1899510)
- - compiled May 20 2023, 11:51:30 on x86_64-pc-cygwin
- - $ svn checkout https://svn.FreeBSD.org/base/head/share/man
- - A man/man4
- - A man/man4/tcp.4
- - A man/man4/ndis.4
- - A man/man4/Makefile
- - A man/man4/altq.4
- - A man/man4/miibus.4
- - A man/man4/vlan.4
- - A man/man4/ng_macfilter.4
- - A man/man4/mn.4
- - A man/man4/ossl.4
- - A man/man4/ktls.4
- - A man/man4/ftwd.4
- - A man/man4/inet6.4
- - A man/man4/crypto.4
- - A man/man4/rtsx.4
- - A man/man4/isp.4
- - svn: E200030: sqlite[S11]: database disk image is malformed
- - svn: E200042: Additional errors:
- - svn: E200030: sqlite[S11]: database disk image is malformed
- - svn: E200030: sqlite[S11]: database disk image is malformed
- - svn: E200030: sqlite[S11]: database disk image is malformed
- - # ---- snip ----
- - Workaround is to mount the NFS filesystem with the "writethru"
- - option, e.g.
- - $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
- -
- - Windows event log can list errors like "MUP 0xc0000222"
- (|STATUS_LOST_WRITEBEHIND_DATA|) in case the disk on the NFSv4 server
- is full and outstanding writes from a memory-mapped file fail.
- diff --git a/sys/nfs41sys_openclose.c b/sys/nfs41sys_openclose.c
- index 4d61e42..23e7930 100644
- --- a/sys/nfs41sys_openclose.c
- +++ b/sys/nfs41sys_openclose.c
- @@ -912,6 +912,9 @@ retry_on_link:
- SrvOpen->pAlreadyPrefixedName);
- #endif
- RxChangeBufferingState((PSRV_OPEN)SrvOpen, ULongToPtr(flag), 1);
- +
- + /* Wait for lazywriter */
- + (void)RxFlushFcbInSystemCache((PFCB)RxContext->pFcb, TRUE);
- }
- if (!nfs41_fcb->StandardInfo.Directory &&
- @@ -1096,6 +1099,9 @@ NTSTATUS nfs41_CloseSrvOpen(
- nfs41_remove_fcb_entry(RxContext->pFcb);
- }
- + /* Wait for lazywriter */
- + (void)RxFlushFcbInSystemCache((PFCB)RxContext->pFcb, TRUE);
- +
- status = nfs41_UpcallCreate(NFS41_SYSOP_CLOSE, &nfs41_fobx->sec_ctx,
- pVNetRootContext->session, nfs41_fobx->nfs41_open_state,
- pNetRootContext->nfs41d_version, SrvOpen->pAlreadyPrefixedName, &entry);
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 0bf5029..09ef4a6 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -496,40 +496,6 @@ chmod a+rx setup-x86_64.exe
- #
- # Subversion checkout:
- #
- -# Currently fails like this:
- -# ---- snip ----
- -# $ svn --version
- -# svn, version 1.14.2 (r1899510)
- -# compiled May 20 2023, 11:51:30 on x86_64-pc-cygwin
- -#
- -# $ svn checkout https://svn.FreeBSD.org/base/head/share/man
- -# A man/man4
- -# A man/man4/tcp.4
- -# A man/man4/ndis.4
- -# A man/man4/Makefile
- -# A man/man4/altq.4
- -# A man/man4/miibus.4
- -# A man/man4/vlan.4
- -# A man/man4/ng_macfilter.4
- -# A man/man4/mn.4
- -# A man/man4/ossl.4
- -# A man/man4/ktls.4
- -# A man/man4/ftwd.4
- -# A man/man4/inet6.4
- -# A man/man4/crypto.4
- -# A man/man4/rtsx.4
- -# A man/man4/isp.4
- -# svn: E200030: sqlite[S11]: database disk image is malformed
- -# svn: E200042: Additional errors:
- -# svn: E200030: sqlite[S11]: database disk image is malformed
- -# svn: E200030: sqlite[S11]: database disk image is malformed
- -# svn: E200030: sqlite[S11]: database disk image is malformed
- -# ---- snip ----
- -#
- -# Workaround is to mount the NFS filesystem with the "writethru"
- -# option, e.g.
- -# $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
- -#
- # Test:
- svn checkout https://svn.FreeBSD.org/base/head/share/man
- --
- 2.45.1
prototype wait-for-lazywriter patch
Posted by Anonymous on Mon 17th Mar 2025 16:36
raw | new post
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.