summaryrefslogtreecommitdiffstats
path: root/sys/dev/slice
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-07-22 19:37:02 +0000
committerjulian <julian@FreeBSD.org>1998-07-22 19:37:02 +0000
commitc77c9fb18bc18267d6e033b88f8e15625f3a274e (patch)
tree75679d4a4369f0066a744e56c53a26aa10d9df5f /sys/dev/slice
parentdbb03b6d18114b356c2e527bb2ada90a3cc5460f (diff)
downloadFreeBSD-src-c77c9fb18bc18267d6e033b88f8e15625f3a274e.zip
FreeBSD-src-c77c9fb18bc18267d6e033b88f8e15625f3a274e.tar.gz
Don't return an error if the magic number is not present.
Failing to probe is not an error, just a negative result.
Diffstat (limited to 'sys/dev/slice')
-rw-r--r--sys/dev/slice/mbr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/slice/mbr.c b/sys/dev/slice/mbr.c
index a7889eb..212505d 100644
--- a/sys/dev/slice/mbr.c
+++ b/sys/dev/slice/mbr.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mbr.c,v 1.7 1998/07/13 08:22:55 julian Exp $
+ * $Id: mbr.c,v 1.8 1998/07/20 04:12:39 julian Exp $
*/
#include <sys/param.h>
@@ -190,13 +190,16 @@ RR;
error = bp->b_error;
bp->b_flags |= B_INVAL | B_AGE;
brelse(bp);
+ if (bootverbose)
+ printf ("failed.. IO error ");
goto nope;
}
cp = bp->b_data;
if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) {
bp->b_flags |= B_INVAL | B_AGE;
brelse(bp);
- error = EINVAL;
+ if (bootverbose)
+ printf ("rejected.. bad magic ");
goto nope;
}
dp0 = (struct dos_partition *) (cp + DOSPARTOFF);
@@ -236,8 +239,6 @@ RR;
}
}
-
-
/*
* The first block of the dos code is marked like a valid MBR.
* Try to distinguish this case by doing a sanity check on the table.
@@ -248,18 +249,21 @@ RR;
*/
for (part = 0, dp = table; part < NDOSPART; part++, dp++) {
if (dp->dp_flag & 0x7f) {
- printf ("rejected.. bad flag ");
+ if (bootverbose)
+ printf ("rejected.. bad flag ");
goto nope;
}
if ((dp->dp_typ) && (dp->dp_size) && (dp->dp_start == 0)) {
- printf("rejected.. Slice includes MBR ");
+ if (bootverbose)
+ printf("rejected.. Slice includes MBR ");
goto nope;
}
if (dp->dp_flag == 0x80)
numactive++;
}
if (numactive > 1) {
- printf ("rejected.. multiple active ");
+ if (bootverbose)
+ printf ("rejected.. multiple active ");
goto nope;
}
/*-
@@ -308,6 +312,8 @@ RR;
* Be aware that this may queue up one (or more) IO requests
* for each subslice created.
*/
+ if (bootverbose)
+ printf("yep \n");
dp = dp0;
for (part = 0; part < NDOSPART; part++, dp++) {
int i;
@@ -414,6 +420,7 @@ printf(" part %d, start=%d, size=%d\n", part + 1, dp->dp_start, dp->dp_size);
}
return (0);
nope:
+ printf("nope\n");
mbr_revoke(pd);
return (error);
}
OpenPOWER on IntegriCloud