lock_drive: report on and recover from an obscure situation where the
daemon can deadlock against itself.
This commit is contained in:
parent
301851b630
commit
5c6d2cb543
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user