summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum/vinumlock.c
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-03-13 07:35:40 +0000
committergrog <grog@FreeBSD.org>1999-03-13 07:35:40 +0000
commit56ebff21a0ec3b2b9d74d87c0f5d2b7f0a1c9ba8 (patch)
treec49ea207ec006d439de5eab389d030809190402b /sys/dev/vinum/vinumlock.c
parente953ecbd1716ddf48e86649115de3282cfab6e83 (diff)
downloadFreeBSD-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.c7
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,
OpenPOWER on IntegriCloud