Source-Changes-HG archive

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

[src/netbsd-1-4]: src/lib/libc/db/mpool Pull up revision 1.11 (requested by s...



details:   https://anonhg.NetBSD.org/src/rev/62d6ef114992
branches:  netbsd-1-4
changeset: 470026:62d6ef114992
user:      he <he%NetBSD.org@localhost>
date:      Sat Jan 15 16:23:15 2000 +0000

description:
Pull up revision 1.11 (requested by scw):
  After writing a page out to disk, run the page back through the
  user's input filter to ensure we don't end up with a cached copy
  of the page in the wrong byte-order for the host cpu.

  This fixes a fatal bug which bites when the DB 'lorder' is
  different to the cpu's, and a cached page is accessed soon after
  it was flushed to disk.

diffstat:

 lib/libc/db/mpool/mpool.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 8cc81d5942e0 -r 62d6ef114992 lib/libc/db/mpool/mpool.c
--- a/lib/libc/db/mpool/mpool.c Sat Jan 15 16:19:44 2000 +0000
+++ b/lib/libc/db/mpool/mpool.c Sat Jan 15 16:23:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpool.c,v 1.10 1998/12/09 12:42:51 christos Exp $      */
+/*     $NetBSD: mpool.c,v 1.10.2.1 2000/01/15 16:23:15 he Exp $        */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)mpool.c    8.5 (Berkeley) 7/26/94";
 #else
-__RCSID("$NetBSD: mpool.c,v 1.10 1998/12/09 12:42:51 christos Exp $");
+__RCSID("$NetBSD: mpool.c,v 1.10.2.1 2000/01/15 16:23:15 he Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -400,6 +400,15 @@
        if (pwrite(mp->fd, bp->page, (size_t)mp->pagesize, off) != (int)mp->pagesize)
                return (RET_ERROR);
 
+       /*
+        * Re-run through the input filter since this page may soon be
+        * accessed via the cache, and whatever the user's output filter
+        * did may screw things up if we don't let the input filter
+        * restore the in-core copy.
+        */
+       if (mp->pgin)
+               (mp->pgin)(mp->pgcookie, bp->pgno, bp->page);
+
        bp->flags &= ~MPOOL_DIRTY;
        return (RET_SUCCESS);
 }



Home | Main Index | Thread Index | Old Index