From: G. David Butler gdb@dbSystems.com
Subject: [9fans] create(2)/open(2) race for file creation
Date: Sat, 7 Feb 1998 23:09:45 -0600 [thread overview]
Message-ID: <19980208050945.Hf14ekRK3vc6wUbQ1cWmXKXmTrd9r1Taqa25gce3FGo@z> (raw)
>From: "Rob Pike" <rob@plan9.bell-labs.com>
>Am I missing something? If everyone does create(file, OWRITE, 000)
>only one process can succeed. Perm==0 means no one can read or
>write the file; if you want one writer, many readers, 004 will do.
If I want to create the file, write data and close so that it can
be read/written again then I can't leave it 000 or 400, I must
leave it 600. So, if many processes are doing:
if stat() fails {
create()
write()
chmod()
close()
}
Then it is possible for two or more processes to fail the stat
but one to create, write, chmod and close before the other others
do create. It is a race that can't be avoided, that I can see.
>In other words, it's a create/open race, so don't run that race.
I would like to avoid it. Your point is valid if the file is
created once and never written to again. That is a big restriction.
next reply other threads:[~1998-02-08 5:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-08 5:09 G.David [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-02-26 23:30 Russ
1998-02-26 23:01 G.David
1998-02-26 22:16 G.David
1998-02-26 19:33 Eric
1998-02-26 0:24 G.David
1998-02-26 0:04 G.David
1998-02-25 23:42 G.David
1998-02-10 14:34 G.David
1998-02-10 8:59 forsyth
1998-02-09 21:21 G.David
1998-02-09 16:42 G.David
1998-02-09 8:05 Dan
1998-02-08 22:48 G.David
1998-02-08 22:18 Photon
1998-02-08 21:44 Rob
1998-02-08 21:10 G.David
1998-02-08 16:52 G.David
1998-02-08 16:16 G.David
1998-02-08 16:10 Dave
1998-02-08 15:48 G.David
1998-02-08 2:01 Rob
1998-02-08 0:27 G.David
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=19980208050945.Hf14ekRK3vc6wUbQ1cWmXKXmTrd9r1Taqa25gce3FGo@z \
--to=9fans@9fans.net \
/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;
as well as URLs for NNTP newsgroup(s).