diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2009-10-10 14:56:34 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2009-10-10 14:56:34 +0000 |
commit | 47d81c1b70389d74d905484a28550a29d97529a7 (patch) | |
tree | 13a6d5c8c523d3316e78f9f4bb16f3944c3390b0 /sys/kern/kern_event.c | |
parent | 45623593fb3beb3725d278ecb9bf1cc4e6eacab6 (diff) | |
download | src-47d81c1b70389d74d905484a28550a29d97529a7.tar.gz src-47d81c1b70389d74d905484a28550a29d97529a7.zip |
Postpone dropping fp till both kq_global and kqueue mutexes are
unlocked. fdrop() closes file descriptor when reference count goes to
zero. Close method for vnodes locks the vnode, resulting in "sleepable
after non-sleepable". For pipes, pipe mutex is before kqueue lock,
causing LOR.
Reported and tested by: pho
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=197930
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r-- | sys/kern/kern_event.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 478432e20727..7c405945cdc0 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1025,13 +1025,13 @@ findkn: /* knote is in the process of changing, wait for it to stablize. */ if (kn != NULL && (kn->kn_status & KN_INFLUX) == KN_INFLUX) { + KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); + kq->kq_state |= KQ_FLUXWAIT; + msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqflxwt", 0); if (fp != NULL) { fdrop(fp, td); fp = NULL; } - KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); - kq->kq_state |= KQ_FLUXWAIT; - msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqflxwt", 0); goto findkn; } |