diff options
author | 2011-07-06 16:05:54 +0000 | |
---|---|---|
committer | 2011-07-06 16:05:54 +0000 | |
commit | 65cfac9b44c2a1bd6c76cb0a14fdaaf73395b6f5 (patch) | |
tree | 54dd2d980fe9c758cc4e06fbc4c1003ece6bfdae | |
parent | Actually make sr_detach() work. At this stage we never detach softraid(4), (diff) | |
download | wireguard-openbsd-65cfac9b44c2a1bd6c76cb0a14fdaaf73395b6f5.tar.xz wireguard-openbsd-65cfac9b44c2a1bd6c76cb0a14fdaaf73395b6f5.zip |
Ooops. Missed one 'readdoslabel() only' arch. Do the block <-> sector dance for
write label location here too.
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/disksubr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c index 483d0d931d1..7a876187013 100644 --- a/sys/arch/mvmeppc/mvmeppc/disksubr.c +++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.62 2011/04/16 03:21:15 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.63 2011/07/06 16:05:54 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -97,6 +97,7 @@ int writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) { int error = EIO, partoff = -1, cyl = 0; + int offset; struct disklabel *dlp; struct buf *bp = NULL; @@ -108,7 +109,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) goto done; /* Read it in, slap the new label in, and write it back out */ - bp->b_blkno = partoff + LABELSECTOR; + bp->b_blkno = DL_BLKTOSEC(lp, partoff+LABELSECTOR) * DL_BLKSPERSEC(lp); + offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET; bp->b_bcount = lp->d_secsize; CLR(bp->b_flags, B_READ | B_WRITE | B_DONE); SET(bp->b_flags, B_BUSY | B_READ | B_RAW); @@ -116,7 +118,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) if ((error = biowait(bp)) != 0) goto done; - dlp = (struct disklabel *)(bp->b_data + LABELOFFSET); + dlp = (struct disklabel *)(bp->b_data + offset); *dlp = *lp; CLR(bp->b_flags, B_READ | B_WRITE | B_DONE); SET(bp->b_flags, B_BUSY | B_WRITE | B_RAW); |