From 01db6055678b2e1a77e79d6ccc31672a0f157f5e Mon Sep 17 00:00:00 2001 From: fvdl Date: Wed, 15 Mar 2000 16:28:45 +0000 Subject: [PATCH] Do the previous slightly different: any files on MNT_SOFTDEP filesystems do not want all their metadata dependencies flushed from vinvalbuf() if there are no dirty blocks. --- sys/kern/vfs_subr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index cb5180c1f750..d1f711d58b88 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.119 2000/03/11 05:00:18 perseant Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.120 2000/03/15 16:28:45 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -614,12 +614,16 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "vbwait", 0); } - splx(s); - if ((error = VOP_FSYNC(vp, cred, FSYNC_WAIT, p)) != 0) - return (error); - s = splbio(); - if (vp->v_numoutput > 0 || vp->v_dirtyblkhd.lh_first != NULL) - panic("vinvalbuf: dirty bufs"); + if (vp->v_dirtyblkhd.lh_first != NULL || vp->v_mount == NULL || + !(vp->v_mount->mnt_flag & MNT_SOFTDEP)) { + splx(s); + if ((error = VOP_FSYNC(vp, cred, FSYNC_WAIT, p)) != 0) + return (error); + s = splbio(); + if (vp->v_numoutput > 0 || + vp->v_dirtyblkhd.lh_first != NULL) + panic("vinvalbuf: dirty bufs"); + } splx(s); }