summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c8
-rw-r--r--sys/ufs/mfs/mfs_vnops.c13
2 files changed, 15 insertions, 6 deletions
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index 894534ae7b1..bb1683e5f64 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfs_vfsops.c,v 1.38 2007/12/06 21:49:37 otto Exp $ */
+/* $OpenBSD: mfs_vfsops.c,v 1.39 2007/12/16 21:21:25 otto Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
/*
@@ -174,11 +174,11 @@ mfs_start(struct mount *mp, int flags, struct proc *p)
struct buf *bp;
int sleepreturn = 0, s;
- while (mfsp->mfs_buflist != (struct buf *)-1) {
+ while (1) {
while (1) {
s = splbio();
bp = mfsp->mfs_buflist;
- if (bp == NULL) {
+ if (bp == NULL || bp == (struct buf *)-1) {
splx(s);
break;
}
@@ -187,6 +187,8 @@ mfs_start(struct mount *mp, int flags, struct proc *p)
mfs_doio(mfsp, bp);
wakeup((caddr_t)bp);
}
+ if (bp == (struct buf *)-1)
+ break;
/*
* If a non-ignored signal is received, try to unmount.
* If that fails, clear the signal (it has been "processed"),
diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c
index f9dd66574d3..317d4759f73 100644
--- a/sys/ufs/mfs/mfs_vnops.c
+++ b/sys/ufs/mfs/mfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfs_vnops.c,v 1.31 2007/12/06 21:49:37 otto Exp $ */
+/* $OpenBSD: mfs_vnops.c,v 1.32 2007/12/16 21:21:25 otto Exp $ */
/* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */
/*
@@ -216,13 +216,20 @@ mfs_close(void *v)
struct vnode *vp = ap->a_vp;
struct mfsnode *mfsp = VTOMFS(vp);
struct buf *bp;
- int error;
+ int error, s;
/*
* Finish any pending I/O requests.
*/
- while ((bp = mfsp->mfs_buflist) != NULL) {
+ while (1) {
+ s = splbio();
+ bp = mfsp->mfs_buflist;
+ if (bp == NULL) {
+ splx(s);
+ break;
+ }
mfsp->mfs_buflist = bp->b_actf;
+ splx(s);
mfs_doio(mfsp, bp);
wakeup((caddr_t)bp);
}