Module Name:    src
Committed By:   snj
Date:           Sat Apr  4 17:27:16 UTC 2009

Modified Files:
        src/sys/ufs/ffs [netbsd-5]: ffs_vnops.c

Log Message:
Pull up following revision(s) (requested by add in ticket #655):
        sys/ufs/ffs/ffs_vfsops.c: revision 1.245 via patch
        sys/ufs/ffs/ffs_vnops.c: revision 1.112 via patch
fsync:
- atime updates were not being synced.
ffs_sync:
- In some cases the sync vnode was acting like now dead /usr/sbin/update.
  It was examining vnodes that it should have ignored.
- It would find dirty inodes and try to flush them. Often ffs_fsync()
  cheerfully ignored the flush request due to the fsync bug. Such inodes
  remained dirty and were repeatedly re-examined by the syncer until
  vnode reclaim or system shutdown.
- We were marking our place in the per-mount vnode list even though in
  most cases there was not flush to perform. While not a bug, this wasted
  CPU cycles because a TAILQ_NEXT would have sufficed.


To generate a diff of this commit:
cvs rdiff -u -r1.104.4.6 -r1.104.4.7 src/sys/ufs/ffs/ffs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ffs/ffs_vnops.c
diff -u src/sys/ufs/ffs/ffs_vnops.c:1.104.4.6 src/sys/ufs/ffs/ffs_vnops.c:1.104.4.7
--- src/sys/ufs/ffs/ffs_vnops.c:1.104.4.6	Tue Feb 24 04:13:35 2009
+++ src/sys/ufs/ffs/ffs_vnops.c	Sat Apr  4 17:27:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vnops.c,v 1.104.4.6 2009/02/24 04:13:35 snj Exp $	*/
+/*	$NetBSD: ffs_vnops.c,v 1.104.4.7 2009/04/04 17:27:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.104.4.6 2009/02/24 04:13:35 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.104.4.7 2009/04/04 17:27:16 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -338,8 +338,8 @@
 				fstrans_done(vp->v_mount);
 				return error;
 			}
-			error = ffs_update(vp, NULL, NULL,
-				(ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0);
+			error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+			    ((ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
 			UFS_WAPBL_END(mp);
 		}
 		if (error || (ap->a_flags & FSYNC_NOLOG) != 0) {
@@ -383,9 +383,9 @@
 		mutex_exit(&vp->v_interlock);
 	}
 
-	error = ffs_update(vp, NULL, NULL,
-	    ((ap->a_flags & (FSYNC_WAIT | FSYNC_DATAONLY)) == FSYNC_WAIT)
-	    ? UPDATE_WAIT : 0);
+	error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+	    (((ap->a_flags & (FSYNC_WAIT | FSYNC_DATAONLY)) == FSYNC_WAIT)
+	    ? UPDATE_WAIT : 0));
 
 	if (error == 0 && ap->a_flags & FSYNC_CACHE) {
 		int l = 0;
@@ -462,8 +462,8 @@
 			error = UFS_WAPBL_BEGIN(mp);
 			if (error)
 				return error;
-			error = ffs_update(vp, NULL, NULL,
-			    (flags & FSYNC_WAIT) ? UPDATE_WAIT : 0);
+			error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+			    ((flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
 			UFS_WAPBL_END(mp);
 		}
 		if (error || (flags & FSYNC_NOLOG) != 0)
@@ -574,7 +574,7 @@
 		waitfor = 0;
 	else
 		waitfor = (flags & FSYNC_WAIT) != 0 ? UPDATE_WAIT : 0;
-	error = ffs_update(vp, NULL, NULL, waitfor);
+	error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE | waitfor);
 
 	if (error == 0 && (flags & FSYNC_CACHE) != 0) {
 		(void)VOP_IOCTL(VTOI(vp)->i_devvp, DIOCCACHESYNC, &i, FWRITE,

Reply via email to