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 A57A81FF13C for ; Thu, 30 Apr 2026 17:07:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 89990EAAC; Thu, 30 Apr 2026 17:07:20 +0200 (CEST) From: Robert Obkircher To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 08/10] datastore: check file system space for blobs and group notes Date: Thu, 30 Apr 2026 17:05:49 +0200 Message-ID: <20260430150607.330413-12-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260430150607.330413-1-r.obkircher@proxmox.com> References: <20260430150607.330413-1-r.obkircher@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777561507807 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.059 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 Message-ID-Hash: O5QWETFZGH4RFBVZODXL2SKOHINPLBV4 X-Message-ID-Hash: O5QWETFZGH4RFBVZODXL2SKOHINPLBV4 X-MailFrom: r.obkircher@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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This covers upload_blob and upload_backup_log. Signed-off-by: Robert Obkircher --- pbs-datastore/src/datastore.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs index 34efcd398..def88f30a 100644 --- a/pbs-datastore/src/datastore.rs +++ b/pbs-datastore/src/datastore.rs @@ -3386,6 +3386,7 @@ impl DataStore { .context("failed to set notes on s3 backend")?; } let notes_path = self.group_notes_path(backup_group.backup_ns(), backup_group.group()); + self.check_space(notes.len() as u64)?; replace_file(notes_path, notes.as_bytes(), CreateOptions::new(), false) .context("failed to replace group notes file")?; Ok(()) @@ -3419,6 +3420,7 @@ impl DataStore { let mut path = snapshot.full_path(); path.push(filename); + self.check_space(blob.raw_size())?; replace_file(&path, blob.raw_data(), CreateOptions::new(), false)?; Ok(()) } @@ -3496,6 +3498,10 @@ impl DataStore { result } + + pub fn check_space(&self, size: u64) -> Result<(), Error> { + self.inner.chunk_store.check_space(size) + } } /// Track S3 object keys to be deleted by garbage collection while holding their file lock. -- 2.47.3