All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org,   Fabiano Rosas <farosas@suse.de>,
	  Peter Xu <peterx@redhat.com>,
	  Leonardo Bras <leobras@redhat.com>
Subject: Re: [PATCH] migration: Unlock mutex in error case
Date: Thu, 02 Nov 2023 13:16:13 +0000	[thread overview]
Message-ID: <87ttq447oi.fsf@draig.linaro.org> (raw)
In-Reply-To: <20231102091245.42045-1-quintela@redhat.com> (Juan Quintela's message of "Thu, 2 Nov 2023 10:12:45 +0100")

Juan Quintela <quintela@redhat.com> writes:

> We were not unlocking bitmap mutex on the error case.
> Coverity discovered the problem.
>
> Fixes: a2326705e5 ("migration: Stop migration immediately in RDMA error paths")
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/ram.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 34724e8fe8..8c4df60f29 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
>          ret = rdma_registration_start(f, RAM_CONTROL_ROUND);
>          if (ret < 0) {
>              qemu_file_set_error(f, ret);
> +            qemu_mutex_unlock(&rs->bitmap_mutex);

I see the function uses the WITH_RCU_READ_LOCK_GUARD() macro to autofree
the RCU lock so why not use WITH_QEMU_LOCK_GUARD() instead of manually
checking the error cases?

>              goto out;
>          }

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  parent reply	other threads:[~2023-11-02 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  9:12 [PATCH] migration: Unlock mutex in error case Juan Quintela
2023-11-02 12:50 ` Peter Maydell
2023-11-02 13:16 ` Alex Bennée [this message]
2023-11-03  7:37   ` Juan Quintela
2023-11-02 13:41 ` Peter Xu

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=87ttq447oi.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.