Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Correct free list tail pointer, when adding bloc...



details:   https://anonhg.NetBSD.org/src/rev/e8d400c6cc73
branches:  trunk
changeset: 521719:e8d400c6cc73
user:      perseant <perseant%NetBSD.org@localhost>
date:      Mon Feb 04 03:32:16 2002 +0000

description:
Correct free list tail pointer, when adding blocks of new inodes to v2
filesystems.  Should fix PR #14408.

diffstat:

 sys/ufs/lfs/lfs_alloc.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r 5e76d324efc6 -r e8d400c6cc73 sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c   Mon Feb 04 02:39:06 2002 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c   Mon Feb 04 03:32:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_alloc.c,v 1.54 2001/12/18 07:51:17 chs Exp $       */
+/*     $NetBSD: lfs_alloc.c,v 1.55 2002/02/04 03:32:16 perseant Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.54 2001/12/18 07:51:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.55 2002/02/04 03:32:16 perseant Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -248,7 +248,7 @@
                panic("inode 0 allocated [2]");
 #endif /* DIAGNOSTIC */
        max = i + fs->lfs_ifpb;
-       /* printf("extend ifile for ino %d--%d\n", i, max); */
+       /* printf("extend_ifile: new block ino %d--%d\n", i, max - 1); */
 
        if (fs->lfs_version == 1) {
                for (ifp_v1 = (IFILE_V1 *)bp->b_data; i < max; ++ifp_v1) {
@@ -267,6 +267,7 @@
                ifp--;
                ifp->if_nextfree = oldlast;
        }
+       LFS_PUT_TAILFREE(fs, cip, cbp, max - 1);
 
        (void) VOP_BWRITE(bp); /* Ifile */
        lfs_vunref(vp);
@@ -334,6 +335,7 @@
        if (ifp->if_daddr != LFS_UNUSED_DADDR)
                panic("lfs_valloc: inuse inode %d on the free list", new_ino);
        LFS_PUT_HEADFREE(fs, cip, cbp, ifp->if_nextfree);
+       /* printf("lfs_valloc: headfree %d -> %d\n", new_ino, ifp->if_nextfree); */
 
        new_gen = ifp->if_version; /* version was updated by vfree */
        brelse(bp);
@@ -547,6 +549,7 @@
                ifp->if_nextfree = ino;
                VOP_BWRITE(bp);
                LFS_PUT_TAILFREE(fs, cip, cbp, ino);
+               /* printf("lfs_vfree: tailfree %d -> %d\n", otail, ino); */
        }
 #ifdef DIAGNOSTIC
        if (ino == LFS_UNUSED_INUM) {



Home | Main Index | Thread Index | Old Index