Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/dev/ata Pull up revision 1.278 (requested by mycrof...
details: https://anonhg.NetBSD.org/src/rev/c2bf6439d6af
branches: netbsd-2-0
changeset: 562173:c2bf6439d6af
user: tron <tron%NetBSD.org@localhost>
date: Fri Jul 23 13:32:11 2004 +0000
description:
Pull up revision 1.278 (requested by mycroft in ticket #704):
Fix an extremely obvious bug in the handling of the bad block list: the "max"
block was being set 512x further out than it should be, causing rather severe
escalation of the error.
diffstat:
sys/dev/ata/wd.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 8ccbbee9e2b8 -r c2bf6439d6af sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Fri Jul 23 12:55:11 2004 +0000
+++ b/sys/dev/ata/wd.c Fri Jul 23 13:32:11 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.274.2.3 2004/07/02 17:08:38 he Exp $ */
+/* $NetBSD: wd.c,v 1.274.2.4 2004/07/23 13:32:11 tron Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.274.2.3 2004/07/02 17:08:38 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.274.2.4 2004/07/23 13:32:11 tron Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@@ -536,7 +536,7 @@
*/
if (__predict_false(!SLIST_EMPTY(&wd->sc_bslist))) {
struct disk_badsectors *dbs;
- daddr_t maxblk = blkno + (bp->b_bcount / DEV_BSIZE) - 1;
+ daddr_t maxblk = blkno + (bp->b_bcount >> DEV_BSHIFT) - 1;
SLIST_FOREACH(dbs, &wd->sc_bslist, dbs_next)
if ((dbs->dbs_min <= blkno && blkno <= dbs->dbs_max) ||
@@ -778,7 +778,7 @@
dbs = malloc(sizeof *dbs, M_TEMP, M_WAITOK);
dbs->dbs_min = bp->b_rawblkno;
- dbs->dbs_max = dbs->dbs_min + bp->b_bcount - 1;
+ dbs->dbs_max = dbs->dbs_min + (bp->b_bcount >> DEV_BSHIFT) - 1;
microtime(&dbs->dbs_failedat);
SLIST_INSERT_HEAD(&wd->sc_bslist, dbs, dbs_next);
wd->sc_bscount++;
Home |
Main Index |
Thread Index |
Old Index