summaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2017-12-13 10:24:31 +0000
committerpgoyette <pgoyette@NetBSD.org>2017-12-13 10:24:31 +0000
commit7edfe5a1e4f4046e8824e05cf7cd62c2babc85fb (patch)
tree8a26f41a69bdb542cc3d565626099d49a5e1e4c2 /sys/dev/ata
parent8e24ba6f8ff2102922862280f3022172ca500d92 (diff)
Fix build for WD_SOFTBADSECT option. PR kern/52814
XXX No clue if this option actually works. This fix just makes it XXX compile without error.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/wd.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 50c72c22c13..bf766c4b5d5 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.436 2017/11/07 04:09:08 mlelstv Exp $ */
+/* $NetBSD: wd.c,v 1.437 2017/12/13 10:24:31 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.436 2017/11/07 04:09:08 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.437 2017/12/13 10:24:31 pgoyette Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -535,12 +535,12 @@ wddetach(device_t self, int flags)
#ifdef WD_SOFTBADSECT
/* Clean out the bad sector list */
- while (!SLIST_EMPTY(&sc->sc_bslist)) {
- void *head = SLIST_FIRST(&sc->sc_bslist);
- SLIST_REMOVE_HEAD(&sc->sc_bslist, dbs_next);
+ while (!SLIST_EMPTY(&wd->sc_bslist)) {
+ void *head = SLIST_FIRST(&wd->sc_bslist);
+ SLIST_REMOVE_HEAD(&wd->sc_bslist, dbs_next);
free(head, M_TEMP);
}
- sc->sc_bscount = 0;
+ wd->sc_bscount = 0;
#endif
pmf_device_deregister(self);
@@ -586,11 +586,13 @@ wdstrategy(struct buf *bp)
*/
if (__predict_false(!SLIST_EMPTY(&wd->sc_bslist))) {
struct disk_badsectors *dbs;
- daddr_t maxblk = blkno + (bp->b_bcount / wd->sc_blksize) - 1;
+ daddr_t maxblk = bp->b_rawblkno +
+ (bp->b_bcount / wd->sc_blksize) - 1;
mutex_enter(&wd->sc_lock);
SLIST_FOREACH(dbs, &wd->sc_bslist, dbs_next)
- if ((dbs->dbs_min <= blkno && blkno <= dbs->dbs_max) ||
+ if ((dbs->dbs_min <= bp->b_rawblkno &&
+ bp->b_rawblkno <= dbs->dbs_max) ||
(dbs->dbs_min <= maxblk && maxblk <= dbs->dbs_max)){
mutex_exit(&wd->sc_lock);
goto err;