Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/genfs Layer_fsync(): when syncing a device node c...



details:   https://anonhg.NetBSD.org/src/rev/77ffbef4332c
branches:  trunk
changeset: 767206:77ffbef4332c
user:      hannken <hannken%NetBSD.org@localhost>
date:      Mon Jul 11 08:34:01 2011 +0000

description:
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

diffstat:

 sys/miscfs/genfs/layer_vnops.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r c9688af71ec2 -r 77ffbef4332c sys/miscfs/genfs/layer_vnops.c
--- a/sys/miscfs/genfs/layer_vnops.c    Mon Jul 11 08:27:37 2011 +0000
+++ b/sys/miscfs/genfs/layer_vnops.c    Mon Jul 11 08:34:01 2011 +0000
@@ -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);
 }
 



Home | Main Index | Thread Index | Old Index