diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-02-24 18:25:51 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-02-24 18:25:51 +0000 |
commit | 726e00973f65caf27e19150b510b31ceb32f8f05 (patch) | |
tree | 8195e934e856603065db56552a79ce91ea1829bd /sys/arch | |
parent | 62de202beb78758cb58d6c99fb289a654142f1f5 (diff) |
Restore validity checks for the disklabels read from disk. They
were suppressed in 2011 to address a problem that has since been
solved in a more permanent way. Without the validity check proper
disklabel discovery relied on a particular I/O failure, and the I/O
failure was 'solved' by the introduction of readdisksector().
Fixes problem reading CDROM disklabels discovered by mlarkin@ while
trying to install hppa.
Compile check/typo discovery and ok deraadt@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 12 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/disksubr.c | 12 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 15 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/disksubr.c | 13 |
4 files changed, 12 insertions, 40 deletions
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 31eef20939a..964ea1e1c11 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.87 2015/09/28 21:52:28 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.88 2016/02/24 18:25:50 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -212,15 +212,7 @@ finished: if (error) goto done; - /* - * Do OpenBSD disklabel validation/adjustment. - * - * N.B: No matter what the bits are on the disk, we now have the - * OpenBSD disklabel for this lif disk. DO NOT proceed to - * readdoslabel(), iso_spooflabel(), etc. - */ - checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); - error = 0; + error = checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); done: return (error); diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c index 8fc11d669f5..b2142af9ae8 100644 --- a/sys/arch/hppa64/hppa64/disksubr.c +++ b/sys/arch/hppa64/hppa64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.73 2015/09/28 21:52:28 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.74 2016/02/24 18:25:50 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -212,15 +212,7 @@ finished: if (error) goto done; - /* - * Do OpenBSD disklabel validation/adjustment. - * - * N.B: No matter what the bits are on the disk, we now have the - * OpenBSD disklabel for this lif disk. DO NOT proceed to - * readdoslabel(), iso_spooflabel(), etc. - */ - checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); - error = 0; + error = checkdisklabel(bp->b_data, lp, openbsdstart, DL_GETDSIZE(lp)); done: return (error); diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 3ea7f60156e..afe6c630109 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.80 2015/09/28 21:52:28 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.81 2016/02/24 18:25:50 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -172,15 +172,10 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), if (error) return (error); - /* - * Do OpenBSD disklabel validation/adjustment. - * - * N.B: No matter what the bits are on the disk, we now have the - * disklabel for this dpme disk. DO NOT proceed to readdoslabel(), - * iso_spooflabel(), * etc. - */ - checkdisklabel(bp->b_data + LABELOFFSET, lp, hfspartoff, hfspartend); - return (0); + error = checkdisklabel(bp->b_data + LABELOFFSET, lp, hfspartoff, + hfspartend); + + return (error); } /* diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c index 665940fb1f5..6761e383ca0 100644 --- a/sys/arch/sgi/sgi/disksubr.c +++ b/sys/arch/sgi/sgi/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.31 2015/09/28 15:17:08 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.32 2016/02/24 18:25:50 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -193,15 +193,8 @@ finished: return (error); offset = DL_BLKOFFSET(lp, fsoffs + LABELSECTOR) + LABELOFFSET; - /* - * Do OpenBSD disklabel validation/adjustment. - * - * N.B: No matter what the bits are on the disk, we now have the - * OpenBSD disklabel for this sgi disk. DO NOT proceed to - * readdoslabel(), iso_spooflabel(), etc. - */ - checkdisklabel(bp->b_data + offset, lp, fsoffs, fsend); - return (0); + error = checkdisklabel(bp->b_data + offset, lp, fsoffs, fsend); + return (error); } /* |