[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.2 27/45] migration: Fix possible race when setting rp_state.
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.2 27/45] migration: Fix possible race when setting rp_state.error |
Date: |
Wed, 4 Oct 2023 11:01:48 +0300 |
From: Fabiano Rosas <farosas@suse.de>
We don't need to set the rp_state.error right after a shutdown because
qemu_file_shutdown() always sets the QEMUFile error, so the return
path thread would have seen it and set the rp error itself.
Setting the error outside of the thread is also racy because the
thread could clear it after we set it.
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230918172822.19052-3-farosas@suse.de>
(cherry picked from commit 28a8347281e24c2e7bba6d3301472eda41d4c096)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/migration/migration.c b/migration/migration.c
index 6a7122694a..b92c6ae436 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2063,7 +2063,6 @@ static int
await_return_path_close_on_source(MigrationState *ms)
* waiting for the destination.
*/
qemu_file_shutdown(ms->rp_state.from_dst_file);
- mark_source_rp_bad(ms);
}
trace_await_return_path_close_on_source_joining();
qemu_thread_join(&ms->rp_state.rp_thread);
--
2.39.2
- [Stable-8.1.2 16/45] file-posix: Simplify raw_co_prw's 'out' zone code, (continued)
- [Stable-8.1.2 16/45] file-posix: Simplify raw_co_prw's 'out' zone code, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 07/45] hw/ppc: Reset timebase facilities on machine reset, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 10/45] linux-user/hppa: lock both words of function descriptor, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 15/45] file-posix: Fix zone update in I/O error path, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 14/45] file-posix: Check bs->bl.zoned for zone info, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 12/45] hw/cxl: Fix out of bound array access, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 09/45] linux-user/hppa: clear the PSW 'N' bit when delivering signals, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 05/45] target/ppc: Sign-extend large decrementer to 64-bits, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 06/45] hw/ppc: Always store the decrementer value, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 24/45] ui/vnc: fix debug output for invalid audio message, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 27/45] migration: Fix possible race when setting rp_state.error,
Michael Tokarev <=
- [Stable-8.1.2 19/45] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 20/45] target/arm: Don't skip MTE checks for LDRT/STRT at EL0, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 21/45] meson.build: Make keyutils independent from keyring, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 23/45] hw/scsi/scsi-disk: Disallow block sizes smaller than 512 [CVE-2023-42467], Michael Tokarev, 2023/10/04
- [Stable-8.1.2 18/45] include/exec: Widen tlb_hit/tlb_hit_page(), Michael Tokarev, 2023/10/04
- [Stable-8.1.2 25/45] ui/vnc: fix handling of VNC_FEATURE_XVP, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 26/45] migration: Fix race that dest preempt thread close too early, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 17/45] tests/file-io-error: New test, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 22/45] accel/tcg: mttcg remove false-negative halted assertion, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 29/45] migration: Fix possible race when shutting down to_dst_file, Michael Tokarev, 2023/10/04