[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/6] qcow2: Fix qcow2_truncate() error return val
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v2 1/6] qcow2: Fix qcow2_truncate() error return value |
Date: |
Tue, 26 Jun 2018 16:24:29 +0200 |
If qcow2_alloc_clusters_at() returns an error, we do need to negate it
to get back the positive errno code for error_setg_errno(), but we still
need to return the negative error code.
Fixes: 772d1f973f87269f6a4a4ea4b880680f3779bbdf
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index a3a3aa2a97..6b2e1e1058 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3597,7 +3597,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t
offset,
if (clusters_allocated < 0) {
error_setg_errno(errp, -clusters_allocated,
"Failed to allocate data clusters");
- return -clusters_allocated;
+ return clusters_allocated;
}
assert(clusters_allocated == nb_new_data_clusters);
--
2.13.6
- [Qemu-devel] [PATCH v2 0/6] file-posix: Make truncate/preallocate asynchronous, Kevin Wolf, 2018/06/26
- [Qemu-devel] [PATCH v2 1/6] qcow2: Fix qcow2_truncate() error return value,
Kevin Wolf <=
- [Qemu-devel] [PATCH v2 3/6] qcow2: Remove coroutine trampoline for preallocate_co(), Kevin Wolf, 2018/06/26
- [Qemu-devel] [PATCH v2 4/6] block: Move bdrv_truncate() implementation to io.c, Kevin Wolf, 2018/06/26
- [Qemu-devel] [PATCH v2 5/6] block: Use tracked request for truncate, Kevin Wolf, 2018/06/26
- [Qemu-devel] [PATCH v2 6/6] file-posix: Make .bdrv_co_truncate asynchronous, Kevin Wolf, 2018/06/26
- [Qemu-devel] [PATCH v2 2/6] block: Convert .bdrv_truncate callback to coroutine_fn, Kevin Wolf, 2018/06/26