From: Andrew Morton <akpm@osdl.org>
To: Simon Derr <Simon.Derr@bull.net>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Possible race in sysfs_read_file() and sysfs_write_file()
Date: Thu, 2 Sep 2004 15:57:58 -0700 [thread overview]
Message-ID: <20040902155758.1eba30a5.akpm@osdl.org> (raw)
In-Reply-To: <Pine.A41.4.53.0409020917350.122970@isabelle.frec.bull.fr>
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?
next prev parent reply other threads:[~2004-09-02 23:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-01 8:17 Simon Derr
2004-09-01 23:34 ` Andrew Morton
2004-09-02 9:14 ` Simon Derr
2004-09-02 22:57 ` Andrew Morton [this message]
2004-09-03 9:06 ` Simon Derr
2004-09-03 9:39 ` Simon Derr
2004-09-03 11:57 ` Simon Derr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040902155758.1eba30a5.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=Simon.Derr@bull.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®