Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/ufs/lfs Pull-up of changes made to the trunk on Sun...



details:   https://anonhg.NetBSD.org/src/rev/caedf1bc0d62
branches:  netbsd-1-4
changeset: 468212:caedf1bc0d62
user:      perseant <perseant%NetBSD.org@localhost>
date:      Tue Apr 13 21:33:55 1999 +0000

description:
Pull-up of changes made to the trunk on Sunday [1.22->1.24], to wit:

Take out the `#ifdef USE_UFSHASH'; use ufs_hashlock to lock the inode free
list instead of free_lock.

Fix inode reporting in lfs_statfs (the meaning of f_files and f_ffree was
reversed).

Fix "lfs_ifind: dinode xxx not found" panic.  When inodes were freed, then
immediately reloaded, their dinodes were located in an inode block which
was not on disk at the advertized location, nor in the cache (although it
would be flushed to disk next segment write).  Fix this by using getblk()
instead of lfs_newbuf() for inode blocks.

Better checking for held inode locks in lfs_fastvget, for a number of
error conditions.  Also change the default setting of lfs_clean_vnhead to
0, which seems to make the locking problems go away (although this is
difficult to test as I can't reliably reproduce them).

Make sure that the wakeup occurs for vnodes that lfs_update might be
sleeping on (nodes which are not marked IN_MODIFIED/IN_CLEANING, but which
have dirty buffers), by marking them with the appropriate flag if
dirtybuffers were added while the write was in progress.

Fix block counting during file truncation, if not truncating to zero.

Disallow threshold-initiated cache flush when dirops are active.  Also,
make SET_ENDOP use lfs_check instead of inlining most of it.

Improve the debugging printfs in the cleaner syscalls (in particular, make
it obvious that they're coming from lfs).

Check the superblock version field, and refuse to mount the filesystem if
the version number is higher than we know about.  This allows, e.g.,
changes in the format of the ifile, segment size restrictions and
boundaries, etc., which would not affect existing fields in the
superblock, but which would drastically affect the filesystem, to be
smoothly integrated at a later date.

diffstat:

 sys/ufs/lfs/lfs_inode.c |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 9cc3b499f5b3 -r caedf1bc0d62 sys/ufs/lfs/lfs_inode.c
--- a/sys/ufs/lfs/lfs_inode.c   Tue Apr 13 21:33:54 1999 +0000
+++ b/sys/ufs/lfs/lfs_inode.c   Tue Apr 13 21:33:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_inode.c,v 1.22 1999/04/01 23:28:09 perseant Exp $  */
+/*     $NetBSD: lfs_inode.c,v 1.22.2.1 1999/04/13 21:33:55 perseant Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -141,6 +141,9 @@
         * for our inode completes, if we are called with LFS_SYNC set.
         */
        while((ap->a_waitfor & LFS_SYNC) && WRITEINPROG(vp)) {
+#ifdef DEBUG_LFS
+               printf("lfs_update: sleeping on inode %d\n",ip->i_number);
+#endif
                tsleep(vp, (PRIBIO+1), "lfs_update", 0);
        }
        mod = ip->i_flag & IN_MODIFIED;
@@ -405,6 +408,12 @@
        a_released = 0;
        i_released = 0;
        for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = bp->b_vnbufs.le_next) {
+
+               /* XXX KS - Don't miscount if we're not truncating to zero. */
+               if(length>0 && !(bp->b_lblkno >= 0 && bp->b_lblkno > lastblock)
+                  && !(bp->b_lblkno < 0 && bp->b_lblkno < -lastblock-NIADDR))
+                       continue;
+
                if (bp->b_flags & B_LOCKED) {
                        a_released += numfrags(fs, bp->b_bcount);
                        /*



Home | Main Index | Thread Index | Old Index