From: Alexander Holler <holler@ahsoftware.de>
To: linux-kernel@vger.kernel.org
Subject: asynchronous calls an the lack of --wait-for-completion options (e.g. modprobe, losetup, cryptsetup)
Date: Wed, 17 Jun 2009 15:39:53 +0200 [thread overview]
Message-ID: <4A38F229.70504@ahsoftware.de> (raw)
Hello,
during the last kernel versions I've got more and more problems with
scripts which are calling modprobe, losetup or e.g. cryptsetup.
The problem is that when I'm e.g. calling modprobe loop, loop might not
has finished it's initialization, when modprobe returns.
This leads me to such ugly scripts like
-----------------------------
if [ ! -b /dev/loop0 ]; then
modprobe loop
for i in $(seq 1 10) ; do
if [ -b /dev/loop0 ]; then
break;
fi
sleep 1
done
fi
do something with /dev/loop0
-----------------------------
which leaves me in doubt if /dev/loop0 really is usable (or if the
module really has finished it's initialization) if /dev/loop0 appeared
(besides the unecessary seconds spended to sleep).
So I'm awaiting the time, when cp in "mkdir foo; cp bar foo" will fail,
because mkdir hasn't completed it's operation (but just started it).
My suggestion would be that all those tools should either offer an
option like --wait-for-completion, or, my prefered solution (which I
naively assume as how those userland-tools should behave), they should
by default wait for completion and could offer an option like
--asynchronous for the rare moments one really doesn't care if the
operation has completed when the appropriate userland-tool returns.
Another question could be, how to be sure if, e.g., modprobe loop
succeeded, if it returns while the operation hasn't finished.
Kind regards,
Alexander Holler
next reply other threads:[~2009-06-17 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 13:39 Alexander Holler [this message]
2009-06-19 0:52 ` asynchronous calls an the lack of --wait-for-completion options (e.g. modprobe, losetup, cryptsetup) Robert Hancock
2009-06-20 19:20 ` Kay Sievers
2009-06-22 12:08 ` Alexander Holler
2009-06-23 11:35 ` Kay Sievers
2009-06-23 16:01 ` Alan Cox
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=4A38F229.70504@ahsoftware.de \
--to=holler@ahsoftware.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