diff options
author | Hervé Poussineau <hpoussin@reactos.org> | 2017-05-22 23:11:53 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-07-10 13:18:05 +0200 |
commit | 139921aaa77c435104308ad53b631a00c3b65ae8 (patch) | |
tree | d98abd05a888acb0cb20e8f7870f65f2e8548aea /block/vvfat.c | |
parent | 544daf6679cef4c0fac8b4a07deef305021a22c1 (diff) | |
download | qemu-139921aaa77c435104308ad53b631a00c3b65ae8.zip qemu-139921aaa77c435104308ad53b631a00c3b65ae8.tar.gz qemu-139921aaa77c435104308ad53b631a00c3b65ae8.tar.bz2 |
vvfat: fix qemu-img map and qemu-img convert
- bs->total_sectors is the number of sectors of the whole disk
- s->sector_count is the number of sectors of the FAT partition
This fixes the following assert in qemu-img map:
qemu-img.c:2641: get_block_status: Assertion `nb_sectors' failed.
This also fixes an infinite loop in qemu-img convert.
Fixes: 4480e0f924a42e1db8b8cfcac4d0634dd1bb27a0
Fixes: https://bugs.launchpad.net/qemu/+bug/1599539
Cc: qemu-stable@nongnu.org
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r-- | block/vvfat.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/vvfat.c b/block/vvfat.c index 8ab647c..040fb71 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2968,8 +2968,7 @@ vvfat_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *n, BlockDriverState **file) { - BDRVVVFATState* s = bs->opaque; - *n = s->sector_count - sector_num; + *n = bs->total_sectors - sector_num; if (*n > nb_sectors) { *n = nb_sectors; } else if (*n < 0) { |