[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] block: expect get_block_status errors in bdrv_make_
From: |
Peter Lieven |
Subject: |
[Qemu-devel] [PATCH] block: expect get_block_status errors in bdrv_make_zero |
Date: |
Thu, 12 Dec 2013 13:57:05 +0100 |
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 invinite loop.
CC: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
---
block.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block.c b/block.c
index 13f001a..64e7d22 100644
--- a/block.c
+++ b/block.c
@@ -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;
--
1.7.9.5
- [Qemu-devel] [PATCH] block: expect get_block_status errors in bdrv_make_zero,
Peter Lieven <=