Re: [PATCH] Possible race in sysfs_read_file() andsysfs_write_file()

From: Andrew Morton
Date: Thu Sep 02 2004 - 21:52:31 EST


Simon Derr <Simon.Derr@xxxxxxxx> wrote:
>
> @@ -140,13 +145,17 @@
> struct sysfs_buffer * buffer = file->private_data;
> ssize_t retval = 0;
>
> - if (!*ppos) {
> + down(&buffer->sem);
> + if ((!*ppos) || (!buffer->page)) {
> if ((retval = fill_read_buffer(file->f_dentry,buffer)))
> - return retval;
> + goto out;

Why are we testing *ppos at all in here?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/