diff options
author | grog <grog@FreeBSD.org> | 1999-03-13 07:35:40 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-03-13 07:35:40 +0000 |
commit | 56ebff21a0ec3b2b9d74d87c0f5d2b7f0a1c9ba8 (patch) | |
tree | c49ea207ec006d439de5eab389d030809190402b /sys/dev/vinum/vinumlock.c | |
parent | e953ecbd1716ddf48e86649115de3282cfab6e83 (diff) | |
download | FreeBSD-src-56ebff21a0ec3b2b9d74d87c0f5d2b7f0a1c9ba8.zip FreeBSD-src-56ebff21a0ec3b2b9d74d87c0f5d2b7f0a1c9ba8.tar.gz |
lock_drive: report on and recover from an obscure situation where the
daemon can deadlock against itself.
Diffstat (limited to 'sys/dev/vinum/vinumlock.c')
-rw-r--r-- | sys/dev/vinum/vinumlock.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumlock.c b/sys/dev/vinum/vinumlock.c index 0809424..d0d47f1 100644 --- a/sys/dev/vinum/vinumlock.c +++ b/sys/dev/vinum/vinumlock.c @@ -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, |