Re: 2.6.9-rc3-mm2

Andrew Morton
2004-10-04T22:30:04Z

Ingo Molnar <mingo@elte.hu> wrote:
>
> Must not put side-effects into a macro that is NOP on
> !SMP.

This one, too:

diff -puN include/linux/netfilter_ipv4/ip_conntrack.h~conntrack-preempt-safety-fix include/linux/netfilter_ipv4/ip_conntrack.h
--- 25/include/linux/netfilter_ipv4/ip_conntrack.h~conntrack-preempt-safety-fix Mon Oct 4 14:36:19 2004
+++ 25-akpm/include/linux/netfilter_ipv4/ip_conntrack.h Mon Oct 4 14:37:02 2004
@@ -311,10 +311,11 @@ struct ip_conntrack_stat
unsigned int expect_delete;
};

-#define CONNTRACK_STAT_INC(count) \
- do { \
- per_cpu(ip_conntrack_stat, get_cpu()).count++; \
- put_cpu(); \
+#define CONNTRACK_STAT_INC(count) \
+ do { \
+ preempt_disable(); \
+ per_cpu(ip_conntrack_stat, smp_processor_id()).count++; \
+ preempt_disable(); \
} while (0)

/* eg. PROVIDES_CONNTRACK(ftp); */
_