From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CADB01FF173 for ; Tue, 30 Jul 2024 10:22:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BFB7E3833D; Tue, 30 Jul 2024 10:22:19 +0200 (CEST) Message-ID: <749e853a-5dd0-446e-967d-f8058fcd1be2@proxmox.com> Date: Tue, 30 Jul 2024 10:21:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Thomas Lamprecht , Proxmox VE development discussion References: <20240729142956.58257-1-f.ebner@proxmox.com> <098ccae5-6efa-4898-9ca0-f8478f43959d@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <098ccae5-6efa-4898-9ca0-f8478f43959d@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.060 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH storage] api: upload: correctly test for result of unlink X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 29.07.24 um 18:50 schrieb Thomas Lamprecht: > Am 29/07/2024 um 16:29 schrieb Fiona Ebner: >> It's not enough to check whether $! is set. From "perldoc perlvar": >> >>> Many system or library calls set "errno" if they fail, to >>> indicate the cause of failure. They usually do not set "errno" >>> to zero if they succeed and may set "errno" to a non-zero value >>> on success. This means "errno", hence $!, is meaningful only >>> *immediately* after a failure: >> >> To protect against potential issues, check the return value of unlink >> and only check $! if it failed. > > fine by me, but out of interest: any reason for why this is done now, > i.e., did this really cause trouble or is this done out of precaution? Sorry, while the commit message hints at it with "protect against potential issues", I could've been more explicit. I stumbled upon an old branch with this patch. Most likely I wrote it after needing the same logic with unlink for something else. I don't know about any concrete issues. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel