diff options
author | grog <grog@FreeBSD.org> | 2000-05-04 07:37:11 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 2000-05-04 07:37:11 +0000 |
commit | cf2c7a9d5274c540e29879c3d48ff248c97407c6 (patch) | |
tree | 004c8d91293600b099b7f27364ce6723667309c5 /sys/dev/vinum/vinumlock.c | |
parent | 2e5ef3db368f237906125f954e76b3f5166ab372 (diff) | |
download | FreeBSD-src-cf2c7a9d5274c540e29879c3d48ff248c97407c6.zip FreeBSD-src-cf2c7a9d5274c540e29879c3d48ff248c97407c6.tar.gz |
lockrange: Avoid a race condition which was causing random corruption,
panics and hangs in RAID-5 plexes, particularly with ata drives.
Original-code-by: Bernd Walter <ticso@cicely.de>
Eagerly-awaited-by: sos
Diffstat (limited to 'sys/dev/vinum/vinumlock.c')
-rw-r--r-- | sys/dev/vinum/vinumlock.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c index 78c4ce8..1834b84 100644 --- a/sys/dev/vinum/vinumlock.c +++ b/sys/dev/vinum/vinumlock.c @@ -37,7 +37,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumlock.c,v 1.11 1999/10/12 04:35:37 grog Exp grog $ + * $Id: vinumlock.c,v 1.12 2000/01/05 22:17:25 grog Exp grog $ * $FreeBSD$ */ @@ -248,14 +248,13 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex) } #endif plex->lockwaits++; /* waited one more time */ - while (lock->stripe) /* wait for it to become free */ tsleep((void *) lock->stripe, PRIBIO, "vrlock", 2 * hz); - break; /* out of the inner level loop */ + lock = plex->lock; /* start again */ + foundlocks = 0; + pos = NULL; } - } else { - if (pos == NULL) /* still looking for somewhere? */ + } else if (pos == NULL) /* still looking for somewhere? */ pos = lock; /* a place to put this one */ - } } /* |