Source-Changes-HG archive

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

[src/trunk]: src/sbin/newfs_lfs Correct data checksum to take ifile indirect ...



details:   https://anonhg.NetBSD.org/src/rev/98e5fa926de2
branches:  trunk
changeset: 467892:98e5fa926de2
user:      perseant <perseant%NetBSD.org@localhost>
date:      Tue Mar 30 19:04:50 1999 +0000

description:
Correct data checksum to take ifile indirect block into account, if it exists

diffstat:

 sbin/newfs_lfs/lfs.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 32ce00afdcf0 -r 98e5fa926de2 sbin/newfs_lfs/lfs.c
--- a/sbin/newfs_lfs/lfs.c      Tue Mar 30 19:02:56 1999 +0000
+++ b/sbin/newfs_lfs/lfs.c      Tue Mar 30 19:04:50 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.c,v 1.2 1999/03/19 17:28:19 perseant Exp $ */
+/*     $NetBSD: lfs.c,v 1.3 1999/03/30 19:04:50 perseant Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)lfs.c      8.5 (Berkeley) 5/24/95";
 #else
-__RCSID("$NetBSD: lfs.c,v 1.2 1999/03/19 17:28:19 perseant Exp $");
+__RCSID("$NetBSD: lfs.c,v 1.3 1999/03/30 19:04:50 perseant Exp $");
 #endif
 #endif /* not lint */
 
@@ -457,6 +457,10 @@
 
        /* Now, write the segment */
 
+       /* Adjust blocks_used to take indirect block into account */
+       if(ifib)
+               ++blocks_used;
+
        /* Compute a checksum across all the data you're writing */
        dp = datasump = malloc (blocks_used * sizeof(u_long));
        *dp++ = ((u_long *)dpagep)[0];          /* inode block */
@@ -491,6 +495,7 @@
 
        /* XXX KS - write the single indirect block */
        if(ifib) {
+               *dp++ = ((u_long *)ifib)[0];
                put(fd, off, ifib, lfsp->lfs_bsize);
                off += lfsp->lfs_bsize;
        }



Home | Main Index | Thread Index | Old Index