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:
parent
6a87896854
commit
d24ffa7077
|
@ -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.
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||||
|
@ -322,6 +322,7 @@ lfs_mountfs(devvp, mp, p)
|
||||||
dev_t dev;
|
dev_t dev;
|
||||||
int error, i, ronly, size;
|
int error, i, ronly, size;
|
||||||
struct ucred *cred;
|
struct ucred *cred;
|
||||||
|
SEGUSE *sup;
|
||||||
|
|
||||||
cred = p ? p->p_ucred : NOCRED;
|
cred = p ? p->p_ucred : NOCRED;
|
||||||
/*
|
/*
|
||||||
|
@ -442,6 +443,14 @@ lfs_mountfs(devvp, mp, p)
|
||||||
VREF(vp);
|
VREF(vp);
|
||||||
vput(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);
|
return (0);
|
||||||
out:
|
out:
|
||||||
if (bp)
|
if (bp)
|
||||||
|
|
Loading…
Reference in New Issue