Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern fix two bugs reported by Ryo Shimizu:
details: https://anonhg.NetBSD.org/src/rev/83d1d02ff400
branches: trunk
changeset: 757661:83d1d02ff400
user: drochner <drochner%NetBSD.org@localhost>
date: Fri Sep 10 10:14:55 2010 +0000
description:
fix two bugs reported by Ryo Shimizu:
-wrong initialization reported in a followup to PR bin/43336
(looks harmless because it applies to zero-initialized memory, so
LIST_INIT() is a no-op)
-wrong loop count in reply misses a hash bucket (PR kern/43827)
(this was introduced by a post-netbsd-5 change, so it isn't related
to the PR above)
diffstat:
sys/kern/vfs_wapbl.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 56c68aab5a3a -r 83d1d02ff400 sys/kern/vfs_wapbl.c
--- a/sys/kern/vfs_wapbl.c Fri Sep 10 08:58:36 2010 +0000
+++ b/sys/kern/vfs_wapbl.c Fri Sep 10 10:14:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_wapbl.c,v 1.36 2010/04/21 19:50:57 pooka Exp $ */
+/* $NetBSD: vfs_wapbl.c,v 1.37 2010/09/10 10:14:55 drochner Exp $ */
/*-
* Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#define WAPBL_INTERNAL
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.36 2010/04/21 19:50:57 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.37 2010/09/10 10:14:55 drochner Exp $");
#include <sys/param.h>
#include <sys/bitops.h>
@@ -2095,7 +2095,7 @@
for (hashsize = 1; hashsize < size; hashsize <<= 1)
continue;
wr->wr_blkhash = wapbl_malloc(hashsize * sizeof(*wr->wr_blkhash));
- for (i = 0; i < wr->wr_blkhashmask; i++)
+ for (i = 0; i < hashsize; i++)
LIST_INIT(&wr->wr_blkhash[i]);
wr->wr_blkhashmask = hashsize - 1;
}
@@ -2648,7 +2648,7 @@
scratch = wapbl_malloc(MAXBSIZE);
- for (i = 0; i < wr->wr_blkhashmask; ++i) {
+ for (i = 0; i <= wr->wr_blkhashmask; ++i) {
LIST_FOREACH(wb, &wr->wr_blkhash[i], wb_hash) {
off = wb->wb_off;
error = wapbl_circ_read(wr, scratch, fsblklen, &off);
Home |
Main Index |
Thread Index |
Old Index