Skip to contentSkip to conversation

kernel panic with rpc.patch

PATCH Applied Phil Oester 3 participants 4 messages Sep 2, 2004 – Sep 3, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel panic with rpc.patch

Some useless __MOD_INC_USE_COUNT macros make rpc patch panic on boot. The below removes them. Boot tested.

This fixes bugzilla #50

Phil

rpc/linux/net/ipv4/netfilter/ipt_rpc.c +0 -4
diff -ru pom-orig/rpc/linux/net/ipv4/netfilter/ipt_rpc.c pom-new/rpc/linux/net/ipv4/netfilter/ipt_rpc.c
@@ -394,10 +394,6 @@
 {
 	int port;
 
-	DEBUGP("incrementing usage counts\n");
-	__MOD_INC_USE_COUNT(ip_conntrack_rpc_udp);
-	__MOD_INC_USE_COUNT(ip_conntrack_rpc_tcp);
-
 	/* If no port given, default to standard RPC port */
 	if (ports[0] == 0)
 		ports[0] = RPC_PORT;
#1 lore raw
Quoted 6 lines · Phil Oester

Some useless __MOD_INC_USE_COUNT macros make rpc patch panic on boot. The below removes them. Boot tested.

This fixes bugzilla #50

Applied, but wondering on second thought. There are still two __MOD_DEC_USE_COUNT left, and __MOD_INC_USE_COUNT does actually do something :) Why are they useless ?

Regards
Patrick

Quoted 25 lines

Phil

------------------------------------------------------------------------

diff -ru pom-orig/rpc/linux/net/ipv4/netfilter/ipt_rpc.c pom-new/rpc/linux/net/ipv4/netfilter/ipt_rpc.c

rpc/linux/net/ipv4/netfilter/ipt_rpc.c +0 -4
@@ -394,10 +394,6 @@
 {
 	int port;
 
-	DEBUGP("incrementing usage counts\n");
-	__MOD_INC_USE_COUNT(ip_conntrack_rpc_udp);
-	__MOD_INC_USE_COUNT(ip_conntrack_rpc_tcp);
-
 	/* If no port given, default to standard RPC port */
 	if (ports[0] == 0)
 		ports[0] = RPC_PORT;
#2 lore raw
Quoted 8 lines · Patrick McHardy
Quoted 2 lines · Phil Oester

Some useless __MOD_INC_USE_COUNT macros make rpc patch panic on boot. The below removes them. Boot tested.

Applied, but wondering on second thought. There are still two __MOD_DEC_USE_COUNT left, and __MOD_INC_USE_COUNT does actually do something :) Why are they useless ?

Yes, perhaps 'useless' is the wrong word -- they do something, but something which is deprecated and in 2.6 netfilter nonexistent. And following davem's policy of no refcounts for network drivers [1], it seems to make sense.

Agreed, however, that removing the INC without also removing the DEC is sloppy. Attached find a patch to do so.

Phil

[1] http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.3/0403.html

rpc/linux/net/ipv4/netfilter/ipt_rpc.c +0 -4
diff -ru pom-orig/rpc/linux/net/ipv4/netfilter/ipt_rpc.c pom-new/rpc/linux/net/ipv4/netfilter/ipt_rpc.c
@@ -412,10 +412,6 @@
 {
 	DEBUGP("unregistering match\n");
 	ipt_unregister_match(&rpc_match);
-
-	DEBUGP("decrementing usage counts\n");
-	__MOD_DEC_USE_COUNT(ip_conntrack_rpc_tcp);
-	__MOD_DEC_USE_COUNT(ip_conntrack_rpc_udp);
 }
 
 
#3 lore raw
Quoted 8 lines · Phil Oester
Quoted 5 lines · Patrick McHardy

Applied, but wondering on second thought. There are still two __MOD_DEC_USE_COUNT left, and __MOD_INC_USE_COUNT does actually do something :) Why are they useless ?

Quoted 8 lines

Yes, perhaps 'useless' is the wrong word -- they do something, but something which is deprecated and in 2.6 netfilter nonexistent. And following davem's policy of no refcounts for network drivers [1], it
seems to make sense.

Agreed, however, that removing the INC without also removing the DEC is sloppy. Attached find a patch to do so.

Thanks, applied.

Regards
Patrick