From c6f8f72bf1ad71a3cb66fc165826b14fc895d396 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 9 Apr 2010 12:28:50 +0200 Subject: [PATCH] xt_condition: use non-interruptible check routine Patrick McHardy let's it be known: "No need for interruptible locking, the section is very short and usually there's only a single iptables process running at a time." --- extensions/xt_condition.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/xt_condition.c b/extensions/xt_condition.c index ce2a365..c4a54b9 100644 --- a/extensions/xt_condition.c +++ b/extensions/xt_condition.c @@ -56,7 +56,7 @@ struct condition_variable { /* proc_lock is a user context only semaphore used for write access */ /* to the conditions' list. */ -static struct mutex proc_lock; +static DEFINE_MUTEX(proc_lock); static LIST_HEAD(conditions_list); static struct proc_dir_entry *proc_net_condition; @@ -122,9 +122,7 @@ static int condition_mt_check(const struct xt_mtchk_param *par) * Let's acquire the lock, check for the condition and add it * or increase the reference counter. */ - if (mutex_lock_interruptible(&proc_lock) != 0) - return -EINTR; - + mutex_lock(&proc_lock); list_for_each_entry(var, &conditions_list, list) { if (strcmp(info->name, var->status_proc->name) == 0) { var->refcount++;