projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c0ed2a
)
rbd: shift byte count as a 64-bit value
author
Paolo Bonzini
<pbonzini@redhat.com>
Mon, 10 Oct 2016 19:58:58 +0000
(21:58 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Sun, 23 Oct 2016 14:10:59 +0000
(16:10 +0200)
Otherwise, reads of more than 2GB fail. Until commit
7bbca9e290a9c7c217b5a24fc6094e91e54bd05d
, reads of 2^41
bytes succeeded at least theoretically.
In fact, pdiscard ought to receive a 64-bit integer as the
count for the same reason.
Reported by Coverity.
Fixes: 7bbca9e290a9c7c217b5a24fc6094e91e54bd05d
Cc: qemu-stable@nongnu.org
Cc: kwolf@redhat.com
Cc: eblake@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/rbd.c
patch
|
blob
|
history
diff --git
a/block/rbd.c
b/block/rbd.c
index 6f9eb6fb9c7f66eb9f71e8ac38278337af9b8060..f6e1d4bc11275bcef4b1ca868574e29b0583a511 100644
(file)
--- a/
block/rbd.c
+++ b/
block/rbd.c
@@
-733,7
+733,7
@@
static BlockAIOCB *qemu_rbd_aio_readv(BlockDriverState *bs,
void *opaque)
{
return rbd_start_aio(bs, sector_num << BDRV_SECTOR_BITS, qiov,
- nb_sectors << BDRV_SECTOR_BITS, cb, opaque,
+
(int64_t)
nb_sectors << BDRV_SECTOR_BITS, cb, opaque,
RBD_AIO_READ);
}
@@
-745,7
+745,7
@@
static BlockAIOCB *qemu_rbd_aio_writev(BlockDriverState *bs,
void *opaque)
{
return rbd_start_aio(bs, sector_num << BDRV_SECTOR_BITS, qiov,
- nb_sectors << BDRV_SECTOR_BITS, cb, opaque,
+
(int64_t)
nb_sectors << BDRV_SECTOR_BITS, cb, opaque,
RBD_AIO_WRITE);
}