From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup] tape: increase write timeouts to recommended values
Date: Thu, 3 Dec 2026 14:03:17 +0100 [thread overview]
Message-ID: <20261203131016.2641111-1-d.csapak@proxmox.com> (raw)
If tape write does not finish within it's set timeout, the kernel tries
to abort the command and returns 'transport error'. This can mask the
actual reason or abort the write prematurely in case it took longer than
expected.
Recommended timeout values differ by LTO version and vendor, but they
are much larger than our current 600 seconds. The recommended values are
there so the drive can recover in case of an error or writing out its
write buffer.
Use values from IBMs LTO SCSI reference for half-height LTO-6 drives,
since those are larger than others (HP, full-height and newer LTO
versions).
Downside to this is in case the drive truly hangs, the job is aborted
after a longer period instead of 10 minutes.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
There are two alternative approaches here that would be valid IMO:
* The linux kernel uses 900 s as timeout, which is still under the
recommended value, but higher than what we have. IMO this does not
improve the status quo, but at least there would be precedence.
* Query the drives timeout values with
`REPORT SUPPORTED OPERATION CODES` (A3h) command.
This is supported on newer drives and can report a recommened
timeout dynamically. We'd still have to have a fallback since
not all drives support these. I think longterm this would be nice
to have, but it's a much larger effort and ultimately won't
change the behavior drastically compared to this patch.
pbs-tape/src/sg_tape.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs
index a98e8960a..c3caa401d 100644
--- a/pbs-tape/src/sg_tape.rs
+++ b/pbs-tape/src/sg_tape.rs
@@ -614,7 +614,8 @@ impl SgTape {
proxmox_lang::io_format_err!("write_filemarks failed (alloc) - {err}")
})?;
- sg_raw.set_timeout(Self::SCSI_TAPE_DEFAULT_TIMEOUT);
+ // IBM LTO reference recommends 1740 s timeout for half-height LTO-6 drives.
+ sg_raw.set_timeout(1740);
let mut cmd = vec![0x10];
if immediate {
cmd.push(1); // IMMED=1
@@ -766,7 +767,8 @@ impl SgTape {
let mut sg_raw = SgRaw::new(&mut self.file, 0).unwrap(); // cannot fail with size 0
- sg_raw.set_timeout(Self::SCSI_TAPE_DEFAULT_TIMEOUT);
+ // IBM LTO reference recommends 1920s timeout for half-height LTO-6 drives.
+ sg_raw.set_timeout(1920);
let mut cmd = Vec::new();
cmd.push(0x0A); // WRITE
cmd.push(0x00); // VARIABLE SIZED BLOCKS
--
2.47.3
reply other threads:[~2026-12-03 13:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203131016.2641111-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox