[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 52/54] qcow2: fix return error code in qcow2_truncate
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 52/54] qcow2: fix return error code in qcow2_truncate() |
Date: |
Fri, 6 Oct 2017 17:54:20 +0200 |
From: Pavel Butsykin <address@hidden>
Signed-off-by: Pavel Butsykin <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 33597394b5..960b3ab977 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3167,7 +3167,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t
offset,
if (old_file_size < 0) {
error_setg_errno(errp, -old_file_size,
"Failed to inquire current file length");
- return ret;
+ return old_file_size;
}
nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,
@@ -3196,7 +3196,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t
offset,
if (allocation_start < 0) {
error_setg_errno(errp, -allocation_start,
"Failed to resize refcount structures");
- return -allocation_start;
+ return allocation_start;
}
clusters_allocated = qcow2_alloc_clusters_at(bs, allocation_start,
--
2.13.6
- [Qemu-devel] [PULL 44/54] block: use 1 MB bounce buffers for crypto instead of 16KB, (continued)
- [Qemu-devel] [PULL 44/54] block: use 1 MB bounce buffers for crypto instead of 16KB, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 36/54] qemu-iotests: Test commit block job where top has two parents, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 43/54] iotests: Add test 197 for covering copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 47/54] block: convert crypto driver to bdrv_co_preadv|pwritev, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 50/54] block/mirror: check backing in bdrv_mirror_top_refresh_filename, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 48/54] block: convert qcrypto_block_encrypt|decrypt to take bytes offset, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 51/54] iotests: Fix 195 if IMGFMT is part of TEST_DIR, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 49/54] block: support passthrough of BDRV_REQ_FUA in crypto driver, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 53/54] qcow2: truncate the tail of the image file after shrinking the image, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 54/54] block/mirror: check backing in bdrv_mirror_top_flush, Kevin Wolf, 2017/10/06
- [Qemu-devel] [PULL 52/54] qcow2: fix return error code in qcow2_truncate(),
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 00/54] Block layer patches, Peter Maydell, 2017/10/06