Skip to content

Commit

Permalink
block: expect get_block_status errors in bdrv_make_zero
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
plieven authored and kevmw committed Dec 13, 2013
1 parent f671d17 commit 3d94ce6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block.c
Expand Up @@ -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;
Expand Down

0 comments on commit 3d94ce6

Please sign in to comment.