summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2006-06-21 10:01:11 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2006-06-21 10:01:11 +0000
commit834b1d43c7a47e7cb72960feacca338f86a433ef (patch)
treeed8940553843b7d0d2f25ca5f31e3b5255a895b4
parent820ea82d234beda35e76a41e6256e120cc1d0c7b (diff)
propagate the wait flag from fsync down to softdep_fsync_mountdev()
and do not perform synchronous sync there is no wait requested by skipping the drain_output() call. this fixes a problem where update kthread would sleep forever on some vnode since work is created faster than it can be flushed. pedro@ ok; tested by many
-rw-r--r--sys/ufs/ffs/ffs_extern.h4
-rw-r--r--sys/ufs/ffs/ffs_softdep.c8
-rw-r--r--sys/ufs/ffs/ffs_softdep_stub.c4
-rw-r--r--sys/ufs/ffs/ffs_vnops.c4
4 files changed, 11 insertions, 9 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index b1f36f21d71..767aaabe2ab 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_extern.h,v 1.28 2006/03/31 12:19:42 pedro Exp $ */
+/* $OpenBSD: ffs_extern.h,v 1.29 2006/06/21 10:01:10 mickey Exp $ */
/* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */
/*
@@ -183,7 +183,7 @@ void softdep_setup_allocindir_meta(struct buf *, struct inode *,
struct buf *, int, daddr_t);
void softdep_setup_allocindir_page(struct inode *, ufs_lbn_t,
struct buf *, int, daddr_t, daddr_t, struct buf *);
-void softdep_fsync_mountdev(struct vnode *);
+void softdep_fsync_mountdev(struct vnode *, int);
int softdep_sync_metadata(struct vop_fsync_args *);
int softdep_fsync(struct vnode *);
__END_DECLS
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index cd3aba6dd66..ef56c480cb7 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.69 2006/06/07 10:51:43 mickey Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.70 2006/06/21 10:01:10 mickey Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -4664,8 +4664,9 @@ softdep_fsync(vp)
* the number of dependencies that will have to be rolled back.
*/
void
-softdep_fsync_mountdev(vp)
+softdep_fsync_mountdev(vp, waitfor)
struct vnode *vp;
+ int waitfor;
{
struct buf *bp, *nbp;
struct worklist *wk;
@@ -4705,7 +4706,8 @@ softdep_fsync_mountdev(vp)
*/
nbp = LIST_FIRST(&vp->v_dirtyblkhd);
}
- drain_output(vp, 1);
+ if (waitfor == MNT_WAIT)
+ drain_output(vp, 1);
FREE_LOCK(&lk);
}
diff --git a/sys/ufs/ffs/ffs_softdep_stub.c b/sys/ufs/ffs/ffs_softdep_stub.c
index 7db07f7ef43..6af63587f45 100644
--- a/sys/ufs/ffs/ffs_softdep_stub.c
+++ b/sys/ufs/ffs/ffs_softdep_stub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep_stub.c,v 1.13 2006/06/19 22:52:23 miod Exp $ */
+/* $OpenBSD: ffs_softdep_stub.c,v 1.14 2006/06/21 10:01:10 mickey Exp $ */
/*
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@@ -162,7 +162,7 @@ softdep_update_inodeblock(struct inode *ip, struct buf *bp, int waitfor)
#endif
void
-softdep_fsync_mountdev(struct vnode *vp)
+softdep_fsync_mountdev(struct vnode *vp, int waitfor)
{
return;
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 42e38662ef5..ba902151888 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.37 2006/03/31 12:33:33 pedro Exp $ */
+/* $OpenBSD: ffs_vnops.c,v 1.38 2006/06/21 10:01:10 mickey Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */
/*
@@ -183,7 +183,7 @@ ffs_fsync(void *v)
if (vp->v_type == VBLK &&
vp->v_specmountpoint != NULL &&
(vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP))
- softdep_fsync_mountdev(vp);
+ softdep_fsync_mountdev(vp, ap->a_waitfor);
/*
* Flush all dirty buffers associated with a vnode.