Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/ufs/ffs pull up version 1.5:



details:   https://anonhg.NetBSD.org/src/rev/5b3a9ac86274
branches:  netbsd-1-5
changeset: 489134:5b3a9ac86274
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Aug 17 18:50:53 2000 +0000

description:
pull up version 1.5:
      Do not call MALLOC with M_WAITOK while holding the "lock". Thanks to
      Ethan Solomita for the reminder.

      Mark the parent vnode lock as recursive while flushing pagedeps. XXX.
      Should fix kern/10564.

diffstat:

 sys/ufs/ffs/ffs_softdep.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r 8d992dfbb583 -r 5b3a9ac86274 sys/ufs/ffs/ffs_softdep.c
--- a/sys/ufs/ffs/ffs_softdep.c Thu Aug 17 18:49:22 2000 +0000
+++ b/sys/ufs/ffs/ffs_softdep.c Thu Aug 17 18:50:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_softdep.c,v 1.2.2.3 2000/06/29 23:44:33 thorpej Exp $      */
+/*     $NetBSD: ffs_softdep.c,v 1.2.2.4 2000/08/17 18:50:53 fvdl Exp $ */
 
 /*
  * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@@ -2756,6 +2756,7 @@
 {
        struct worklist *wk, *nextwk;
        struct indirdep *indirdep;
+       caddr_t saveddata;
 
        /*
         * We only care about write operations. There should never
@@ -2800,11 +2801,12 @@
                        /*
                         * Replace up-to-date version with safe version.
                         */
+                       MALLOC(saveddata, caddr_t, bp->b_bcount, M_INDIRDEP,
+                           M_WAITOK);
                        ACQUIRE_LOCK(&lk);
                        indirdep->ir_state &= ~ATTACHED;
                        indirdep->ir_state |= UNDONE;
-                       MALLOC(indirdep->ir_saveddata, caddr_t, bp->b_bcount,
-                              M_INDIRDEP, M_WAITOK);
+                       indirdep->ir_saveddata = saveddata;
                        bcopy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount);
                        bcopy(indirdep->ir_savebp->b_data, bp->b_data,
                              bp->b_bcount);
@@ -4232,6 +4234,7 @@
        int gotit, error = 0;
        struct buf *bp;
        ino_t inum;
+       u_int ipflag;
 
        ump = VFSTOUFS(mp);
        while ((dap = LIST_FIRST(diraddhdp)) != NULL) {
@@ -4273,6 +4276,7 @@
                inum = dap->da_newinum;
                if (dap->da_state & MKDIR_BODY) {
                        FREE_LOCK(&lk);
+                       ipflag = vn_setrecurse(pvp);    /* XXX */
                        if ((error = VFS_VGET(mp, inum, &vp)) != 0)
                                break;
                        if ((error = VOP_FSYNC(vp, p->p_ucred, 0, p)) ||
@@ -4282,6 +4286,7 @@
                        }
                        drain_output(vp, 0);
                        vput(vp);
+                       vn_restorerecurse(pvp, ipflag);
                        ACQUIRE_LOCK(&lk);
                        /*
                         * If that cleared dependencies, go on to next.



Home | Main Index | Thread Index | Old Index