diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-01-08 15:51:57 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-01-08 15:51:57 +0000 |
commit | 4c39457179a333b0a0e65a524b00c17c5db002de (patch) | |
tree | 1850caec734b098447bdcf53d732b11685d54172 | |
parent | a49dc4439ae41de5553599407515bcac6cfed2f3 (diff) |
Soft updates bug fix: Set the flags on the buffer describing our intentions
before we call bioops.io_start. However, don't move buffer memory to
parent until bioops.io_start has had a chance to do its thing (otherwise,
io_start will be very disappointed went it tries to read the buffer :)
Thanks to Todd T. Fries for finding this one!
-rw-r--r-- | sys/kern/vfs_cluster.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index c5a3974c051..924b11f1403 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cluster.c,v 1.11 1997/11/06 05:58:26 csapuntz Exp $ */ +/* $OpenBSD: vfs_cluster.c,v 1.12 1998/01/08 15:51:56 csapuntz Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */ /*- @@ -698,6 +698,13 @@ redo: panic("Clustered write to wrong blocks"); } + /* + * We might as well AGE the buffer here; it's either empty, or + * contains data that we couldn't get rid of (but wanted to). + */ + tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); + tbp->b_flags |= (B_ASYNC | B_AGE); + if (LIST_FIRST(&tbp->b_dep) != NULL && bioops.io_start) (*bioops.io_start)(tbp); @@ -706,12 +713,7 @@ redo: bp->b_bufsize += size; tbp->b_bufsize -= size; - tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); - /* - * We might as well AGE the buffer here; it's either empty, or - * contains data that we couldn't get rid of (but wanted to). - */ - tbp->b_flags |= (B_ASYNC | B_AGE); + s = splbio(); reassignbuf(tbp, tbp->b_vp); /* put on clean list */ ++tbp->b_vp->v_numoutput; |