Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs bring in the change from FreeBSD's rev. 1.107 of...



details:   https://anonhg.NetBSD.org/src/rev/7a3b65c5dfc4
branches:  trunk
changeset: 522044:7a3b65c5dfc4
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Feb 10 18:06:03 2002 +0000

description:
bring in the change from FreeBSD's rev. 1.107 of this file:

  date: 2002/02/07 00:54:32;  author: mckusick;  state: Exp;  lines: +10 -7
  Occationally deleted files would hang around for hours or days
  without being reclaimed. This bug was introduced in revision 1.95
  dealing with filenames placed in newly allocated directory blocks,
  thus is not present in 4.X systems. The bug is triggered when a
  new entry is made in a directory after the data block containing
  the original new entry has been written, but before the inode
  that references the data block has been written.

  Submitted by:   Bill Fenner <fenner%research.att.com@localhost>

This should fix NetBSD PR 15531.

diffstat:

 sys/ufs/ffs/ffs_softdep.c |  21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diffs (57 lines):

diff -r 2906a30279df -r 7a3b65c5dfc4 sys/ufs/ffs/ffs_softdep.c
--- a/sys/ufs/ffs/ffs_softdep.c Sun Feb 10 17:38:24 2002 +0000
+++ b/sys/ufs/ffs/ffs_softdep.c Sun Feb 10 18:06:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_softdep.c,v 1.26 2002/01/18 00:30:03 enami Exp $   */
+/*     $NetBSD: ffs_softdep.c,v 1.27 2002/02/10 18:06:03 chs Exp $     */
 
 /*
  * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.26 2002/01/18 00:30:03 enami Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.27 2002/02/10 18:06:03 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -848,7 +848,8 @@
 static struct sema pagedep_in_progress;
 
 /*
- * Look up a pagedep. Return 1 if found, 0 if not found.
+ * Look up a pagedep. Return 1 if found, 0 if not found or found
+ * when asked to allocate but not associated with any buffer.
  * If not found, allocate if DEPALLOC flag is passed.
  * Found or allocated entry is returned in pagedeppp.
  * This routine must be called with splbio interrupts blocked.
@@ -880,6 +881,9 @@
        }
        if (pagedep) {
                *pagedeppp = pagedep;
+               if ((flags & DEPALLOC) != 0 &&
+                   (pagedep->pd_state & ONWORKLIST) == 0)
+                       return (0);
                return (1);
        }
        if ((flags & DEPALLOC) == 0) {
@@ -4042,13 +4046,12 @@
                return (1);
        }
        /*
-        * If no dependencies remain and we are not waiting for a
-        * new directory block to be claimed by its inode, then the
-        * pagedep will be freed. Otherwise it will remain to track
-        * any new entries on the page in case they are fsync'ed.
+        * If we are not waiting for a new directory block to be
+        * claimed by its inode, then the pagedep will be freed.
+        * Otherwise it will remain to track any new entries on
+        * the page in case they are fsync'ed.
         */
-       if (LIST_FIRST(&pagedep->pd_pendinghd) == 0 &&
-           (pagedep->pd_state & NEWBLOCK) == 0) {
+       if ((pagedep->pd_state & NEWBLOCK) == 0) {
                LIST_REMOVE(pagedep, pd_hash);
                WORKITEM_FREE(pagedep, D_PAGEDEP);
        }



Home | Main Index | Thread Index | Old Index