[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 005/100] vvfat: fix qemu-img map and qemu-img convert
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 005/100] vvfat: fix qemu-img map and qemu-img convert |
Date: |
Fri, 7 Jul 2017 19:07:20 +0200 |
From: Hervé Poussineau <address@hidden>
- 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: address@hidden
Signed-off-by: Hervé Poussineau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vvfat.c | 3 +--
1 file changed, 1 insertion(+), 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) {
--
1.8.3.1
- [Qemu-block] [PULL 000/100] Block layer patches, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 003/100] block: Simplify use of BDRV_BLOCK_RAW, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 004/100] blkdebug: Support .bdrv_co_get_block_status, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 002/100] block: Guarantee that *file is set on bdrv_get_block_status(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 001/100] qemu-io: Don't die on second open, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 005/100] vvfat: fix qemu-img map and qemu-img convert,
Kevin Wolf <=
- [Qemu-block] [PULL 007/100] vvfat: fix typos, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 008/100] vvfat: rename useless enumeration values, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 010/100] vvfat: fix field names in FAT12/FAT16 and FAT32 boot sectors, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 011/100] vvfat: always create . and .. entries at first and in that order, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 012/100] vvfat: correctly create long names for non-ASCII filenames, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 009/100] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 013/100] vvfat: correctly create base short names for non-ASCII filenames, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 014/100] vvfat: correctly generate numeric-tail of short file names, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 015/100] vvfat: limit number of entries in root directory in FAT12/FAT16, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 016/100] vvfat: handle KANJI lead byte 0xe5, Kevin Wolf, 2017/07/07