[PATCH] cut'n' paste bug in fold_field()

DORMANTno replies

From: Sridhar Samudrala <hidden>
Date: 2003-02-07 17:55:35

Attached is a small patch for a cut'n'paste bug in linux 2.5.59
   net/ipv4/proc.c:fold_field()
This causes some /proc/net counters that are incremented in BH to be counted
twice and the counters incremented in user context not counted. 
--- proc.c      Tue Jan 21 17:18:52 2003
+++ proc.c.new  Fri Feb  7 09:39:34 2003
@@ -99,7 +99,7 @@
                    *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
                                         sizeof (unsigned long) * nr));
                res +=
-                   *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
+                   *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
                                         sizeof (unsigned long) * nr));
        }
        return res;
The same routine(fold_field()) is duplicated in net/ipv6/proc.c, but it doesn't
have the bug.
Could we convert this to a static inline and move to a header file to avoid
the duplication and 'sctp' too can use it.

Thanks
Sridhar
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help