Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=483b23ffa3a5f44767038b0a676d757e0668437e
Commit:     483b23ffa3a5f44767038b0a676d757e0668437e
Parent:     b242e891c218162cfbae064b1a9136cdbed5ee53
Author:     Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 16 02:29:24 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sun Nov 18 18:47:38 2007 -0800

    [NET]: Corrects a bug in ip_rt_acct_read()
    
    It seems that stats of cpu 0 are counted twice, since
    for_each_possible_cpu() is looping on all possible cpus, including 0
    
    Before percpu conversion of ip_rt_acct, we should also remove the
    assumption that CPU 0 is online (or even possible)
    
    Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/route.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1bff9ed..c426dec 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2888,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, 
off_t offset,
        offset /= sizeof(u32);
 
        if (length > 0) {
-               u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset;
                u32 *dst = (u32 *) buffer;
 
-               /* Copy first cpu. */
                *start = buffer;
-               memcpy(dst, src, length);
+               memset(dst, 0, length);
 
-               /* Add the other cpus in, one int at a time */
                for_each_possible_cpu(i) {
                        unsigned int j;
-
-                       src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
+                       u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
 
                        for (j = 0; j < length/4; j++)
                                dst[j] += src[j];
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to