Skip to content

Commit

Permalink
quorum: fix segfault when read fails in fifo mode
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Changlong Xie authored and kevmw committed Feb 22, 2016
1 parent 2875645 commit f38738e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/quorum.c
Expand Up @@ -286,7 +286,8 @@ static void quorum_aio_cb(void *opaque, int 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 < s->num_children) {
if (ret < 0 && (acb->child_iter + 1) < s->num_children) {
acb->child_iter++;
read_fifo_child(acb);
return;
}
Expand Down

0 comments on commit f38738e

Please sign in to comment.