From: Matthias Urlichs <smurf@smurf.noris.de>
To: linux-kernel@vger.kernel.org
Subject: Re: VFS locking: f_pos thread-safe ?
Date: Fri, 06 Feb 2004 20:05:48 +0100 [thread overview]
Message-ID: <pan.2004.02.06.19.05.47.617416@smurf.noris.de> (raw)
In-Reply-To: <20040206183746.GR4902@ca-server1.us.oracle.com>
Hi, Joel Becker wrote:
> This reads: "all of the specified effects of the other call,
> or none of them." If I read that correctly, if f_pos is at N, and
> threads A and B concurrently read M bytes, then each thread's read()
> must either start at f_pos = N or f_pos = N+M, but never at N < f_pos <
> N+M. So as long as our code doesn't partially update f_pos, it is
> valid.
Umm, strictly speaking there are three possible valid cases:
thread A reads M @N thread B reads M @N file pointer ends up as N+M
thread A reads M @N thread B reads M @M+N file pointer ends up as N+2M
thread A reads M @M+N thread B reads M @N file pointer ends up as N+2M
With your description,
thread A reads M @M+N thread B reads M @M+N file pointer ends up as N+2M
would be equally valid, which I'd declare buggy ^W non-conforming.
--
Matthias Urlichs
next prev parent reply other threads:[~2004-02-06 19:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-06 7:12 Werner Almesberger
2004-02-06 7:55 ` Andrew Morton
2004-02-06 18:37 ` Joel Becker
2004-02-06 19:05 ` Matthias Urlichs [this message]
2004-02-07 1:35 ` Joel Becker
2004-02-06 20:09 ` Werner Almesberger
2004-02-06 20:56 ` Valdis.Kletnieks
2004-02-07 0:55 ` Werner Almesberger
2004-02-06 20:54 ` Andries Brouwer
2004-02-07 23:45 ` Werner Almesberger
2004-02-06 9:09 Matt
2004-02-06 9:16 ` Andrew Morton
2004-02-06 9:26 ` Matt
2004-02-06 9:35 ` Andrew Morton
2004-02-06 10:19 ` Matthias Urlichs
2004-02-06 11:18 ` viro
2004-02-06 18:59 ` Matthias Urlichs
2004-02-06 19:54 ` Werner Almesberger
2004-02-08 15:58 ` Kai Henningsen
2004-02-19 15:14 ` Pavel Machek
[not found] ` <20040206101941.4cd9c882.shemminger@osdl.org>
2004-02-06 18:47 ` Matthias Urlichs
2004-02-06 13:50 ` Werner Almesberger
2004-02-06 13:56 ` viro
2004-02-06 14:24 ` Werner Almesberger
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=pan.2004.02.06.19.05.47.617416@smurf.noris.de \
--to=smurf@smurf.noris.de \
--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®