diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-12-22 03:02:49 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-12-22 03:02:49 +0000 |
commit | 7073660ccb208705ca4f7a9a904281226199b00e (patch) | |
tree | b5166ed14278f3fa73f97a39977acde1dcf93805 /sys | |
parent | f75269fefeabcb37f1d4afb80af03b86acc4cd87 (diff) |
'spoofonly' does not mean what I thought it meant. The whole point is
to read non-OpenBSD label information like MBRs and populate ('spoof')
the OpenBSD disk label appropriately. So avoiding an I/O when doing
'spoofonly' is to miss the whole point.
Backout all Sept. 26 and subsequent changes to disksubr.c files. The
original CD problem with I/O errors on blank media will be addressed
another way.
Should fix the ext3 vs amd64 problems discussed on misc@. Thanks to
steven@ for finally putting it terms that I understood.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/alpha/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/arm/arm/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/i386/i386/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 15 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/disksubr.c | 7 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/disksubr.c | 7 |
9 files changed, 13 insertions, 58 deletions
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c index 17aa0efc10f..91b0b6b2227 100644 --- a/sys/arch/alpha/alpha/disksubr.c +++ b/sys/arch/alpha/alpha/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.41 2005/09/27 23:56:10 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.42 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -370,11 +370,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c index 28d6bd5fda6..21839b95fff 100644 --- a/sys/arch/amd64/amd64/disksubr.c +++ b/sys/arch/amd64/amd64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.5 2005/12/13 00:18:19 jsg Exp $ */ +/* $OpenBSD: disksubr.c,v 1.6 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -122,11 +122,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/arm/arm/disksubr.c b/sys/arch/arm/arm/disksubr.c index c6db45a4c39..87d51d9fbba 100644 --- a/sys/arch/arm/arm/disksubr.c +++ b/sys/arch/arm/arm/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.5 2005/09/27 23:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.6 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -121,11 +121,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 82a5a52a21c..dda6a061762 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.19 2005/09/27 23:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.20 2005/12/22 03:02:48 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -386,11 +386,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c index 2705bd7ab69..829081e59b5 100644 --- a/sys/arch/hppa64/hppa64/disksubr.c +++ b/sys/arch/hppa64/hppa64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.2 2005/09/27 23:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.3 2005/12/22 03:02:48 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -382,11 +382,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c index 9cda73d3c34..3926fb03fcc 100644 --- a/sys/arch/i386/i386/disksubr.c +++ b/sys/arch/i386/i386/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.46 2005/09/27 23:56:12 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.47 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -122,11 +122,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index f5f0cd6f88e..490d6f8cc0b 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.12 2005/09/29 23:02:17 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.13 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -104,10 +104,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - /* don't read the on-disk label if we are in spoofed-only mode */ - if (spoofonly) - goto done; - /* DPME (HFS) disklabel */ bp->b_blkno = 1; @@ -164,6 +160,10 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), } lp->d_npartitions = MAXPARTITIONS; + /* don't read the on-disk label if we are in spoofed-only mode */ + if (spoofonly) + goto done; + /* next, dig out disk label */ bp->b_blkno = hfspartoff; bp->b_cylin = hfspartoff/lp->d_secpercyl; /* XXX */ @@ -201,11 +201,6 @@ hfs_done: if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/mips64/mips64/disksubr.c b/sys/arch/mips64/mips64/disksubr.c index caf266103a1..9399d596e5e 100644 --- a/sys/arch/mips64/mips64/disksubr.c +++ b/sys/arch/mips64/mips64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.8 2005/09/27 23:56:12 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.9 2005/12/22 03:02:48 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -402,11 +402,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c index a67999f6217..aa7478f3828 100644 --- a/sys/arch/mvmeppc/mvmeppc/disksubr.c +++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.8 2005/09/27 23:56:12 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.9 2005/12/22 03:02:48 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -123,11 +123,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) if (part_blkno < extoff) part_blkno = extoff; - if (spoofonly) { - bzero(dp, NDOSPART * sizeof(*dp)); - goto donot; - } - /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; |