On 1 Mar 2002, Andi Kleen wrote:
> #if 1
> if (power <= 0) {
> printk(KERN_CRIT "impossible 777\n");
> return;
> }
> #endif
>
> should stop it; making it just not work, but not crash.
> If he still gets a division by zero then something else is fishy.
How oops is reached:
2 CPUs enter fib_select_multipath while fib_power is 1.
Both see 1 at 'if (fi->fib_power <= 0) {', so no 777, CPU1 changes
fib_power from 1 to 0 before CPU2 reaches 'w = jiffies % fi->fib_power;'
How 888 is printed:
both CPUs see 1 in 'w = jiffies % fi->fib_power;' but the first
changes nh_power and fib_power from 1 to 0. CPU2 sees 0 everywhere
and prints 888. I assume nobody plays with DEAD.
If I understand correctly the locking (please correct me),
we can have many threads at the same time:
- many in ip_route_* calling fib_select_multipath
- one in rtnetlink playing with nh_*
> -Andi
Regards
-- Julian Anastasov <ja@ssi.bg>- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/