[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/29] quorum: Emit QUORUM_REPORT_BAD for reads in fi
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 28/29] quorum: Emit QUORUM_REPORT_BAD for reads in fifo mode |
Date: |
Thu, 17 Mar 2016 16:56:41 +0100 |
From: Alberto Garcia <address@hidden>
If there's an I/O error in one of Quorum children then QEMU
should emit QUORUM_REPORT_BAD. However this is not working with
read-pattern=fifo. This patch fixes this problem.
Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/quorum.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/block/quorum.c b/block/quorum.c
index 3d47351..da15465 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -284,9 +284,17 @@ static void quorum_aio_cb(void *opaque, int ret)
QuorumChildRequest *sacb = opaque;
QuorumAIOCB *acb = sacb->parent;
BDRVQuorumState *s = acb->common.bs->opaque;
- QuorumOpType type;
bool rewrite = false;
+ if (ret == 0) {
+ acb->success_count++;
+ } else {
+ QuorumOpType type;
+ type = acb->is_read ? QUORUM_OP_TYPE_READ : QUORUM_OP_TYPE_WRITE;
+ quorum_report_bad(type, acb->sector_num, acb->nb_sectors,
+ sacb->aiocb->bs->node_name, ret);
+ }
+
if (acb->is_read && s->read_pattern == QUORUM_READ_PATTERN_FIFO) {
/* We try to read next child in FIFO order if we fail to read */
if (ret < 0 && (acb->child_iter + 1) < s->num_children) {
@@ -303,15 +311,8 @@ static void quorum_aio_cb(void *opaque, int ret)
return;
}
- type = acb->is_read ? QUORUM_OP_TYPE_READ : QUORUM_OP_TYPE_WRITE;
sacb->ret = ret;
acb->count++;
- if (ret == 0) {
- acb->success_count++;
- } else {
- quorum_report_bad(type, acb->sector_num, acb->nb_sectors,
- sacb->aiocb->bs->node_name, ret);
- }
assert(acb->count <= s->num_children);
assert(acb->success_count <= s->num_children);
if (acb->count < s->num_children) {
--
1.8.3.1
- [Qemu-devel] [PULL 17/29] block: Rewrite bdrv_next(), (continued)
- [Qemu-devel] [PULL 17/29] block: Rewrite bdrv_next(), Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 14/29] block: Move some bdrv_*_all() functions to BB, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 12/29] blockdev: Split monitor reference from BB creation, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 19/29] block: Remove bdrv_states list, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 21/29] block: Use blk_co_preadv() for blk_read(), Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 18/29] block: Use bdrv_next() instead of bdrv_states, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 22/29] block: Use blk_co_pwritev() for blk_write(), Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 23/29] block: Pull up blk_read_unthrottled() implementation, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 26/29] block: Use blk_aio_prwv() for aio_read/write/write_zeroes, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 20/29] block: Use BdrvChild in BlockBackend, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 28/29] quorum: Emit QUORUM_REPORT_BAD for reads in fifo mode,
Kevin Wolf <=
- [Qemu-devel] [PULL 25/29] block: Use blk_prw() in blk_pread()/blk_pwrite(), Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 24/29] block: Use blk_co_pwritev() in blk_write_zeroes(), Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 29/29] iotests: Test QUORUM_REPORT_BAD in fifo mode, Kevin Wolf, 2016/03/17
- [Qemu-devel] [PULL 27/29] block: Use blk_co_pwritev() in blk_co_write_zeroes(), Kevin Wolf, 2016/03/17
- Re: [Qemu-devel] [PULL 00/29] Block patches, Peter Maydell, 2016/03/17