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 333FA1FF0DD for ; Thu, 22 Oct 2026 14:06:47 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A4E8D21480; Thu, 22 Oct 2026 14:06:45 +0200 (CEST) Date: Thu, 22 Oct 2026 14:06:41 +0200 From: Wolfgang Bumiller To: Shannon Sterz Subject: applied: [PATCH cluster 02/21] pmxcfs: correctly log message when directory can't be created Message-ID: References: <20260828133030.351140-1-s.sterz@proxmox.com> <20260828133030.351140-3-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260828133030.351140-3-s.sterz@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792670801502 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.423 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: 67TLFRMD56FNUN67LXBULVUYOFOKBA5I X-Message-ID-Hash: 67TLFRMD56FNUN67LXBULVUYOFOKBA5I X-MailFrom: w.bumiller@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: applied cluster patches 1 & 2 On Fri, Aug 28, 2026 at 03:30:11PM +0200, Shannon Sterz wrote: > `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 > > > > > --