block: Don't mark node clean after failed flush
authorKevin Wolf <kwolf@redhat.com>
Fri, 4 Nov 2016 23:03:15 +0000 (00:03 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 8 Nov 2016 16:06:35 +0000 (16:06 +0000)
commite6af1e085416378918cca357bf2abd8b90224667
tree721eaab75a6195c3191965ae4a0f351328272f8d
parent207faf24c58859f5240f66bf6decc33b87a1776e
block: Don't mark node clean after failed flush

Commit 3ff2f67a changed bdrv_co_flush() so that no flush is issues if
the image hasn't been dirtied since the last flush. This is not quite
correct: The condition should be that the image hasn't been dirtied
since the last _successful_ flush. This patch changes the logic
accordingly.

Without this fix, subsequent bdrv_co_flush() calls would return success
without actually doing anything even though the image is still dirty.
The difference is visible in some blkdebug test cases where error
messages incorrectly disappeared after commit 3ff2f67a.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1478300595-10090-1-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c
tests/qemu-iotests/026.out
tests/qemu-iotests/026.out.nocache
tests/qemu-iotests/071.out