Re: [PATCH] bonding: fix race that causes invalid statistics

2008-01-28 Thread Andy Gospodarek
On Mon, Jan 28, 2008 at 03:59:03PM -0800, Jay Osbourn wrote: > Andy Gospodarek <[EMAIL PROTECTED]> wrote: > > >+memcpy(stats,&local_stats,sizeof(net_device_stats)); > > FYI, this generates a compiler error (missing the word "struct" > in here). Other than not compiling, the patch seems

Re: [PATCH] bonding: fix race that causes invalid statistics

2008-01-28 Thread Chris Snook
Jay Vosburgh wrote: Andy Gospodarek <[EMAIL PROTECTED]> wrote: + memcpy(stats,&local_stats,sizeof(net_device_stats)); FYI, this generates a compiler error (missing the word "struct" in here). Other than not compiling, the patch seems reasonable. I'll fix it up and include it i

Re: [PATCH] bonding: fix race that causes invalid statistics

2008-01-28 Thread Jay Vosburgh
Andy Gospodarek <[EMAIL PROTECTED]> wrote: >+ memcpy(stats,&local_stats,sizeof(net_device_stats)); FYI, this generates a compiler error (missing the word "struct" in here). Other than not compiling, the patch seems reasonable. I'll fix it up and include it in the series I'll post t

[PATCH] bonding: fix race that causes invalid statistics

2008-01-28 Thread Andy Gospodarek
I've seen reports of invalid stats in /proc/net/dev for bonding interfaces, and found it's a pretty easy problem to reproduce. Since the current code zeros the bonding stats when a read is requested and a pointer to that data is returned to the caller we cannot guarantee that the caller has compl