2006-03-23 17:54:46

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH] locks: don't panic

Don't panic! Just BUG_ON().

Signed-off-by: Miklos Szeredi <[email protected]>

Index: linux/fs/locks.c
===================================================================
--- linux.orig/fs/locks.c 2006-03-22 16:09:10.000000000 +0100
+++ linux/fs/locks.c 2006-03-22 16:10:23.000000000 +0100
@@ -156,18 +156,9 @@ static struct file_lock *locks_alloc_loc
/* Free a lock which is not in use. */
static void locks_free_lock(struct file_lock *fl)
{
- if (fl == NULL) {
- BUG();
- return;
- }
- if (waitqueue_active(&fl->fl_wait))
- panic("Attempting to free lock with active wait queue");
-
- if (!list_empty(&fl->fl_block))
- panic("Attempting to free lock with active block list");
-
- if (!list_empty(&fl->fl_link))
- panic("Attempting to free lock on active lock list");
+ BUG_ON(waitqueue_active(&fl->fl_wait));
+ BUG_ON(!list_empty(&fl->fl_block));
+ BUG_ON(!list_empty(&fl->fl_link));

if (fl->fl_ops) {
if (fl->fl_ops->fl_release_private)