proc: loadavg reading race
authorMichal Schmidt <mschmidt@redhat.com>
Wed, 6 Feb 2008 09:37:07 +0000 (01:37 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:04 +0000 (10:41 -0800)
commit07a154b2bb9b528a39ddc777399482c1fa27fdb8
tree64355093ab4f470e67a301fb53e7d078ad4000f9
parent0a76fe8e50ee93a9d4a1badb1ec995852a6bcaf1
proc: loadavg reading race

The avenrun[] values are supposed to be protected by xtime_lock.
loadavg_read_proc does not use it.  Theoretically this may result in an
occasional glitch when the value read from /proc/loadavg would be as much
as 1<<11 times higher than it should be.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/proc_misc.c