[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb()
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb() |
Date: |
Mon, 21 Mar 2016 12:28:32 -0500 |
From: Alberto Garcia <address@hidden>
quorum_aio_cb() emits the QUORUM_REPORT_BAD event if there's
an I/O error in a Quorum child. However sacb->aiocb must be
correctly initialized for this to happen. read_quorum_children() and
read_fifo_child() are not doing this, which results in a QEMU crash.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
(cherry picked from commit b9c600d20716b3d942cb07188ff998fb236a8365)
Signed-off-by: Michael Roth <address@hidden>
---
block/quorum.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/quorum.c b/block/quorum.c
index b9ba028..e640688 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -646,8 +646,9 @@ static BlockAIOCB *read_quorum_children(QuorumAIOCB *acb)
}
for (i = 0; i < s->num_children; i++) {
- bdrv_aio_readv(s->children[i]->bs, acb->sector_num, &acb->qcrs[i].qiov,
- acb->nb_sectors, quorum_aio_cb, &acb->qcrs[i]);
+ acb->qcrs[i].aiocb = bdrv_aio_readv(s->children[i]->bs,
acb->sector_num,
+ &acb->qcrs[i].qiov,
acb->nb_sectors,
+ quorum_aio_cb, &acb->qcrs[i]);
}
return &acb->common;
@@ -662,9 +663,10 @@ static BlockAIOCB *read_fifo_child(QuorumAIOCB *acb)
qemu_iovec_init(&acb->qcrs[acb->child_iter].qiov, acb->qiov->niov);
qemu_iovec_clone(&acb->qcrs[acb->child_iter].qiov, acb->qiov,
acb->qcrs[acb->child_iter].buf);
- bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
- &acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
- quorum_aio_cb, &acb->qcrs[acb->child_iter]);
+ acb->qcrs[acb->child_iter].aiocb =
+ bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
+ &acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
+ quorum_aio_cb, &acb->qcrs[acb->child_iter]);
return &acb->common;
}
--
1.9.1
- [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond, (continued)
- [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 22/35] fw_cfg: avoid calculating invalid current entry pointer, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb(),
Michael Roth <=
- [Qemu-devel] [PATCH 33/35] target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 02/35] net: vmxnet3: avoid memory leakage in activate_device, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 04/35] configure: Fix shell syntax to placate OpenBSD's pdksh, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 05/35] xen/blkif: Avoid double access to src->nr_segments, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 06/35] xenfb: avoid reading twice the same fields from the shared page, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 08/35] scsi: initialise info object with appropriate size, Michael Roth, 2016/03/21