From 0a4e8d80c18bd8d493e66fb2e7056b804c13e3e4 Mon Sep 17 00:00:00 2001 From: perseant Date: Tue, 28 Mar 2006 23:57:41 +0000 Subject: [PATCH] Double-checkpoint on unmount. This ensures that vnodes belonging to removed files are really freed, preventing occasional spurious EBUSY returns from vflush(). --- sys/ufs/lfs/lfs_vfsops.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index 3fcce6800ae9..3dcb793bc68e 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.195 2006/03/24 20:05:32 perseant Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.196 2006/03/28 23:57:41 perseant Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.195 2006/03/24 20:05:32 perseant Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.196 2006/03/28 23:57:41 perseant Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -1363,8 +1363,9 @@ lfs_unmount(struct mount *mp, int mntflags, struct lwp *l) ump = VFSTOUFS(mp); fs = ump->um_lfs; - /* Write everything we've got */ - lfs_segwrite(mp, SEGM_CKP); + /* Two checkpoints */ + lfs_segwrite(mp, SEGM_CKP | SEGM_SYNC); + lfs_segwrite(mp, SEGM_CKP | SEGM_SYNC); /* wake up the cleaner so it can die */ wakeup(&fs->lfs_nextseg);