* [PATCH proxmox-backup] tape: increase write timeouts to recommended values
@ 2026-12-03 13:03 Dominik Csapak
0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2026-12-03 13:03 UTC (permalink / raw)
To: pbs-devel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 13:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 13:03 [PATCH proxmox-backup] tape: increase write timeouts to recommended values Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox