Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/newfs_v7fs fix freeblock count bug.
details: https://anonhg.NetBSD.org/src/rev/854adfcda27c
branches: trunk
changeset: 767177:854adfcda27c
user: uch <uch%NetBSD.org@localhost>
date: Sun Jul 10 12:14:01 2011 +0000
description:
fix freeblock count bug.
diffstat:
sbin/newfs_v7fs/main.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r b64cdca1586c -r 854adfcda27c sbin/newfs_v7fs/main.c
--- a/sbin/newfs_v7fs/main.c Sun Jul 10 12:11:49 2011 +0000
+++ b/sbin/newfs_v7fs/main.c Sun Jul 10 12:14:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.1 2011/06/27 11:52:58 uch Exp $ */
+/* $NetBSD: main.c,v 1.2 2011/07/10 12:14:01 uch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.1 2011/06/27 11:52:58 uch Exp $");
+__RCSID("$NetBSD: main.c,v 1.2 2011/07/10 12:14:01 uch Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -146,11 +146,11 @@
{
VPRINTF("\nlast freeblock #%d\n",
(*val32)(fb->freeblock[i + 1]));
- fb->nfreeblock = (*val16)(k);
memmove(fb->freeblock + 1, fb->freeblock + i + 1, k *
sizeof(v7fs_daddr_t));
fb->freeblock[0] = 0; /* Terminate link; */
+ fb->nfreeblock = (*val16)(k + 1);
VPRINTF("last freeblock contains #%d\n",
(*val16)(fb->nfreeblock));
fs->io.write(fs->io.cookie, buf, listblk);
@@ -211,7 +211,8 @@
for (i = V7FS_MAX_FREEBLOCK - 1, j = sb->datablock_start_sector; i >= 0;
i--, j++)
sb->freeblock[i] = j;
- sb->total_freeblock = volume_size - sb->datablock_start_sector - 1;
+
+ sb->total_freeblock = volume_size - sb->datablock_start_sector;
/* Write superblock. */
sb->modified = 1;
Home |
Main Index |
Thread Index |
Old Index