Fix co_truncate size division by BDRV_SECTOR_SIZE
This commit is contained in:
+5
-1
@@ -585,7 +585,11 @@ static int coroutine_fn vitastor_co_truncate(BlockDriverState *bs, int64_t offse
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Resize inode to <offset> bytes
|
// TODO: Resize inode to <offset> bytes
|
||||||
client->size = offset / BDRV_SECTOR_SIZE;
|
#if QEMU_VERSION_MAJOR >= 4
|
||||||
|
client->size = exact || client->size < offset ? offset : client->size;
|
||||||
|
#else
|
||||||
|
client->size = offset;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user