Skip to contentSkip to conversation

block: fix bdrv_read_unthrottled()

PATCH Applied Peter Lieven 4 participants 5 messages Jul 18, 2013 – Jul 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: fix bdrv_read_unthrottled()

---
 block.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
index b560241..c7f0197 100644
@@ -2250,7 +2250,7 @@ int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num,
 
     enabled = bs->io_limits_enabled;
     bs->io_limits_enabled = false;
-    ret = bdrv_read(bs, 0, buf, 1);
+    ret = bdrv_read(bs, sector_num, buf, nb_sectors);
     bs->io_limits_enabled = enabled;
     return ret;
 }
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw

Il 18/07/2013 10:37, Peter Lieven ha scritto:

Quoted 11 lines
---
 block.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +0 -0
index b560241..c7f0197 100644

block.c int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, · line 2256

Quoted 8 lines
block.c +1 -1
@@ -2250,7 +2250,7 @@ int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num,
 
     enabled = bs->io_limits_enabled;
     bs->io_limits_enabled = false;
-    ret = bdrv_read(bs, 0, buf, 1);
+    ret = bdrv_read(bs, sector_num, buf, nb_sectors);
     bs->io_limits_enabled = enabled;
     return ret;
 }
Reviewed-by on v1 1/1
#3 lore raw
In reply to Peter Lieven

Am 18.07.2013 um 10:37 hat Peter Lieven geschrieben:

Quoted 10 lines
---
 block.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +0 -0
index b560241..c7f0197 100644

block.c int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, · line 2256

Quoted 8 lines
block.c +1 -1
@@ -2250,7 +2250,7 @@ int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num,
 
     enabled = bs->io_limits_enabled;
     bs->io_limits_enabled = false;
-    ret = bdrv_read(bs, 0, buf, 1);
+    ret = bdrv_read(bs, sector_num, buf, nb_sectors);
     bs->io_limits_enabled = enabled;
     return ret;
 }

The commit message would have deserved a comment about the impact. The only caller is passing 0 as sector_num and 1 as nb_sectors, so this doesn't change the behaviour in practice. (Which is the reason why it's not for qemu-stable.)

Kevin

#4 lore raw
Quoted 21 lines · Kevin Wolf

Am 18.07.2013 um 10:37 hat Peter Lieven geschrieben:

Quoted 10 lines
---
  block.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
block.c +0 -0
index b560241..c7f0197 100644

block.c int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, · line 2256

Quoted 8 lines
block.c +1 -1
@@ -2250,7 +2250,7 @@ int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num,
 
      enabled = bs->io_limits_enabled;
      bs->io_limits_enabled = false;
-    ret = bdrv_read(bs, 0, buf, 1);
+    ret = bdrv_read(bs, sector_num, buf, nb_sectors);
      bs->io_limits_enabled = enabled;
      return ret;
  }
Quoted 4 lines

The commit message would have deserved a comment about the impact. The only caller is passing 0 as sector_num and 1 as nb_sectors, so this doesn't change the behaviour in practice. (Which is the reason why it's not for qemu-stable.)

Yes, I only spotted it while working on 4KN support.

Peter