From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 31FC51FF0B2 for ; Mon, 24 Aug 2026 10:57:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 52B42215BA; Mon, 24 Aug 2026 10:57:21 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH cluster 03/12] pmxcfs: server: simplify non-negative ipc message result responses Date: Mon, 24 Aug 2026 10:56:02 +0200 Message-ID: <20260824085610.111211-5-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260824085610.111211-2-d.kral@proxmox.com> References: <20260824085610.111211-2-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787561806161 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.984 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: GRZ4H5LU5FZUIKX2332DLCTFSF5CU7J3 X-Message-ID-Hash: GRZ4H5LU5FZUIKX2332DLCTFSF5CU7J3 X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The result variable is used as the error code in the QB response header, where libqb and PVE::IPCC expects it to be 0 for successful responses. The request handler for CFS_IPC_GET_CONFIG is the last remaining handler to set result to a non-negative value: it does set result to the returned config file size in case of a successful memdb_read() request. Therefore, set result to 0 in case of a successful read operation and remove the now unnecessary catch-all zero assignment when handling successful responses. No functional changes intended. Signed-off-by: Daniel Kral --- src/pmxcfs/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pmxcfs/server.c b/src/pmxcfs/server.c index 278e2c9..22e812c 100644 --- a/src/pmxcfs/server.c +++ b/src/pmxcfs/server.c @@ -251,6 +251,7 @@ static int32_t s1_msg_process_fn(qb_ipcs_connection_t *c, void *data, size_t siz if (result > 0) { g_string_append_len(outbuf, tmp, result); g_free(tmp); + result = 0; } } } @@ -452,7 +453,6 @@ static int32_t s1_msg_process_fn(qb_ipcs_connection_t *c, void *data, size_t siz if (result >= 0) { resp = outbuf->str; - result = 0; } int iov_len = 2; -- 2.47.3