diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-13 16:28:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-13 16:28:24 +0000 |
commit | e80071386cf16b308c7c8804c91d8ec2fc48c16e (patch) | |
tree | af90f623382d5362d8d4eb3ff156b588c6396e92 /sys/arch | |
parent | 2226a0718c755a3f253d15c56d2c318de8596669 (diff) |
The bounds was not always being properly updated
ok miod
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 63dfc2e981d..8e938218694 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.63 2009/06/05 00:41:12 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.64 2009/06/13 16:28:23 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -106,7 +106,7 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, int *partoffp, int spoofonly) { int i, part_cnt, n, hfspartoff = -1; - u_int64_t hfspartend; + u_int64_t hfspartend = DL_GETDSIZE(lp); struct part_map_entry *part; /* First check for a DPME (HFS) disklabel */ @@ -144,6 +144,9 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), if (strcmp(part->pmPartType, PART_TYPE_OPENBSD) == 0) { hfspartoff = part->pmPyPartStart - LABELSECTOR; hfspartend = hfspartoff + part->pmPartBlkCnt; + DL_SETBSTART(lp, hfspartoff); + DL_SETBEND(lp, hfspartend < DL_GETDSIZE(lp) ? hfspartend : + DL_GETDSIZE(lp)); if (partoffp) { *partoffp = hfspartoff; return (NULL); @@ -163,9 +166,6 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), n++; } - DL_SETBSTART(lp, hfspartoff); - DL_SETBEND(lp, hfspartend < DL_GETDSIZE(lp) ? hfspartend : - DL_GETDSIZE(lp)); } if (hfspartoff == -1) @@ -182,6 +182,8 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), if (biowait(bp)) return("disk label I/O error"); + if (hfspartoff == -1) + hfspartoff = 0; return checkdisklabel(bp->b_data + LABELOFFSET, lp, hfspartoff, hfspartend); } |