Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2012 15:19:49 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r231205 - stable/8/sys/kern
Message-ID:  <201202081519.q18FJn8O048495@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Feb  8 15:19:49 2012
New Revision: 231205
URL: http://svn.freebsd.org/changeset/base/231205

Log:
  MFC r230553:
  When doing vflush(WRITECLOSE), clean vnode pages.
  
  Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is
  still a race allowing a process to dirty pages after msync
  finished. Remounts rw->ro just left dirty pages in system.

Modified:
  stable/8/sys/kern/vfs_subr.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/vfs_subr.c
==============================================================================
--- stable/8/sys/kern/vfs_subr.c	Wed Feb  8 15:07:19 2012	(r231204)
+++ stable/8/sys/kern/vfs_subr.c	Wed Feb  8 15:19:49 2012	(r231205)
@@ -2501,6 +2501,18 @@ loop:
 		 * vnodes open for writing.
 		 */
 		if (flags & WRITECLOSE) {
+			if (vp->v_object != NULL) {
+				VM_OBJECT_LOCK(vp->v_object);
+				vm_object_page_clean(vp->v_object, 0, 0, 0);
+				VM_OBJECT_UNLOCK(vp->v_object);
+			}
+			error = VOP_FSYNC(vp, MNT_WAIT, td);
+			if (error != 0) {
+				VOP_UNLOCK(vp, 0);
+				vdrop(vp);
+				MNT_VNODE_FOREACH_ABORT(mp, mvp);
+				return (error);
+			}
 			error = VOP_GETATTR(vp, &vattr, td->td_ucred);
 			VI_LOCK(vp);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202081519.q18FJn8O048495>