Index: linux-2.6/fs/locks.c =================================================================== --- linux-2.6.orig/fs/locks.c +++ linux-2.6/fs/locks.c @@ -147,7 +147,14 @@ static struct kmem_cache *filelock_cache /* Allocate an empty lock structure. */ static struct file_lock *locks_alloc_lock(void) { - return kmem_cache_alloc(filelock_cache, GFP_KERNEL); + struct file_lock *fl; + fl = kmem_cache_alloc(filelock_cache, GFP_KERNEL); + if (fl) { + BUG_ON(waitqueue_active(&fl->fl_wait)); + BUG_ON(!list_empty(&fl->fl_block)); + BUG_ON(!list_empty(&fl->fl_link)); + } + return fl; } static void locks_release_private(struct file_lock *fl)