Skip to contentSkip to conversation

panic - Attempting to free lock with active block list

DISCUSSION Jan-Frode Myklebust 3 participants 5 messages Jan 5, 2005 – Jan 6, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

We have a couple of mail-servers running first 2.6.9-1.681_FC3smp and was later upgraded to the Fedora test kernel 2.6.10-1.727_FC3smp which I think is pretty plain 2.6.10 + ac2. But they both keep crashing with the message:

       Kernel panic - not syncing: Attempting to free lock with active block list

Any ideas how to attack this?

We're running Centos 3.3, ext3 for root-disks, ext2 on /boot, XFS for mail-spools, lots of nfs-mounted directories..

-jf

#1 lore raw
Quoted 11 lines · * Jan-Frode Myklebust ([email protected]) wrote:

We have a couple of mail-servers running first 2.6.9-1.681_FC3smp and was later upgraded to the Fedora test kernel 2.6.10-1.727_FC3smp which I think is pretty plain 2.6.10 + ac2. But they both keep crashing with the message:

       Kernel panic - not syncing: Attempting to free lock with active block list

Any ideas how to attack this?

We're running Centos 3.3, ext3 for root-disks, ext2 on /boot, XFS for mail-spools, lots of nfs-mounted directories..

It seems likely it's nfs related in this case since it stresses the fs/locks code differently than local filesystems. I recall Steve French reporting similar issue with cifs last month.

Message-Id: <[email protected]>

Are those three cases really panic-worthy? Could we change to BUG_ON() and try and get some useful debugging? Trond, Willy, any ideas?

thanks,
-chris

===== fs/locks.c 1.76 vs edited =====

fs/locks.c +12 -6
@@ -159,14 +159,20 @@ static inline void locks_free_lock(struc
 		BUG();
 		return;
 	}
-	if (waitqueue_active(&fl->fl_wait))
-		panic("Attempting to free lock with active wait queue");
+	if (waitqueue_active(&fl->fl_wait)) {
+		printk("Attempting to free lock with active wait queue");
+		BUG();
+	}
 
-	if (!list_empty(&fl->fl_block))
-		panic("Attempting to free lock with active block list");
+	if (!list_empty(&fl->fl_block)) {
+		printk("Attempting to free lock with active block list");
+		BUG();
+	}
 
-	if (!list_empty(&fl->fl_link))
-		panic("Attempting to free lock on active lock list");
+	if (!list_empty(&fl->fl_link)) {
+		printk("Attempting to free lock on active lock list");
+		BUG();
+	}
 
 	if (fl->fl_ops) {
 		if (fl->fl_ops->fl_release_private)
#3 lore raw
In reply to Chris Wright

on den 05.01.2005 Klokka 12:32 (-0800) skreiv Chris Wright:

Quoted 9 lines · * Jan-Frode Myklebust ([email protected]) wrote:
Quoted 8 lines

We have a couple of mail-servers running first 2.6.9-1.681_FC3smp and was later upgraded to the Fedora test kernel 2.6.10-1.727_FC3smp which I think is pretty plain 2.6.10 + ac2. But they both keep crashing with the message:

       Kernel panic - not syncing: Attempting to free lock with active block list

Any ideas how to attack this?

Well, the prevailing theory tends to start along the lines of "find out how to reproduce the problem...". ;-)

Looking at the NFS code, I can attempt a wild guess about what may be
happening: there may be a race when pressing ^C in the middle of a blocking NFS lock RPC call, and if so, the following patch will fix it.

Try it, and see whether or not it fixes your problem, but if it doesn't, then I agree with Chris' suggestion of replacing those "panic()" calls with BUG_ON()s.

Cheers,
Trond

 file.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/nfs/file.c +1 -1
Index: linux-2.6.10/fs/nfs/file.c
===================================================================
@@ -374,7 +374,7 @@ static int do_setlk(struct file *filp, i
 		 * the process exits.
 		 */
 		if (status == -EINTR || status == -ERESTARTSYS)
-			posix_lock_file(filp, fl);
+			posix_lock_file_wait(filp, fl);
 	} else
 		status = posix_lock_file_wait(filp, fl);
 	unlock_kernel();
Signature · 1 line
Trond Myklebust <[email protected]>
#4 lore raw
Quoted 4 lines · Trond Myklebust

Looking at the NFS code, I can attempt a wild guess about what may be
happening: there may be a race when pressing ^C in the middle of a blocking NFS lock RPC call, and if so, the following patch will fix it.

A whopping 9 hours of uptime now :) So the one-liner patch seems to have fixed it.

Thanks!

fs/nfs/file.c static int do_setlk(struct file *filp, i · line 377

Quoted 2 lines
fs/nfs/file.c +1 -1
-			posix_lock_file(filp, fl);
+			posix_lock_file_wait(filp, fl);

-jf