Module Name:    src
Committed By:   bouyer
Date:           Mon Dec  2 18:46:52 UTC 2013

Modified Files:
        src/sbin/fsck_ffs: inode.c

Log Message:
Fix pasto in the !ufs2 case (use dp->dp1 and not of dp->dp2).
This would be a problem only when allocating a new data block and the
indir block is already allocated, which explains why automated tests didn't
find it.
Problem reported on tech-kern@ and fix tested by manu@.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sbin/fsck_ffs/inode.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_ffs/inode.c
diff -u src/sbin/fsck_ffs/inode.c:1.69 src/sbin/fsck_ffs/inode.c:1.70
--- src/sbin/fsck_ffs/inode.c:1.69	Sun Jun 23 22:03:34 2013
+++ src/sbin/fsck_ffs/inode.c	Mon Dec  2 18:46:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: inode.c,v 1.69 2013/06/23 22:03:34 dholland Exp $	*/
+/*	$NetBSD: inode.c,v 1.70 2013/12/02 18:46:52 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c	8.8 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.69 2013/06/23 22:03:34 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.70 2013/12/02 18:46:52 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -993,7 +993,7 @@ expandfile(union dinode *dp)
 			dp->dp1.di_ib[ilevel - 1] = iswap32(newblk);
 	} else {
 		ibp = getdatablk(is_ufs2 ? iswap64(dp->dp2.di_ib[ilevel - 1]) :
-		    iswap32(dp->dp2.di_ib[ilevel - 1]), sblock->fs_bsize);
+		    iswap32(dp->dp1.di_ib[ilevel - 1]), sblock->fs_bsize);
 	}
 	/* walk indirect blocks up to the data block */
 	for (; ilevel >0 ; ilevel--) {

Reply via email to