2021-03-15 18:41:24 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Stefan Reiter <s.reiter@proxmox.com>
|
|
|
|
Date: Tue, 2 Mar 2021 16:11:54 +0100
|
|
|
|
Subject: [PATCH] block/io: accept NULL qiov in bdrv_pad_request
|
|
|
|
|
|
|
|
Some operations, e.g. block-stream, perform reads while discarding the
|
|
|
|
results (only copy-on-read matters). In this case they will pass NULL as
|
|
|
|
the target QEMUIOVector, which will however trip bdrv_pad_request, since
|
|
|
|
it wants to extend its passed vector.
|
|
|
|
|
|
|
|
Simply check for NULL and do nothing, there's no reason to pad the
|
|
|
|
target if it will be discarded anyway.
|
2022-01-13 12:34:33 +03:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
2021-03-15 18:41:24 +03:00
|
|
|
---
|
2021-05-27 13:43:32 +03:00
|
|
|
block/io.c | 4 ++++
|
|
|
|
1 file changed, 4 insertions(+)
|
2021-03-15 18:41:24 +03:00
|
|
|
|
|
|
|
diff --git a/block/io.c b/block/io.c
|
2024-01-30 17:14:37 +03:00
|
|
|
index 83d1b1dfdc..24a3c84c93 100644
|
2021-03-15 18:41:24 +03:00
|
|
|
--- a/block/io.c
|
|
|
|
+++ b/block/io.c
|
2023-10-17 15:10:09 +03:00
|
|
|
@@ -1710,6 +1710,10 @@ static int bdrv_pad_request(BlockDriverState *bs,
|
|
|
|
int sliced_niov;
|
|
|
|
size_t sliced_head, sliced_tail;
|
2021-03-15 18:41:24 +03:00
|
|
|
|
2021-05-27 13:43:32 +03:00
|
|
|
+ if (!qiov) {
|
|
|
|
+ return 0;
|
2021-03-15 18:41:24 +03:00
|
|
|
+ }
|
|
|
|
+
|
2023-10-17 15:10:09 +03:00
|
|
|
/* Should have been checked by the caller already */
|
|
|
|
ret = bdrv_check_request32(*offset, *bytes, *qiov, *qiov_offset);
|
|
|
|
if (ret < 0) {
|