From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 678F11FF165 for ; Thu, 6 Nov 2025 18:13:32 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 95D3F1E5BB; Thu, 6 Nov 2025 18:14:12 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Thu, 6 Nov 2025 18:13:56 +0100 Message-ID: <20251106171358.865503-2-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251106171358.865503-1-c.ebner@proxmox.com> References: <20251106171358.865503-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762449230162 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 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: [pbs-devel] [PATCH proxmox-backup v2 1/3] chunk store: limit scope for atime update helper methods X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" In preparation for fixing a race window due to missing chunk store locking. These should never be called from outside the crate. Signed-off-by: Christian Ebner --- changes since version 1: - not present in previous version pbs-datastore/src/chunk_store.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs index ba7618e40..1262377d5 100644 --- a/pbs-datastore/src/chunk_store.rs +++ b/pbs-datastore/src/chunk_store.rs @@ -204,7 +204,7 @@ impl ChunkStore { }) } - pub fn touch_chunk(&self, digest: &[u8; 32]) -> Result<(), Error> { + fn touch_chunk(&self, digest: &[u8; 32]) -> Result<(), Error> { // unwrap: only `None` in unit tests assert!(self.locker.is_some()); @@ -212,7 +212,11 @@ impl ChunkStore { Ok(()) } - pub fn cond_touch_chunk(&self, digest: &[u8; 32], assert_exists: bool) -> Result { + pub(super) fn cond_touch_chunk( + &self, + digest: &[u8; 32], + assert_exists: bool, + ) -> Result { // unwrap: only `None` in unit tests assert!(self.locker.is_some()); @@ -220,7 +224,7 @@ impl ChunkStore { self.cond_touch_path(&chunk_path, assert_exists) } - pub fn cond_touch_path(&self, path: &Path, assert_exists: bool) -> Result { + pub(super) fn cond_touch_path(&self, path: &Path, assert_exists: bool) -> Result { // unwrap: only `None` in unit tests assert!(self.locker.is_some()); -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel