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
This commit is contained in:
parent
46aebdeaea
commit
9702452a12
@ -37,7 +37,7 @@
|
|||||||
* otherwise) arising in any way out of the use of this software, even if
|
* otherwise) arising in any way out of the use of this software, even if
|
||||||
* advised of the possibility of such damage.
|
* 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$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -248,14 +248,13 @@ lockrange(daddr_t stripe, struct buf *bp, struct plex *plex)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
plex->lockwaits++; /* waited one more time */
|
plex->lockwaits++; /* waited one more time */
|
||||||
while (lock->stripe) /* wait for it to become free */
|
|
||||||
tsleep((void *) lock->stripe, PRIBIO, "vrlock", 2 * hz);
|
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 {
|
} else if (pos == NULL) /* still looking for somewhere? */
|
||||||
if (pos == NULL) /* still looking for somewhere? */
|
|
||||||
pos = lock; /* a place to put this one */
|
pos = lock; /* a place to put this one */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user