[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/13] vvfat: fix qemu-img map and qemu-img convert
From: |
Hervé Poussineau |
Subject: |
[Qemu-devel] [PATCH 01/13] vvfat: fix qemu-img map and qemu-img convert |
Date: |
Mon, 15 May 2017 22:31:01 +0200 |
- 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
Signed-off-by: Hervé Poussineau <address@hidden>
---
block/vvfat.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index af5153d27d..dfa2a242e1 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2958,8 +2958,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) {
--
2.11.0
- [Qemu-devel] [PATCH 00/13] vvfat: misc fixes for read-only mode, Hervé Poussineau, 2017/05/15
- [Qemu-devel] [PATCH 01/13] vvfat: fix qemu-img map and qemu-img convert,
Hervé Poussineau <=
- [Qemu-devel] [PATCH 07/13] vvfat: always create . and .. entries at first and in that order, Hervé Poussineau, 2017/05/15
- [Qemu-devel] [PATCH 08/13] vvfat: correctly create long names for non-ASCII filenames, Hervé Poussineau, 2017/05/15
- [Qemu-devel] [PATCH 10/13] vvfat: correctly generate numeric-tail of short file names, Hervé Poussineau, 2017/05/15
- [Qemu-devel] [PATCH 06/13] vvfat: fix field names in FAT12/FAT16 boot sector, Hervé Poussineau, 2017/05/15
- [Qemu-devel] [PATCH 09/13] vvfat: correctly create base short names for non-ASCII filenames, Hervé Poussineau, 2017/05/15