summaryrefslogtreecommitdiff
path: root/sys/arch/luna88k
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-12 20:57:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-12 20:57:44 +0000
commitd92a22088820bed9b2ad499b3fb0bf27bc9f8223 (patch)
tree23eefe8eebbc59fe8751ac9fee2b2e2dcfc20830 /sys/arch/luna88k
parentbb9f20de9237688ceb64944e9fdca9bd454679c0 (diff)
all disksubr.c did their b_flags manipulation differently (and wrong).
correct and unify; ok thib miod
Diffstat (limited to 'sys/arch/luna88k')
-rw-r--r--sys/arch/luna88k/luna88k/disksubr.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/arch/luna88k/luna88k/disksubr.c b/sys/arch/luna88k/luna88k/disksubr.c
index 431af300d22..41c35069ea1 100644
--- a/sys/arch/luna88k/luna88k/disksubr.c
+++ b/sys/arch/luna88k/luna88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.24 2007/06/09 23:06:46 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.25 2007/06/12 20:57:42 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2002/02/19 17:09:44 wiz Exp $ */
/*
@@ -202,7 +202,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
done:
if (bp) {
- bp->b_flags = B_INVAL | B_AGE | B_READ;
+ bp->b_flags |= B_INVAL;
brelse(bp);
}
disklabeltokernlabel(lp);
@@ -220,7 +220,7 @@ int
writedisklabel(dev_t dev, void (*strat)(struct buf *),
struct disklabel *lp, struct cpu_disklabel *clp)
{
- struct buf *bp;
+ struct buf *bp = NULL;
struct disklabel *dlp;
int error;
@@ -230,7 +230,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *),
error = disklabel_bsd_to_om(lp, clp->cd_block);
if (error)
- return (error);
+ goto done;
/* Get a buffer and copy the new label into it. */
bp = geteblk((int)lp->d_secsize);
@@ -241,11 +241,15 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *),
bp->b_blkno = LABELSECTOR;
bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
- bp->b_flags = B_WRITE;
+ bp->b_flags = B_BUSY | B_WRITE;
(*strat)(bp);
error = biowait(bp);
- brelse(bp);
+done:
+ if (bp) {
+ bp->b_flags |= B_INVAL;
+ brelse(bp);
+ }
return (error);
}