OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] table->lock initialization move
[PATCH] table->lock initialization move [message #2695] Mon, 17 April 2006 11:14 Go to next message
Mishin Dmitry is currently offline  Mishin Dmitry
Messages: 112
Registered: February 2006
Senior Member
xt_table->lock should be initialized before xt_replace_table() call, which
uses it. This patch removes strict requirement, that table should define lock
before registering.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>

--
Thanks,
Dmitry.

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 00cf0a4..17abf60 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -529,6 +529,7 @@ int xt_register_table(struct xt_table *t

/* Simplifies replace_table code. */
table->private = bootstrap;
+ rwlock_init(&table->lock);
if (!xt_replace_table(table, 0, newinfo, &ret))
goto unlock;

@@ -538,7 +539,6 @@ int xt_register_table(struct xt_table *t
/* save number of initial entries */
private->initial_entries = private->number;

- rwlock_init(&table->lock);
list_prepend(&xt[table->af].tables, table);

ret = 0;
Re: [PATCH] table->lock initialization move [message #2789 is a reply to message #2695] Thu, 20 April 2006 23:26 Go to previous message
Patrick McHardy is currently offline  Patrick McHardy
Messages: 107
Registered: March 2006
Senior Member
Dmitry Mishin wrote:
> xt_table->lock should be initialized before xt_replace_table() call, which
> uses it. This patch removes strict requirement, that table should define lock
> before registering.

Applied, thanks.
Previous Topic: OpenVZ and Virtuozzo
Next Topic: [PATCH][x86_64] IPI calltraces on x86_64
Goto Forum:
  


Current Time: Tue Jul 29 18:47:09 GMT 2025

Total time taken to generate the page: 0.09261 seconds