Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()
From: Andrew Morton (akpm_at_osdl.org)
Date: 09/03/04
- Previous message: Kalin KOZHUHAROV: "Re: [Transmeta hardware] Update of the CMS under Linux ?"
- In reply to: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Next in thread: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Reply: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 2 Sep 2004 15:57:58 -0700 To: Simon Derr <Simon.Derr@bull.net>
Simon Derr <Simon.Derr@bull.net> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Kalin KOZHUHAROV: "Re: [Transmeta hardware] Update of the CMS under Linux ?"
- In reply to: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Next in thread: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Reply: Simon Derr: "Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|