]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/iscsi: avoid data corruption with cache=writeback
authorPeter Lieven <pl@kamp.de>
Mon, 16 Jan 2017 15:17:12 +0000 (16:17 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 16 Mar 2017 17:10:40 +0000 (12:10 -0500)
commit3fb4b3c371a9c080e7f53d22e6a2202d9982a7c4
tree1e7fc7eda58fc74bc692b877bd5c144df2a475d8
parenta626117f6ae0dfe8089c7fa263c56b105f9fd47d
block/iscsi: avoid data corruption with cache=writeback

nb_cls_shrunk in iscsi_allocmap_update can become -1 if the
request starts and ends within the same cluster. This results
in passing -1 to bitmap_set and bitmap_clear and they don't
handle negative values properly. In the end this leads to data
corruption.

Fixes: e1123a3b40a1a9a625a29c8ed4debb7e206ea690
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <1484579832-18589-1-git-send-email-pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 1da45e0c4cf4719fa75898d019e0874b9b2bc774)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/iscsi.c