Module Name:    src
Committed By:   snj
Date:           Sat Apr  4 18:14:50 UTC 2009

Modified Files:
        src/sys/miscfs/genfs [netbsd-5]: genfs_io.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #664):
        sys/miscfs/genfs/genfs_io.c: revision 1.16
Check that the filesystem acutally uses WAPBL before initiating a
transaction for the directio case. Fixes PR 39929 and similiar issues
seen with PostgreSQL.


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.13.4.1 src/sys/miscfs/genfs/genfs_io.c:1.13.4.2
--- src/sys/miscfs/genfs/genfs_io.c:1.13.4.1	Sun Nov  2 23:08:56 2008
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr  4 18:14:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.13.4.1 2008/11/02 23:08:56 snj Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13.4.2 2009/04/04 18:14:50 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.13.4.1 2008/11/02 23:08:56 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.13.4.2 2009/04/04 18:14:50 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1559,6 +1559,8 @@
 	size_t len;
 	const int mask = DEV_BSIZE - 1;
 	int error;
+	bool need_wapbl = (vp->v_mount && vp->v_mount->mnt_wapbl &&
+	    (ioflag & IO_JOURNALLOCKED) == 0);
 
 	/*
 	 * We only support direct I/O to user space for now.
@@ -1580,7 +1582,7 @@
 		return;
 	}
 
-	if ((ioflag & IO_JOURNALLOCKED) == 0) {
+	if (need_wapbl) {
 		error = WAPBL_BEGIN(vp->v_mount);
 		if (error)
 			return;
@@ -1632,7 +1634,7 @@
 		uio->uio_resid -= len;
 	}
 
-	if ((ioflag & IO_JOURNALLOCKED) == 0)
+	if (need_wapbl)
 		WAPBL_END(vp->v_mount);
 }
 

Reply via email to