From: Marcelo Tosatti <mtosatti@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: make processes waiting on vcpu mutex killable
Date: Mon, 17 Sep 2012 13:47:18 -0300 [thread overview]
Message-ID: <20120917164718.GB25815@amt.cnet> (raw)
In-Reply-To: <20120916085030.GA23495@redhat.com>
On Sun, Sep 16, 2012 at 11:50:30AM +0300, Michael S. Tsirkin wrote:
> vcpu mutex can be held for unlimited time so
> taking it with mutex_lock on an ioctl is wrong:
> one process could be passed a vcpu fd and
> call this ioctl on the vcpu used by another process,
> it will then be unkillable until the owner exits.
>
> Call mutex_lock_killable instead and return status.
> Note: mutex_lock_interruptible would be even nicer,
> but I am not sure all users are prepared to handle EINTR
> from these ioctls. They might misinterpret it as an error.
>
> Cleanup paths expect a vcpu that can't be used by
> any userspace so this will always succeed - catch bugs
> by calling BUG_ON.
>
> Catch callers that don't check return state by adding
> __must_check.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
> It's a minor bugfix - should we put it in 3.6?
Applied to branch 'queue' on the basis its not a regression/critical problem,
thanks.
prev parent reply other threads:[~2012-09-17 16:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-16 8:50 [PATCH] kvm: make processes waiting on vcpu mutex killable Michael S. Tsirkin
2012-09-17 16:47 ` Marcelo Tosatti [this message]
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=20120917164718.GB25815@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.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