From: Karel Zak <kzak@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: util-linux@vger.kernel.org, Michal Kubecek <mkubecek@suse.cz>,
Petr Uzel <petr.uzel@suse.cz>
Subject: Re: flock in 2.20.1 can no longer lock the file it will execute
Date: Wed, 16 Nov 2011 14:13:21 +0100 [thread overview]
Message-ID: <20111116131321.GN7916@nb.net.home> (raw)
In-Reply-To: <201111140123.39789.vapier@gentoo.org>
On Mon, Nov 14, 2011 at 01:23:38AM -0500, Mike Frysinger wrote:
> i've been using a trick with flock to add locking to all of my shell scripts.
> basically, i take a lock on the shell script itself:
> flock -eon ./test.sh ./test.sh
>
> with <=util-linux-2.20, this has worked fine. but starting with 2.20.1, i now
> get -ETXTBSY (on ext4, but i doubt that matters):
> $ echo '#!/bin/sh' > test.sh
> $ chmod a+rx test.sh
> $ ./flock -eon ./test.sh ./test.sh
> ./flock: ./test.sh: Text file busy
>
> the only commit made to flock.c between 2.20 and 2.20.1 is this:
> commit 75aaee08f06b92d119ed827c53d1af5474eb16ff
> flock: make flock(1) work on NFSv4
>
> and indeed, reverting that made my life happy again. reading the small patch
> shows the obvious flaw: you can't open a file for O_RDWR and attempt to execute
> it at the same time.
Hmm... maybe we can add a new --read-write command line option for
NFS guys rather than be smart with access(). The regression is
unacceptable.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2011-11-16 13:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 6:23 flock in 2.20.1 can no longer lock the file it will execute Mike Frysinger
2011-11-16 13:13 ` Karel Zak [this message]
2011-11-16 15:25 ` Mike Frysinger
2011-11-21 16:35 ` Karel Zak
2011-11-21 20:11 ` Mike Frysinger
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=20111116131321.GN7916@nb.net.home \
--to=kzak@redhat.com \
--cc=mkubecek@suse.cz \
--cc=petr.uzel@suse.cz \
--cc=util-linux@vger.kernel.org \
--cc=vapier@gentoo.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