Mark the current segment with SEGUSE_ACTIVE at mount time, rather than waiting

for the first write.  If this is not done, the cleaner may try to clean the
current segment out from under the writer if the filesystem is mounted after
a crash (or any other time that the dirty:clean segment ration is high enough).
This commit is contained in:
perseant 1999-04-11 23:31:09 +00:00
parent 6a87896854
commit d24ffa7077
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_vfsops.c,v 1.29 1999/04/04 09:56:44 mycroft Exp $ */
/* $NetBSD: lfs_vfsops.c,v 1.30 1999/04/11 23:31:09 perseant Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -322,6 +322,7 @@ lfs_mountfs(devvp, mp, p)
dev_t dev;
int error, i, ronly, size;
struct ucred *cred;
SEGUSE *sup;
cred = p ? p->p_ucred : NOCRED;
/*
@ -442,6 +443,14 @@ lfs_mountfs(devvp, mp, p)
VREF(vp);
vput(vp);
/*
* Mark the current segment as ACTIVE, since we're going to
* be writing to it.
*/
LFS_SEGENTRY(sup, fs, datosn(fs, fs->lfs_offset), bp);
sup->su_flags |= SEGUSE_DIRTY | SEGUSE_ACTIVE;
(void) VOP_BWRITE(bp);
return (0);
out:
if (bp)