All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: Carlo Nyto <carlonyto@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Slow tape drive timeout
Date: Thu, 03 Apr 2008 20:25:00 -0600	[thread overview]
Message-ID: <47F5917C.5080803@shaw.ca> (raw)
In-Reply-To: <alpine.LSU.1.10.0804032121380.9918@kai.makisara.local>

Kai Makisara wrote:
> On Wed, 2 Apr 2008, Robert Hancock wrote:
> 
>> Kai Makisara wrote:
>>> On Tue, 1 Apr 2008, Carlo Nyto wrote:
>>>
>>>> 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.
>>>>
>>> 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 kernels did return
>>> immediately but the 2.6 kernels have always waited.
>>>
> ...
>> Why is accessing the tape drive with no tape in it causing a timeout in the
>> first place? I should think that would fail immediately with some "medium not
>> present" error from the drive. Unless the drive has no mechanism to detect it,
>> but that seems really retarded..
>>
> It does not seem retarded to me. If a program wants to just wait until the 
> tape drive becomes ready (e.g., loads the tape), it can use the blocking 
> open. This is simple. If a program wants to test the status, it uses 
> non-blocking open. The behavior mandated by the standards provides 
> alternatives. If O_NONBLOCK is not supported, the user program must 
> implement the waiting logic if the program just wants to wait until the 
> drive is ready before starting i/o.

This behavior is not consistent with any other removable storage device 
provided by Linux, however. If you try to open a CD-ROM device node when 
no disc is inserted, it doesn't block, it just gives you an error right 
away. Why should the tape drive behavior be different?

  reply	other threads:[~2008-04-04  2:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.iY7vJs54MoScDgyQ4PUWZsO+3Jw@ifi.uio.no>
     [not found] ` <fa.of3hIrxfNefAS08Tzqfm1dI0BOo@ifi.uio.no>
2008-04-03  4:21   ` Slow tape drive timeout Robert Hancock
2008-04-03 18:34     ` Kai Makisara
2008-04-04  2:25       ` Robert Hancock [this message]
2008-04-04 18:04         ` Kai Makisara
     [not found] <aepft-NF-5@gated-at.bofh.it>
     [not found] ` <aepft-NF-7@gated-at.bofh.it>
     [not found]   ` <aepfs-NF-3@gated-at.bofh.it>
     [not found]     ` <aeCw6-5Yu-35@gated-at.bofh.it>
2008-04-04  9:37       ` Bodo Eggert
2008-04-01 20:30 Carlo Nyto
2008-04-02  5:09 ` Kai Makisara

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=47F5917C.5080803@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=carlonyto@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.