Module Name:    src
Committed By:   hannken
Date:           Mon Jul 11 08:34:01 UTC 2011

Modified Files:
        src/sys/miscfs/genfs: layer_vnops.c

Log Message:
Layer_fsync(): when syncing a device node call spec_fsync() to clean the
               layer node before descending to the lower file system.

Adresses PR kern/38762 panic: vwakeup: neg numoutput


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/miscfs/genfs/layer_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/miscfs/genfs/layer_vnops.c
diff -u src/sys/miscfs/genfs/layer_vnops.c:1.49 src/sys/miscfs/genfs/layer_vnops.c:1.50
--- src/sys/miscfs/genfs/layer_vnops.c:1.49	Mon Jul 11 08:27:38 2011
+++ src/sys/miscfs/genfs/layer_vnops.c	Mon Jul 11 08:34:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: layer_vnops.c,v 1.49 2011/07/11 08:27:38 hannken Exp $	*/
+/*	$NetBSD: layer_vnops.c,v 1.50 2011/07/11 08:34:01 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -170,7 +170,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.49 2011/07/11 08:27:38 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.50 2011/07/11 08:34:01 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -186,6 +186,7 @@
 #include <miscfs/genfs/layer.h>
 #include <miscfs/genfs/layer_extern.h>
 #include <miscfs/genfs/genfs.h>
+#include <miscfs/specfs/specdev.h>
 
 /*
  * This is the 08-June-99 bypass routine, based on the 10-Apr-92 bypass
@@ -529,10 +530,16 @@
 		off_t offhi;
 		struct lwp *a_l;
 	} */ *ap = v;
+	int error;
 
 	if (ap->a_flags & FSYNC_RECLAIM) {
 		return 0;
 	}
+	if (ap->a_vp->v_type == VBLK || ap->a_vp->v_type == VCHR) {
+		error = spec_fsync(v);
+		if (error)
+			return error;
+	}
 	return LAYERFS_DO_BYPASS(ap->a_vp, ap);
 }
 

Reply via email to