lock_drive: report on and recover from an obscure situation where the

daemon can deadlock against itself.
This commit is contained in:
Greg Lehey 1999-03-13 07:35:40 +00:00
parent 301851b630
commit 5c6d2cb543
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44708

View file

@ -53,6 +53,13 @@ lockdrive(struct drive *drive)
int error;
/* XXX get rid of drive->flags |= VF_LOCKING; */
if ((drive->flags & VF_LOCKED) /* it's locked */
&&(drive->pid == curproc->p_pid)) { /* by us! */
log(LOG_WARNING,
"vinum lockdrive: already locking %s\n",
drive->label.name);
return 0;
}
while ((drive->flags & VF_LOCKED) != 0) {
/*
* There are problems sleeping on a unique identifier,