Skip to contentSkip to conversation

block: expect get_block_status errors in bdrv_make_zero

PATCH In review Peter Lieven 3 participants 3 messages Dec 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 invinite loop.

---
 block.c |    5 +++++
 1 file changed, 5 insertions(+)
block.c +5 -0
index 13f001a..64e7d22 100644
@@ -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;
Signature · 1 line
1.7.9.5
#2 lore raw

Am 12.12.2013 um 14:31 hat Stefan Hajnoczi geschrieben:

Quoted 4 lines · Peter Lieven
Quoted 3 lines

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.

s/invinite/infinite/

Quoted 8 lines
Quoted 6 lines
---
 block.c |    5 +++++
 1 file changed, 5 insertions(+)

Thanks, fixed up the typo in the commit message and applied to the block branch.

Kevin