[PATCH] Fix race in sysfs_read_file() and sysfs_write_file()
From: Simon Derr <Simon.Derr@bull.net> - fixes the race between threads by adding a semaphore in sysfs_buffer - allocates the buffer upon call to pread(). We still call again fill_read_buffer() if the file is "rewinded" to offset zero. - fixes the comparison in flush_read_buffer(). Signed-off-by: Simon Derr <simon.derr@bull.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Showing
Please register or sign in to comment