Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Fix "lfs_ifind: dinode xxx not found" panic. Wh...



details:   https://anonhg.NetBSD.org/src/rev/6b67c2931db1
branches:  trunk
changeset: 471801:6b67c2931db1
user:      perseant <perseant%NetBSD.org@localhost>
date:      Mon Apr 12 00:04:21 1999 +0000

description:
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.

diffstat:

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

diffs (40 lines):

diff -r 105a3667e1f8 -r 6b67c2931db1 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Sun Apr 11 23:58:17 1999 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Mon Apr 12 00:04:21 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.23 1999/03/30 16:11:43 perseant Exp $        */
+/*     $NetBSD: lfs_segment.c,v 1.24 1999/04/12 00:04:21 perseant Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -634,6 +634,7 @@
        int error, i, ndx;
        int redo_ifile = 0;
        struct timespec ts;
+       int gotblk=0;
        
        if (!(ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_CLEANING)))
                return(0);
@@ -649,8 +650,9 @@
                daddr = fs->lfs_offset;
                fs->lfs_offset += fsbtodb(fs, 1);
                sp->ibp = *sp->cbpp++ =
-                       lfs_newbuf(VTOI(fs->lfs_ivnode)->i_devvp, daddr,
-                                  fs->lfs_bsize);
+                       getblk(VTOI(fs->lfs_ivnode)->i_devvp, daddr, fs->lfs_bsize, 0, 0);
+               gotblk++;
+
                /* Zero out inode numbers */
                for (i = 0; i < INOPB(fs); ++i)
                        ((struct dinode *)sp->ibp->b_data)[i].di_inumber = 0;
@@ -679,6 +681,10 @@
        bp = sp->ibp;
        ((struct dinode *)bp->b_data)[sp->ninodes % INOPB(fs)] =
                ip->i_din.ffs_din;
+       if(gotblk) {
+               bp->b_flags |= B_LOCKED;
+               brelse(bp);
+       }
        
        /* Increment inode count in segment summary block. */
        ++((SEGSUM *)(sp->segsum))->ss_ninos;



Home | Main Index | Thread Index | Old Index