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 8123E1FF0C0 for ; Wed, 21 Oct 2026 14:21:20 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8E8A8214F3; Wed, 21 Oct 2026 14:21:18 +0200 (CEST) From: Kefu Chai To: pve-devel@lists.proxmox.com Subject: [PATCH storage] plugin: rbd: export: skip 'rbd du' when querying the size Date: Wed, 21 Oct 2026 20:21:11 +0800 Message-ID: <20261021122111.4181795-1-k.chai@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792585273545 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.287 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: MWHEPDXXIWRGSRLNAUAUWWMDXCV54LYZ X-Message-ID-Hash: MWHEPDXXIWRGSRLNAUAUWWMDXCV54LYZ X-MailFrom: k.chai@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: volume_export() only needs the image size, but it calls volume_size_info() in list context. In that context volume_size_info() also runs 'rbd du' to get the used space, which walks every object on images without fast-diff. The export then never uses the result. Call it in scalar context. Signed-off-by: Kefu Chai --- src/PVE/Storage/RBDPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm index 2d1d7a6..b5e82c7 100644 --- a/src/PVE/Storage/RBDPlugin.pm +++ b/src/PVE/Storage/RBDPlugin.pm @@ -1016,7 +1016,7 @@ sub volume_export { die "cannot export volumes together with their snapshots in $class\n" if $with_snapshots; die "cannot export an incremental stream in $class\n" if defined($base_snapshot); - my ($size) = $class->volume_size_info($scfg, $storeid, $volname); + my $size = $class->volume_size_info($scfg, $storeid, $volname); PVE::Storage::Plugin::write_common_header($fh, $size); my $cmd = $rbd_cmd->($scfg, $storeid, 'export', '--export-format', '1', $volname, '-'); run_rbd_command( -- 2.47.3