From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 734011FF0DF for ; Fri, 28 Aug 2026 15:30:47 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4DF1621579; Fri, 28 Aug 2026 15:30:38 +0200 (CEST) From: Shannon Sterz To: pve-devel@lists.proxmox.com Subject: [PATCH cluster 02/21] pmxcfs: correctly log message when directory can't be created Date: Fri, 28 Aug 2026 15:30:11 +0200 Message-ID: <20260828133030.351140-3-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260828133030.351140-1-s.sterz@proxmox.com> References: <20260828133030.351140-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787923824153 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.229 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: H7WJ3HMNWVXARWNPWSYPACD7SQR724ME X-Message-ID-Hash: H7WJ3HMNWVXARWNPWSYPACD7SQR724ME X-MailFrom: s.sterz@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: `mkdir(2)` returns 0 on success and -1 on error. so the check that -1 is returned instead of inverting the return value. since errno would not be set on success, this either never triggered or acted on stale errnos only. Signed-off-by: Shannon Sterz --- Notes: feel free to merge this into the previous commit. mainly sending this to separate changes that affect behavior from those that only affect formatting src/pmxcfs/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pmxcfs/status.c b/src/pmxcfs/status.c index 4aeeaee..9581e2a 100644 --- a/src/pmxcfs/status.c +++ b/src/pmxcfs/status.c @@ -1232,7 +1232,7 @@ static inline const char *rrd_skip_data(const char *data, int count, char separa } static inline void checked_mkdir(char *path, int mode) { - if (!mkdir(path, mode) && errno != EEXIST) { + if (mkdir(path, mode) == -1 && errno != EEXIST) { cfs_message("could not create directory %s: %s", path, strerror(errno)); } } -- 2.47.3