Messages in this thread | | | Date | Wed, 1 Sep 2004 16:34:36 -0700 | From | Andrew Morton <> | Subject | Re: [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/
| |