lkml.org 
[lkml]   [2004]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()
Simon Derr <Simon.Derr@bull.net> wrote:
>
> I think there is a possibility for two threads from a single process to
> race in sysfs_read_file() if they call read() on the same file at the same
> time.

I think there is, too.

I also wonder what happens if the first read of a sysfs file is not at
offset zero (eg: pread()):

static ssize_t
sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct sysfs_buffer * buffer = file->private_data;
ssize_t retval = 0;

if (!*ppos) {
if ((retval = fill_read_buffer(file->f_dentry,buffer)))


we seem to not allocate the buffer at all?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.156 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site