From: Lennart Poettering <lennart@poettering.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] race between util_create_path() and util_delete_path()?
Date: Sat, 05 Sep 2009 08:19:50 +0000 [thread overview]
Message-ID: <20090905081950.GA18519@tango.0pointer.de> (raw)
In-Reply-To: <20090904192743.GO4363@florz.florz.dyndns.org>
On Fri, 04.09.09 21:27, Florian Zumbiehl (florz@florz.de) wrote:
> plus, it seems to be the simpler solution by far - which is why I went
> with flock() in my suggested fix you find below. Untested, as usual, and
> I don't really have a clue whether there are any unhealthy interactions
> with the rest of udev in this solution. Also, you most likely will want
> to change the path of the lock file ;-)
Never use flock.
All Unix locking APIs are broken in one way or the other. But if you
use one then at least use fcntl(F_SETLK) which is the least broken.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
next prev parent reply other threads:[~2009-09-05 8:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 19:27 [PATCH] race between util_create_path() and util_delete_path()? Florian Zumbiehl
2009-09-05 8:19 ` Lennart Poettering [this message]
2009-09-05 10:28 ` Alan Jenkins
2009-09-05 17:11 ` Florian Zumbiehl
2009-09-06 12:41 ` Lennart Poettering
2009-09-07 5:15 ` Florian Zumbiehl
2009-09-07 14:34 ` Alan Jenkins
2009-09-07 14:54 ` Alan Jenkins
2009-09-07 17:27 ` Florian Zumbiehl
2009-09-07 19:39 ` Kay Sievers
2009-09-07 20:13 ` Florian Zumbiehl
2009-09-07 20:23 ` Florian Zumbiehl
2009-09-07 20:36 ` Kay Sievers
2009-09-07 20:44 ` Kay Sievers
2009-09-07 21:37 ` Florian Zumbiehl
2009-09-08 12:12 ` Alan Jenkins
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=20090905081950.GA18519@tango.0pointer.de \
--to=lennart@poettering.net \
--cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).