diff options
author | Peter Lieven <pl@kamp.de> | 2013-12-12 13:57:05 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-12-13 14:49:50 +0100 |
commit | 3d94ce60ae7ad7c31dc143fdd9da95c61b4e529e (patch) | |
tree | 19cbaee7ad7ffef5297e63611341a0d756775c78 | |
parent | f671d173c7e1da555b693e8b14f3ed0852601809 (diff) |
block: expect get_block_status errors in bdrv_make_zero
during testing around with 4k LUNs a bad target implementation
triggert an -EIO in iscsi_get_block_status, but it got never caught
resulting in an infinite loop.
CC: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2421,6 +2421,11 @@ int bdrv_make_zero(BlockDriverState *bs, BdrvRequestFlags flags) nb_sectors = INT_MAX; } ret = bdrv_get_block_status(bs, sector_num, nb_sectors, &n); + if (ret < 0) { + error_report("error getting block status at sector %" PRId64 ": %s", + sector_num, strerror(-ret)); + return ret; + } if (ret & BDRV_BLOCK_ZERO) { sector_num += n; continue; |