From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id D5C4C762DD for ; Mon, 18 Oct 2021 11:24:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C2B3E1F20C for ; Mon, 18 Oct 2021 11:24:14 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A63331F201 for ; Mon, 18 Oct 2021 11:24:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7BDAC4687A for ; Mon, 18 Oct 2021 11:24:13 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Mon, 18 Oct 2021 11:24:12 +0200 Message-Id: <20211018092412.2352235-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.293 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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] tape: simplify export_media_set for pool writer 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: , X-List-Received-Date: Mon, 18 Oct 2021 09:24:44 -0000 our export code can handle if the tape is inside the drive, so unloading it first does not have an benefit, it even makes the exporting slower, since we first unload it into its original slot, and then moving it to an import/export slot so drop the code that unloads the tape from the drive, and let the export code itself handle that change the 'eject' into a 'rewind' and comment why we do that first Signed-off-by: Dominik Csapak --- changes from v1: * do not drop the rewind first, so that the unload does not timeout. also fix comment and log for that src/tape/pool_writer/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs index 3f9232d8..5d8d1644 100644 --- a/src/tape/pool_writer/mod.rs +++ b/src/tape/pool_writer/mod.rs @@ -157,14 +157,12 @@ impl PoolWriter { if let Some((mut changer, _)) = media_changer(&drive_config, &self.drive_name)? { if let Some(ref mut status) = status { - task_log!(worker, "eject media"); - status.drive.eject_media()?; // rewind and eject early, so that unload_media is faster + task_log!(worker, "rewind media"); + // rewind first so that the unload command later does not run into a timeout + status.drive.rewind()?; } drop(status); // close drive - task_log!(worker, "unload media"); - changer.unload_media(None)?; - for media_uuid in self.pool.current_media_list()? { let media = self.pool.lookup_media(media_uuid)?; let label_text = media.label_text(); -- 2.30.2