summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-07-06 16:36:53 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-07-06 16:36:53 +0000
commitb7c43f425ad8d34a081763d2f83bb47debcd9d60 (patch)
treeda167c5a9c98016747c73a5f1b6edb761d931be4 /sys/kern
parent39dcfdf1283858bdcef969441b7e2f2f6438277f (diff)
On several archs (e.g. hppa, sgi, macppc) readdoslabel() is called after an attempt to
read a native label fails. Reset B_ERROR/b_error on buf to ensure any i/o failure on that first attempt is forgiven. A la the dkcsum() fix to recover from a disk error.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 9c41426adc4..f8ef8355de4 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.129 2011/07/06 04:49:36 matthew Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.130 2011/07/06 16:36:52 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -412,7 +412,8 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *),
bp->b_blkno = DL_BLKTOSEC(lp, part_blkno) * DL_BLKSPERSEC(lp);
offset = DL_BLKOFFSET(lp, part_blkno) + DOSPARTOFF;
bp->b_bcount = lp->d_secsize;
- CLR(bp->b_flags, B_READ | B_WRITE | B_DONE);
+ bp->b_error = 0; /* B_ERROR and b_error may have stale data. */
+ CLR(bp->b_flags, B_READ | B_WRITE | B_DONE | B_ERROR);
SET(bp->b_flags, B_BUSY | B_READ | B_RAW);
(*strat)(bp);
error = biowait(bp);