qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Felipe Franciosi <felipe@nutanix.com>,
	qemu-block@nongnu.org, Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Peter Lieven <pl@kamp.de>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] block/iscsi: take iscsilun->mutex in iscsi_timed_check_events()
Date: Fri, 9 Feb 2018 18:49:33 +0100	[thread overview]
Message-ID: <d4a639cd-c6d5-ec20-2bd4-ba8084f97cfe@redhat.com> (raw)
In-Reply-To: <20180203061621.7033-3-stefanha@redhat.com>

On 03/02/2018 07:16, Stefan Hajnoczi wrote:
> Commit d045c466d9e62b4321fadf586d024d54ddfd8bd4 ("iscsi: do not use
> aio_context_acquire/release") introduced iscsilun->mutex but appears to
> have overlooked iscsi_timed_check_events() when introducing the mutex.
> 
> iscsi_service() and iscsi_set_events() must be called with
> iscsilun->mutex held.
> 
> iscsi_timed_check_events() is invoked from the AioContext and does not
> take the mutex.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> ---
>  block/iscsi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index cd0738942c..1cfe1c647c 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -339,6 +339,8 @@ static void iscsi_timed_check_events(void *opaque)
>  {
>      IscsiLun *iscsilun = opaque;
>  
> +    qemu_mutex_lock(&iscsilun->mutex);
> +
>      /* check for timed out requests */
>      iscsi_service(iscsilun->iscsi, 0);
>  
> @@ -351,6 +353,8 @@ static void iscsi_timed_check_events(void *opaque)
>       * to return to service once this situation changes. */
>      iscsi_set_events(iscsilun);
>  
> +    qemu_mutex_unlock(&iscsilun->mutex);
> +
>      timer_mod(iscsilun->event_timer,
>                qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL);
>  }
> 

  reply	other threads:[~2018-02-09 17:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03  6:16 [Qemu-devel] [PATCH v2 0/3] block/iscsi: fix ioctl cancel use-after-free Stefan Hajnoczi
2018-02-03  6:16 ` [Qemu-devel] [PATCH v2 1/3] block/iscsi: drop unused IscsiAIOCB->buf field Stefan Hajnoczi
2018-02-09 17:48   ` Paolo Bonzini
2018-02-03  6:16 ` [Qemu-devel] [PATCH v2 2/3] block/iscsi: take iscsilun->mutex in iscsi_timed_check_events() Stefan Hajnoczi
2018-02-09 17:49   ` Paolo Bonzini [this message]
2018-02-03  6:16 ` [Qemu-devel] [PATCH v2 3/3] block/iscsi: fix ioctl cancel use-after-free Stefan Hajnoczi
2018-02-09 17:48   ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2018-02-09 17:50   ` [Qemu-devel] " Paolo Bonzini
2018-02-13 16:52     ` Stefan Hajnoczi
2018-02-14 16:08   ` Felipe Franciosi
2018-02-15 10:37 ` [Qemu-devel] [PATCH v2 0/3] " Stefan Hajnoczi
2018-11-29  9:23   ` Paolo Bonzini

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=d4a639cd-c6d5-ec20-2bd4-ba8084f97cfe@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=felipe@nutanix.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).