diff options
| author | 2009-05-14 10:49:00 +0000 | |
|---|---|---|
| committer | 2009-05-14 10:49:00 +0000 | |
| commit | 5b6fa4eecccb9a6614c22d056f5a20975d116dd3 (patch) | |
| tree | 9fe3ddbfa6c9c2d51d2ef37a72711051a7a2df6c /sys/isofs/udf/udf_subr.c | |
| parent | correct function name in fatal (diff) | |
| download | wireguard-openbsd-5b6fa4eecccb9a6614c22d056f5a20975d116dd3.tar.xz wireguard-openbsd-5b6fa4eecccb9a6614c22d056f5a20975d116dd3.zip | |
Reset b_flags rather than just OR'ing in B_READ and B_RAW when
re-using a buf. Taken from the kern/subr_disk.c readdoslabel()
usage.
Avoids a loop in disksort() caused by trying to queue a buffer that is
already in cd->buf_queue. I can now 'disklabel cd0' with "Command
& Conquer 3: Kane's Wrath" in the drive and not hang the system.
Problem reported and fix tested by Jasper Valentij. Thanks!
Diffstat (limited to 'sys/isofs/udf/udf_subr.c')
| -rw-r--r-- | sys/isofs/udf/udf_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/isofs/udf/udf_subr.c b/sys/isofs/udf/udf_subr.c index 794d69c4f26..81f43b446b6 100644 --- a/sys/isofs/udf/udf_subr.c +++ b/sys/isofs/udf/udf_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_subr.c,v 1.18 2008/07/23 16:24:43 beck Exp $ */ +/* $OpenBSD: udf_subr.c,v 1.19 2009/05/14 10:49:00 krw Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat @@ -110,7 +110,7 @@ udf_disklabelspoof(dev_t dev, void (*strat)(struct buf *), */ bp->b_blkno = sector * btodb(bsize); bp->b_bcount = bsize; - bp->b_flags |= (B_READ | B_RAW); + bp->b_flags = B_BUSY | B_READ | B_RAW; bp->b_resid = bp->b_blkno / lp->d_secpercyl; (*strat)(bp); @@ -130,7 +130,7 @@ udf_disklabelspoof(dev_t dev, void (*strat)(struct buf *), for (sector = mvds_start; sector < mvds_end; sector++) { bp->b_blkno = sector * btodb(bsize); bp->b_bcount = bsize; - bp->b_flags |= (B_READ | B_RAW); + bp->b_flags = B_BUSY | B_READ | B_RAW; bp->b_resid = bp->b_blkno / lp->d_secpercyl; (*strat)(bp); |
