Module Name: src
Committed By: dholland
Date: Sun Aug 2 17:56:24 UTC 2015
Modified Files:
src/sbin/fsck_lfs: setup.c
Log Message:
Fix bug: for format version 1, the superblock "size" field is measured
in blocks instead of frags, so use lfs_blkstofrags to correct it.
This code was instead multiplying by the block size divided by
DEV_BSIZE to get the number of disk blocks rather than the number of
frags. (I gather that originally these were the same, but they're not
necessarily any more.)
To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sbin/fsck_lfs/setup.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_lfs/setup.c
diff -u src/sbin/fsck_lfs/setup.c:1.49 src/sbin/fsck_lfs/setup.c:1.50
--- src/sbin/fsck_lfs/setup.c:1.49 Tue Jul 28 05:09:34 2015
+++ src/sbin/fsck_lfs/setup.c Sun Aug 2 17:56:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.49 2015/07/28 05:09:34 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.50 2015/08/02 17:56:24 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -334,7 +334,7 @@ setup(const char *dev)
pwarn("lfs_inopb = %lu\n", (unsigned long) lfs_sb_getinopb(fs));
}
if (fs->lfs_version == 1)
- maxfsblock = lfs_sb_getsize(fs) * (lfs_sb_getbsize(fs) / dev_bsize);
+ maxfsblock = lfs_blkstofrags(fs, lfs_sb_getsize(fs));
else
maxfsblock = lfs_sb_getsize(fs);
maxfilesize = calcmaxfilesize(lfs_sb_getbshift(fs));