summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-05-24 12:37:55 +0000
committerkib <kib@FreeBSD.org>2009-05-24 12:37:55 +0000
commitc54d127bf0b5509d9233583ca4d8a8dc0441c38f (patch)
treecf91ee4bb1d20adce37dc0bd8d25148b72547e72 /sys/kern
parentfec8f2f8456079e0c79082685486284814a37a5c (diff)
downloadFreeBSD-src-c54d127bf0b5509d9233583ca4d8a8dc0441c38f.zip
FreeBSD-src-c54d127bf0b5509d9233583ca4d8a8dc0441c38f.tar.gz
In lf_purgelocks(), assert that state->ls_pending is empty after we
weeded out threads, and clean ls_active instead of ls_pending. Reviewed by: dfr Tested by: pho MFC after: 1 month
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_lockf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index 6a6e966..3f8e9f6 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -813,7 +813,9 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep)
* above). We don't need to bother locking since we
* are the last thread using this state structure.
*/
- LIST_FOREACH_SAFE(lock, &state->ls_pending, lf_link, nlock) {
+ KASSERT(LIST_EMPTY(&state->ls_pending),
+ ("lock pending for %p", state));
+ LIST_FOREACH_SAFE(lock, &state->ls_active, lf_link, nlock) {
LIST_REMOVE(lock, lf_link);
lf_free_lock(lock);
}
OpenPOWER on IntegriCloud