diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-06-25 15:49:27 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-06-25 15:49:27 +0000 |
commit | 76b6aacf60d37639f946fe7c18eba405f282e980 (patch) | |
tree | 1c9e03957a54b2006f8bbda1f3d6f26d73c2556e | |
parent | acb0cca6a4b9cfbd09f6f68cb75c95df1bf3cf23 (diff) |
backout the buf_acquire() does the bremfree() since all callers
where doing bremfree() befure calling buf_acquire().
This is causing us headache pinning down a bug that showed up
when deraadt@ too cvs to current, and will have to be done
anyway as a preperation for backouts.
OK deraadt@
-rw-r--r-- | sys/kern/spec_vnops.c | 3 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_biomem.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 5 | ||||
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 3 |
9 files changed, 22 insertions, 11 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index ed5a617a7d6..c846d54ff70 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.54 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.55 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -439,6 +439,7 @@ loop: continue; if ((bp->b_flags & B_DELWRI) == 0) panic("spec_fsync: not dirty"); + bremfree(bp); buf_acquire(bp); splx(s); bawrite(bp); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 0e7c21786ec..1322bb93feb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.117 2009/06/15 17:01:26 beck Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.118 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /*- @@ -812,6 +812,7 @@ start: if (!ISSET(bp->b_flags, B_INVAL)) { bcstats.cachehits++; SET(bp->b_flags, B_CACHE); + bremfree(bp); buf_acquire(bp); splx(s); return (bp); @@ -973,6 +974,7 @@ buf_daemon(struct proc *p) if (bcstats.numdirtypages < lodirtypages) break; + bremfree(bp); buf_acquire(bp); splx(s); diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c index ac9eaf95e25..89ab5f4d114 100644 --- a/sys/kern/vfs_biomem.c +++ b/sys/kern/vfs_biomem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_biomem.c,v 1.8 2009/06/16 00:11:29 oga Exp $ */ +/* $OpenBSD: vfs_biomem.c,v 1.9 2009/06/25 15:49:26 thib Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> * @@ -80,12 +80,10 @@ buf_acquire(struct buf *bp) KASSERT((bp->b_flags & B_BUSY) == 0); s = splbio(); - /* * Busy before waiting for kvm. */ SET(bp->b_flags, B_BUSY); - bremfree(bp); buf_map(bp); splx(s); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 4d09d4f20a0..4b19f59ef2a 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.178 2009/06/15 17:01:26 beck Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.179 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1687,6 +1687,7 @@ vfs_syncwait(int verbose) */ if (bp->b_flags & B_DELWRI) { s = splbio(); + bremfree(bp); buf_acquire(bp); splx(s); nbusy++; @@ -1857,6 +1858,7 @@ loop: } break; } + bremfree(bp); buf_acquire(bp); /* * XXX Since there are no node locks for NFS, I believe @@ -1894,6 +1896,7 @@ loop: continue; if ((bp->b_flags & B_DELWRI) == 0) panic("vflushbuf: not dirty"); + bremfree(bp); buf_acquire(bp); splx(s); /* diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index ed5a617a7d6..c846d54ff70 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.54 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.55 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -439,6 +439,7 @@ loop: continue; if ((bp->b_flags & B_DELWRI) == 0) panic("spec_fsync: not dirty"); + bremfree(bp); buf_acquire(bp); splx(s); bawrite(bp); diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index e0f646dfbc8..cdd2d44a55d 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_syscalls.c,v 1.81 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: nfs_syscalls.c,v 1.82 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */ /* @@ -663,6 +663,7 @@ nfssvc_iod(void *arg) (B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI) continue; nbp->b_flags |= B_ASYNC; + bremfree(nbp); buf_acquire(nbp); break; } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 2fe5acffd29..ee879632549 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.114 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.115 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -2827,6 +2827,7 @@ again: if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) != (B_DELWRI | B_NEEDCOMMIT)) continue; + bremfree(bp); bp->b_flags |= B_WRITEINPROG; buf_acquire(bp); /* @@ -2905,6 +2906,7 @@ loop: panic("nfs_fsync: not dirty"); if ((passone || !commit) && (bp->b_flags & B_NEEDCOMMIT)) continue; + bremfree(bp); if (passone || !commit) { bp->b_flags |= B_ASYNC; } else { diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 0a76d2144f1..3e0ffb6e9af 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.99 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.100 2009/06/25 15:49:26 thib Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -4700,6 +4700,7 @@ softdep_fsync_mountdev(vp, waitfor) wk->wk_type != D_BMSAFEMAP) { continue; } + bremfree(bp); buf_acquire(bp); FREE_LOCK(&lk); (void) bawrite(bp); @@ -5607,6 +5608,7 @@ getdirtybuf(bp, waitfor) } if ((bp->b_flags & B_DELWRI) == 0) return (0); + bremfree(bp); buf_acquire(bp); return (1); } diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 7b92d471191..e549eb0d981 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vnops.c,v 1.53 2009/06/06 18:06:22 art Exp $ */ +/* $OpenBSD: ffs_vnops.c,v 1.54 2009/06/25 15:49:26 thib Exp $ */ /* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */ /* @@ -448,6 +448,7 @@ loop: continue; } + bremfree(bp); buf_acquire(bp); bp->b_flags |= B_SCANNED; splx(s); |