Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ufs work around a problem with sync writes vs. softd...



details:   https://anonhg.NetBSD.org/src/rev/451260852bbe
branches:  trunk
changeset: 507586:451260852bbe
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Mar 26 06:47:34 2001 +0000

description:
work around a problem with sync writes vs. softdeps.

diffstat:

 sys/ufs/ufs/ufs_readwrite.c |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 430d0952b68a -r 451260852bbe sys/ufs/ufs/ufs_readwrite.c
--- a/sys/ufs/ufs/ufs_readwrite.c       Mon Mar 26 06:11:46 2001 +0000
+++ b/sys/ufs/ufs/ufs_readwrite.c       Mon Mar 26 06:47:34 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_readwrite.c,v 1.30 2001/02/27 04:37:47 chs Exp $   */
+/*     $NetBSD: ufs_readwrite.c,v 1.31 2001/03/26 06:47:34 chs Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -300,9 +300,27 @@
 
                if (ioflag & IO_SYNC) {
                        simple_lock(&vp->v_uvm.u_obj.vmobjlock);
+#if 1
+                       /*
+                        * XXX 
+                        * flush whole blocks in case there are deps.
+                        * otherwise we can dirty and flush part of
+                        * a block multiple times and the softdep code
+                        * will get confused.  fixing this the right way
+                        * is complicated so we'll work around it for now.
+                        */
+
+                       rv = vp->v_uvm.u_obj.pgops->pgo_flush(
+                           &vp->v_uvm.u_obj,
+                           oldoff & ~(fs->fs_bsize - 1),
+                           (oldoff + bytelen + fs->fs_bsize - 1) &
+                           ~(fs->fs_bsize - 1),
+                           PGO_CLEANIT|PGO_SYNCIO);
+#else
                        rv = vp->v_uvm.u_obj.pgops->pgo_flush(
                            &vp->v_uvm.u_obj, oldoff, oldoff + bytelen,
                            PGO_CLEANIT|PGO_SYNCIO);
+#endif
                        simple_unlock(&vp->v_uvm.u_obj.vmobjlock);
                } else if (oldoff >> 16 != uio->uio_offset >> 16) {
                        simple_lock(&vp->v_uvm.u_obj.vmobjlock);



Home | Main Index | Thread Index | Old Index