Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Oct 2017 11:00:35 +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-11@freebsd.org
Subject:   svn commit: r324235 - in stable/11/sys: kern vm
Message-ID:  <201710031100.v93B0ZSJ084283@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Oct  3 11:00:34 2017
New Revision: 324235
URL: https://svnweb.freebsd.org/changeset/base/324235

Log:
  MFC r323768:
  For unlinked files, do not msync(2) or sync on the vnode deactivation.

Modified:
  stable/11/sys/kern/vfs_subr.c
  stable/11/sys/vm/vm_object.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_subr.c
==============================================================================
--- stable/11/sys/kern/vfs_subr.c	Tue Oct  3 08:29:46 2017	(r324234)
+++ stable/11/sys/kern/vfs_subr.c	Tue Oct  3 11:00:34 2017	(r324235)
@@ -2953,8 +2953,8 @@ vinactive(struct vnode *vp, struct thread *td)
 	 * point that VOP_INACTIVE() is called, there could still be
 	 * pending I/O and dirty pages in the object.
 	 */
-	obj = vp->v_object;
-	if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
+	if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 &&
+	    (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
 		VM_OBJECT_WLOCK(obj);
 		vm_object_page_clean(obj, 0, 0, 0);
 		VM_OBJECT_WUNLOCK(obj);

Modified: stable/11/sys/vm/vm_object.c
==============================================================================
--- stable/11/sys/vm/vm_object.c	Tue Oct  3 08:29:46 2017	(r324234)
+++ stable/11/sys/vm/vm_object.c	Tue Oct  3 11:00:34 2017	(r324235)
@@ -1083,8 +1083,8 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset
 	 * I/O.
 	 */
 	if (object->type == OBJT_VNODE &&
-	    (object->flags & OBJ_MIGHTBEDIRTY) != 0) {
-		vp = object->handle;
+	    (object->flags & OBJ_MIGHTBEDIRTY) != 0 &&
+	    ((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) {
 		VM_OBJECT_WUNLOCK(object);
 		(void) vn_start_write(vp, &mp, V_WAIT);
 		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);



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