Slow tape drive timeout

Previous thread: Linux 2.6.25-rc8 by Linus Torvalds on Tuesday, April 1, 2008 - 4:08 pm. (11 messages)

Next thread: [GIT PATCH] SCSI fixes for 2.6.25-rc8 by James Bottomley on Tuesday, April 1, 2008 - 4:36 pm. (3 messages)
To: <linux-kernel@...>
Date: Tuesday, April 1, 2008 - 4:30 pm

I am experiencing a two minute timeout open()ing a tape device when
there is no tape in the drive.

open() with O_NONBLOCK succeeds immediately, however.

The problem is that I am trying to set up Legato on a system that has
multiple tape drives. For certain common operations, Legato tries to
open() each tape drive multiple times. On a system with multiple tape
drives, this adds up to a significant amount of time wasted due to
this timeout.

Solaris does not have this problem, and Legato support advises that
they are at the mercy of the operating system.

Changing the timeout with e.g. "mt -f /dev/nst0 sttimeout 15" does not
change the timeout to 15 seconds, it is still exactly 2 minutes.

This happens with kernel 2.6.24.4, as well as RedHat's 2.6.9-67.

Here is a snippet of strace -T -tt output:

15:56:18.688392 open("/dev/nst0", O_RDONLY) = -1 ENOMEDIUM (No medium
found) <120.480482>

In this case, the tape device is a Quantum DLT-S4 connected to with an
Emulex FC card, via a Fibre Channel SAN.

Any help would be appreciated. Thanks.
--

To: Carlo Nyto <carlonyto@...>
Cc: <linux-kernel@...>
Date: Wednesday, April 2, 2008 - 1:09 am

This is how open() is supposed to work according to standards (e.g., SUS)
if O_NONBLOCK is supported. (Well, actually open() should wait
indefinitely but the non-linux systems I tested had a timeout.) The linux
st driver was changed to comply with standards at 2.5.3. I.e., the 2.4
You are not the only person who has noticed this. At work we had to
install a distribution using 2.4 kernel to our backup server in order to
use Legato ;-(

Solaris does return EIO. Either it does not support O_NONBLOCK or it is
not compliant with SUS.

Legato would not be so much "at the mercy of the operating system" if they
would write their software to work according to standards, not according
to some operating system.

--
Kai
--

Previous thread: Linux 2.6.25-rc8 by Linus Torvalds on Tuesday, April 1, 2008 - 4:08 pm. (11 messages)

Next thread: [GIT PATCH] SCSI fixes for 2.6.25-rc8 by James Bottomley on Tuesday, April 1, 2008 - 4:36 pm. (3 messages)