[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/54] block/iscsi: take iscsilun->mutex in iscsi_tim
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 13/54] block/iscsi: take iscsilun->mutex in iscsi_timed_check_events() |
Date: |
Wed, 12 Dec 2018 16:22:34 +0100 |
From: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index a4e3730..1924a2b 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -344,6 +344,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);
@@ -356,6 +358,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);
}
--
1.8.3.1
- [Qemu-devel] [PULL 08/54] memory: extract flat_range_coalesced_io_{del, add}, (continued)
- [Qemu-devel] [PULL 08/54] memory: extract flat_range_coalesced_io_{del, add}, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 14/54] block/iscsi: fix ioctl cancel use-after-free, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 05/54] checkpatch: improve handling of multiple patches or files, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 20/54] build-sys: build with Vista API by default, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 07/54] pam: wrap MemoryRegion initialization in a transaction, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 03/54] checkpatch: fix premature exit when no input or --mailback, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 06/54] checkpatch: colorize output to terminal, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 25/54] qemu/queue.h: do not access tqe_prev directly, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 24/54] compiler.h: Add an explicit check for the compiler version, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 13/54] block/iscsi: take iscsilun->mutex in iscsi_timed_check_events(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 16/54] esp-pci: Fix status register write erase control, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 15/54] block/iscsi: cancel libiscsi task when ABORT TASK TMF completes, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 02/54] vhost-user-bridge: fix "unknown type name" compilation error, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 26/54] vfio: make vfio_address_spaces static, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 22/54] test: execute g_test_run when tests are skipped, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 17/54] scsi: esp: Defer command completion until previous interrupts have been handled, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 21/54] RFC: qga: drop < Vista compatibility, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 19/54] build-sys: move windows defines in osdep.h header, Paolo Bonzini, 2018/12/12
- [Qemu-devel] [PULL 10/54] memory: update coalesced_range on transaction_commit, Paolo Bonzini, 2018/12/12