From: alex Date: Thu, 15 Jul 2004 14:53:37 +0000 (+0000) Subject: b=3772 X-Git-Tag: v1_7_100~2087 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d2c1ee7e70c7320ae64e5995c7a1e27c5259f637;p=fs%2Flustre-release.git b=3772 - debug info for corrupted lock case --- diff --git a/lustre/kernel_patches/patches/dynamic-locks-2.4.24.patch b/lustre/kernel_patches/patches/dynamic-locks-2.4.24.patch index d05bced..0a3cf5a 100644 --- a/lustre/kernel_patches/patches/dynamic-locks-2.4.24.patch +++ b/lustre/kernel_patches/patches/dynamic-locks-2.4.24.patch @@ -6,7 +6,7 @@ Index: linux-2.4.24/include/linux/dynlocks.h =================================================================== --- linux-2.4.24.orig/include/linux/dynlocks.h 2003-01-30 13:24:37.000000000 +0300 -+++ linux-2.4.24/include/linux/dynlocks.h 2004-07-06 19:14:17.000000000 +0400 ++++ linux-2.4.24/include/linux/dynlocks.h 2004-07-15 18:32:18.000000000 +0400 @@ -0,0 +1,41 @@ +#ifndef _LINUX_DYNLOCKS_H +#define _LINUX_DYNLOCKS_H @@ -52,8 +52,8 @@ Index: linux-2.4.24/include/linux/dynlocks.h Index: linux-2.4.24/lib/dynlocks.c =================================================================== --- linux-2.4.24.orig/lib/dynlocks.c 2003-01-30 13:24:37.000000000 +0300 -+++ linux-2.4.24/lib/dynlocks.c 2004-07-06 19:14:40.000000000 +0400 -@@ -0,0 +1,173 @@ ++++ linux-2.4.24/lib/dynlocks.c 2004-07-15 18:42:10.000000000 +0400 +@@ -0,0 +1,187 @@ +/* + * Dynamic Locks + * @@ -108,7 +108,14 @@ Index: linux-2.4.24/lib/dynlocks.c + BUG_ON(cur->next == NULL); + BUG_ON(cur->prev == NULL); + hl = list_entry(cur, struct dynlock_member, dl_list); -+ BUG_ON(hl->dl_magic != DYNLOCK_MAGIC); ++ if (hl->dl_magic != DYNLOCK_MAGIC) { ++ printk("corrupted lock 0x%p: magic 0x%x (!=0x%x)\n", ++ hl, hl->dl_magic, DYNLOCK_MAGIC); ++ printk(" value 0x%lx, %d readers, %d writers, pid %d, %d refs\n", ++ hl->dl_value, hl->dl_readers, hl->dl_writers, ++ hl->dl_pid, hl->dl_refcount); ++ BUG_ON(1); ++ } + if (hl->dl_value == value) { + /* lock is found */ + if (nhl) { @@ -194,7 +201,14 @@ Index: linux-2.4.24/lib/dynlocks.c + BUG_ON(dl == NULL); + BUG_ON(hl == NULL); + BUG_ON(dl->dl_magic != DYNLOCK_LIST_MAGIC); -+ BUG_ON(hl->dl_magic != DYNLOCK_MAGIC); ++ if (hl->dl_magic != DYNLOCK_MAGIC) { ++ printk("corrupted lock 0x%p: magic 0x%x (!=0x%x)\n", ++ hl, hl->dl_magic, DYNLOCK_MAGIC); ++ printk(" value 0x%lx, %d readers, %d writers, pid %d, %d refs\n", ++ hl->dl_value, hl->dl_readers, hl->dl_writers, ++ hl->dl_pid, hl->dl_refcount); ++ BUG_ON(1); ++ } + BUG_ON(current->pid != hl->dl_pid); + + spin_lock(&dl->dl_list_lock); @@ -230,7 +244,7 @@ Index: linux-2.4.24/lib/dynlocks.c Index: linux-2.4.24/lib/Makefile =================================================================== --- linux-2.4.24.orig/lib/Makefile 2004-06-24 09:06:32.000000000 +0400 -+++ linux-2.4.24/lib/Makefile 2004-07-06 19:14:17.000000000 +0400 ++++ linux-2.4.24/lib/Makefile 2004-07-14 18:14:28.000000000 +0400 @@ -9,10 +9,10 @@ L_TARGET := lib.a