public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 qemu 1/2] block/gluster: correctly set max_pdiscard which is int64_t
@ 2022-05-06 12:38 Fabian Ebner
  2022-05-06 12:38 ` [pve-devel] [PATCH v2 qemu 2/2] ui/vnc.c: Fixed a deadlock bug Fabian Ebner
  2022-05-11 10:08 ` [pve-devel] applied-series: [PATCH v2 qemu 1/2] block/gluster: correctly set max_pdiscard which is int64_t Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2022-05-06 12:38 UTC (permalink / raw)
  To: pve-devel

Previously, max_pdiscard would be zero in the following assertion:
qemu-system-x86_64: ../block/io.c:3166: bdrv_co_pdiscard: Assertion
`max_pdiscard >= bs->bl.request_alignment' failed.

Fixes: 0c8022876f ("block: use int64_t instead of int in driver discard handlers")
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Changes from v1:
    * Re-send as patch so both fixes can be applied independently.

Reported in the community forum:
https://forum.proxmox.com/threads/108875
and thanks to Mira for telling me how to reproduce it.

 block/gluster.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/gluster.c b/block/gluster.c
index 398976bc66..592e71b22a 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -891,7 +891,7 @@ out:
 static void qemu_gluster_refresh_limits(BlockDriverState *bs, Error **errp)
 {
     bs->bl.max_transfer = GLUSTER_MAX_TRANSFER;
-    bs->bl.max_pdiscard = SIZE_MAX;
+    bs->bl.max_pdiscard = INT64_MAX;
 }
 
 static int qemu_gluster_reopen_prepare(BDRVReopenState *state,
@@ -1304,7 +1304,7 @@ static coroutine_fn int qemu_gluster_co_pdiscard(BlockDriverState *bs,
     GlusterAIOCB acb;
     BDRVGlusterState *s = bs->opaque;
 
-    assert(bytes <= SIZE_MAX); /* rely on max_pdiscard */
+    assert(bytes <= INT64_MAX); /* rely on max_pdiscard */
 
     acb.size = 0;
     acb.ret = 0;
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-11 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 12:38 [pve-devel] [PATCH v2 qemu 1/2] block/gluster: correctly set max_pdiscard which is int64_t Fabian Ebner
2022-05-06 12:38 ` [pve-devel] [PATCH v2 qemu 2/2] ui/vnc.c: Fixed a deadlock bug Fabian Ebner
2022-05-11 10:08 ` [pve-devel] applied-series: [PATCH v2 qemu 1/2] block/gluster: correctly set max_pdiscard which is int64_t Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal