Yet more b_flags fixes. The previous ones broke the clearing of B_DONE

and B_READ before writing.  This was was fatal.  They also broke the
clearing of B_INVAL before doing i/o.  This didn't actually matter.

Submitted by:	mostly by joerg
This commit is contained in:
Bruce Evans 1996-04-19 19:34:19 +00:00
parent 3f64564278
commit 10d245c58a
2 changed files with 10 additions and 2 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
* $Id: ufs_disksubr.c,v 1.20 1995/11/23 07:24:32 dyson Exp $
* $Id: ufs_disksubr.c,v 1.22 1996/03/02 01:49:51 dyson Exp $
*/
#include <sys/param.h>
@ -254,6 +254,7 @@ readdisklabel(dev, strat, lp)
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_bcount = lp->d_secsize;
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_READ;
bp->b_cylinder = LABELSECTOR / lp->d_secpercyl;
(*strat)(bp);
@ -363,6 +364,7 @@ writedisklabel(dev, strat, lp)
* Note that you can't write a label out over a corrupted label!
* (also stupid.. how do you write the first one? by raw writes?)
*/
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_READ;
(*strat)(bp);
error = biowait(bp);
@ -375,6 +377,7 @@ writedisklabel(dev, strat, lp)
if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
dkcksum(dlp) == 0) {
*dlp = *lp;
bp->b_flags &= ~(B_DONE | B_READ);
bp->b_flags |= B_BUSY | B_WRITE;
(*strat)(bp);
error = biowait(bp);
@ -387,6 +390,7 @@ writedisklabel(dev, strat, lp)
bzero(bp->b_data, lp->d_secsize);
dlp = (struct disklabel *)bp->b_data;
*dlp = *lp;
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_WRITE;
(*strat)(bp);
error = biowait(bp);

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
* $Id: ufs_disksubr.c,v 1.20 1995/11/23 07:24:32 dyson Exp $
* $Id: ufs_disksubr.c,v 1.22 1996/03/02 01:49:51 dyson Exp $
*/
#include <sys/param.h>
@ -254,6 +254,7 @@ readdisklabel(dev, strat, lp)
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_bcount = lp->d_secsize;
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_READ;
bp->b_cylinder = LABELSECTOR / lp->d_secpercyl;
(*strat)(bp);
@ -363,6 +364,7 @@ writedisklabel(dev, strat, lp)
* Note that you can't write a label out over a corrupted label!
* (also stupid.. how do you write the first one? by raw writes?)
*/
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_READ;
(*strat)(bp);
error = biowait(bp);
@ -375,6 +377,7 @@ writedisklabel(dev, strat, lp)
if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
dkcksum(dlp) == 0) {
*dlp = *lp;
bp->b_flags &= ~(B_DONE | B_READ);
bp->b_flags |= B_BUSY | B_WRITE;
(*strat)(bp);
error = biowait(bp);
@ -387,6 +390,7 @@ writedisklabel(dev, strat, lp)
bzero(bp->b_data, lp->d_secsize);
dlp = (struct disklabel *)bp->b_data;
*dlp = *lp;
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_BUSY | B_WRITE;
(*strat)(bp);
error = biowait(bp);