From: "Michael S. Tsirkin" <mst@redhat.com>
To: malc <av1474@comtv.ru>, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread"
Date: Wed, 7 Oct 2009 15:20:06 +0200 [thread overview]
Message-ID: <20091007132006.GA9668@redhat.com> (raw)
This reverts commit ee3993069ff55fa6f1c64daf1e09963e340db8e4.
With commit ee3993069ff55fa6f1c64daf1e09963e340db8e4,
winxp installation on a raw format file fails
during disk format, with a message "your
disk may be damaged".
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: malc <av1474@comtv.ru>
---
malc, care to describe what the problem you
are solving here is?
All, could everyone please start being nice and post patches
and give time for review before applying?
Thanks!
posix-aio-compat.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 400d898..68cbec8 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -301,9 +301,14 @@ static size_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
static void *aio_thread(void *unused)
{
pid_t pid;
+ sigset_t set;
pid = getpid();
+ /* block all signals */
+ if (sigfillset(&set)) die("sigfillset");
+ if (sigprocmask(SIG_BLOCK, &set, NULL)) die("sigprocmask");
+
while (1) {
struct qemu_paiocb *aiocb;
size_t ret = 0;
@@ -364,18 +369,9 @@ static void *aio_thread(void *unused)
static void spawn_thread(void)
{
- sigset_t set, oldset;
-
cur_threads++;
idle_threads++;
-
- /* block all signals */
- if (sigfillset(&set)) die("sigfillset");
- if (sigprocmask(SIG_SETMASK, &set, &oldset)) die("sigprocmask");
-
thread_create(&thread_id, &attr, aio_thread, NULL);
-
- if (sigprocmask(SIG_SETMASK, &oldset, NULL)) die("sigprocmask restore");
}
static void qemu_paio_submit(struct qemu_paiocb *aiocb)
--
1.6.5.rc2
next reply other threads:[~2009-10-07 13:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 13:20 Michael S. Tsirkin [this message]
2009-10-07 16:04 ` [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread" malc
2009-10-07 16:28 ` Anthony Liguori
2009-10-07 16:33 ` Michael S. Tsirkin
2009-10-07 20:44 ` Michael S. Tsirkin
2009-10-07 20:54 ` malc
2009-10-07 20:55 ` Michael S. Tsirkin
2009-10-07 21:01 ` malc
2009-10-08 1:47 ` Jamie Lokier
2009-10-08 2:48 ` malc
2009-10-08 15:15 ` Jamie Lokier
2009-10-08 16:39 ` malc
2009-10-09 11:12 ` Jamie Lokier
2009-10-09 13:13 ` malc
2009-10-08 21:24 ` Michael S. Tsirkin
2009-10-08 21:50 ` Anthony Liguori
2009-10-08 21:51 ` Anthony Liguori
2009-10-09 11:13 ` Jamie Lokier
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=20091007132006.GA9668@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=av1474@comtv.ru \
--cc=qemu-devel@nongnu.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).