From: Andrew Morton <akpm@osdl.org>
To: vatsa@in.ibm.com
Cc: linux-kernel@vger.kernel.org, Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] call_usermodehelper needs to wait longer
Date: Tue, 9 Mar 2004 13:38:35 -0800 [thread overview]
Message-ID: <20040309133835.2343565c.akpm@osdl.org> (raw)
In-Reply-To: <20040309135143.GB26645@in.ibm.com>
Srivatsa Vaddagiri <vatsa@in.ibm.com> wrote:
>
> During my testing of call_usermodehelper, I noticed that
> if it is called from a workqueue function, it does really wait
> (when asked to) for the usermodehelper to exit.
>
> Patch below should fix it. It has been tested against 2.6.4-rc2-mm1
> on a 4-way x86 SMP box.
>
> --- kmod.c.org 2004-03-09 18:52:19.000000000 +0530
> +++ kmod.c 2004-03-09 18:52:38.000000000 +0530
> @@ -258,10 +258,13 @@
> if (current_is_keventd()) {
> /* We can't wait on keventd! */
> __call_usermodehelper(&sub_info);
> - } else {
> + if (!wait)
> + goto out;
> + } else
> schedule_work(&work);
> - wait_for_completion(&done);
> - }
> +
> + wait_for_completion(&done);
> +
> out:
> return sub_info.retval;
> }
I'm not so sure about this. There are deadlock potentials if the usermode
application wants to perform some function which requires keventd services
to complete - the application cannot complete because keventd is itself
waiting for the application.
Can we think of any circumstances under which keventd _should_
synchronously wait for the userspace app?
btw: your patch had whitespace where the tabs should be (email client
problem), and `patch -p1' format is (much) preferred.
next prev parent reply other threads:[~2004-03-09 21:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-09 13:51 Srivatsa Vaddagiri
2004-03-09 21:38 ` Andrew Morton [this message]
2004-03-10 8:24 ` Srivatsa Vaddagiri
2004-03-10 10:47 ` Rusty Russell
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=20040309133835.2343565c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=vatsa@in.ibm.com \
/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
all inboxes | Powered by JetHome®