Commit f38738e2 authored by Changlong Xie's avatar Changlong Xie Committed by Kevin Wolf
Browse files

quorum: fix segfault when read fails in fifo mode

parent 2875645b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
        }