Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_lfs Correct fragment extension calculation in pass...



details:   https://anonhg.NetBSD.org/src/rev/a76ff65a6576
branches:  trunk
changeset: 772478:a76ff65a6576
user:      perseant <perseant%NetBSD.org@localhost>
date:      Thu Jan 05 16:18:00 2012 +0000

description:
Correct fragment extension calculation in pass6, to avoid putting
negative block counts on inodes during roll-forward.

diffstat:

 sbin/fsck_lfs/pass6.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d0e294d53b14 -r a76ff65a6576 sbin/fsck_lfs/pass6.c
--- a/sbin/fsck_lfs/pass6.c     Thu Jan 05 15:19:52 2012 +0000
+++ b/sbin/fsck_lfs/pass6.c     Thu Jan 05 16:18:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.23 2010/02/16 23:20:30 mlelstv Exp $    */
+/* $NetBSD: pass6.c,v 1.24 2012/01/05 16:18:00 perseant Exp $   */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@
                        ip->i_ffs1_blocks += frags;
                else {
                        /* possible fragment truncation or extension */
-                       ofrags = ip->i_lfs_fragsize[lbn];
+                       ofrags = numfrags(fs, ip->i_lfs_fragsize[lbn]);
                        ip->i_ffs1_blocks += (frags - ofrags);
                }
                ip->i_ffs1_db[lbn] = ndaddr;



Home | Main Index | Thread Index | Old Index